Kelly Wagner's picture

Discovered the Wordpress Turnkey Appliance and love it!  Was setting up some IP based virtual servers, and no matter what, when using the FQDN it automaticaly directs the clients to the /var/www/wordpress directory.  

Is there something baked in the image that would cause this?

Jeremy Davis's picture

Thanks for your kind words and I'm really glad to hear that you are finding our WordPress appliance useful, albeit with a little bit of pain for your desired setup...!

TBH, I'm unfamiliar with WordPress multi-site hosting, but I see no reason why it shouldn't work.

My guess is that it's the default Apache config. As you can see the default config explicitly points all incoming traffic to /var/www/wordpress.

If you want to use Apache to direct incoming traffic to different places, then I suggest that you remove the 'ServerName' directive from the top of that file (/etc/apache2/sites-available/wordpress.conf), then within the 'VirtualHost' section add a new 'ServerName' entry there, with the domain you want to server the existing WordPress from. You'll want to do that for both port 80 and 443 (http & https). So assuming a domain of "", your resulting wordpress.conf would look like this:

<VirtualHost *:80>
    UseCanonicalName Off
    ServerAdmin  webmaster@localhost
    DocumentRoot /var/www/wordpress

<VirtualHost *:443>
    SSLEngine on
    ServerAdmin  webmaster@localhost
    DocumentRoot /var/www/wordpress

<Directory /var/www/wordpress>
    Options +FollowSymLinks
    Options -Indexes
    AllowOverride All
    order allow,deny
    allow from all
To add an additional site (let's say which points to a doc root of /var/www/new-site, I'd just copy the existing virtualhost and edit it accordingly. I.e.:
cp /etc/apache2/sites-available/wordpress.conf /etc/apache2/sites-available/new-site.conf
Then edit that and swap all instances of '/var/www/wordpress' to '/var/www/new-site' and instances of '' to ''. Here's how I'd do it (manually doing it is fine, I'm just showing off my ninja commandline skills! :)
sed -i "s|/var/www/wordpress|/var/www/ne-site|" /etc/apache2/sites-available/new-site.conf
sed -i "s|||" /etc/apache2/sites-available/new-site.conf
Obviously in your context, you'd want to adjust the things to substitute, i.e. paths and domain name.

Then you just need to restart Apache:

service apache2 restart
And you should be good to go! :)
Kelly Wagner's picture

Bada-Bing!  Thank you, it works.  

Jeremy Davis's picture

Great news! :)

Add new comment