Robin Armstrong's picture

Hi, Newbie here. I have deployed successfully a Virtual Turnkey Linux v15. I can access Webmin, Adminer and the default Wordpress install. I’d like to additionally host another eight sites on the same server install. Four of the additional sites are basic html sites and another three are “php / database” sites (non wordpress) and another full separate WP site.

I have setup DNS and Apache virtual host to successfully reach the sites directories. I have created the DB user accounts as needed by the config.php from each site and assigned permissions. I have mirrored what is apparent from the embedded WP site.

So far the WP site that is pre-installed with TK works as do the basic html sites but I cannot get my four “php with database” sites to work. All I get is a blank page in most browsers or “This page isn’t working www.mysite.com is currently unable to handle this request. HTTP ERROR 500“

If I put a html document with some text in the root of the php site, the text does show so I know the virtual hosting is working but I am missing something to make the four php / db sites work ?

The databases have imported ok. I can see data in there with Adminer. I have created the DB accounts and assigned permissions. So far I have checked and re-checked the permissions on the DB, and that the php.config file has the correct username, DB name and password. The php sites use index.php as the initial page.

I have tried changing the directory and file permissions to www-data  of the sites to match the native WP site but all to no avail. Also I can see a permission of 0755 on the folders and 0644 on files the same as the embedded WP site.

On another note I have had the “php / DB” sites work when I used AMPPS on Windows 7 in a local host setup, so I have had the sites work in other installs.

Any suggestions as to what I may be missing that need to be enabled or changed to get these sites to work ?

Many thanks.

Forum: 
Jeremy Davis's picture

How have you set up the additional Apache vhosts?

Personally, the way I would do it would be to just copy the default WordPress setup, then modify it to add in the name based vhost info and point to your alternate docroot. E.g. assuming that your 2nd WordPress site is stored in /var/www/wordpress2/ :

cp /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-available/wordpress2.conf
sed -i "s|wordpress|wordpress2|g" /etc/apache2/sites-available/wordpress2.conf
a2ensite wordpress2
server apache2 restart

FWIW, the first line copies the default TurnKey WordPress vhost to a new vhost (called "wordpress2"). The 2nd changes every instance of "wordpress" to be "wordpress2" (make sure you only run that once as a second run of that line will turn "wordpress2" into "wordpress22"!). The 3rd enables your new vhost and the forth restarts Apache (so your new vhost config is applied).

You'll likely need to set the ServerName directive for your name based vhosting to work, but otherwise, everything should "just work".

FWIW whilst that is probably quite doable in Webmin, I've personally never had much luck with it. My experience has been that manually working with the config files is much more straight forward, less confusing and gives more consistent results. YMMV.

If you'd rather persevere with what you have, please share your current vhost config. TBH, I'm not sure where it'll be if you used Webmin. By default in Debian (what TurnKey is based on) it should be in /etc/apache2/sites-available but I'm not sure if Webmin follows that convention.

Add new comment