virtual domains ubuntu www. pointing to wrong server folder!!

  • Posted October 16, 2013


not sure if this has happened to anyone but I have 2 droplets one works the other is doing something strange.

When I go on my browser and type the browser is pointed to var/www/ But when I type in my browser shows the site which sits in var/www/

in the folder is a Wordpress run site.

I have these DNS settings:

www CNAME @

  • CNAME @

I also have the virtual domains …/apache2/sites-available/

ServerAdmin webmaster@localhost ServerName ServerAlias DocumentRoot /var/www/ …

I just can’t work out where the problem lies, does anyone have any ideas?



Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

<b>“how would it show up on the file if it did?”</b> <br> <br>All the referenced to <code>root root</code> in your previous post should/would be <code>www-data www-data</code>

ah ok so I haven’t given ownership for that folder to my user? <br> <br>how would it show up on the file if it did? well I guess I will see when I do it haha <br> <br>Thanks for the help though, just trying to learn the server side scripting can be very confusing on the first off. <br>

<b>“… all of a sudden its just working!!!”</b> <br> <br>Weird! <br> <br>Also, looks like you need to execute <code>sudo chown -R www-data:www-data /var/www</code>

Hi I’m not sure what happened but all of a sudden its just working!!! do you think it had to do with the propagate time? Just it was about a week!!! <br> <br>here we’re my results… <br> <br>total 20 <br>drwxr-xr-x 4 root root 4096 Oct 15 11:05 . <br>drwxr-xr-x 12 root root 4096 Oct 15 09:52 … <br>drwxr-xr-x 2 root root 4096 Oct 15 11:05 <br>-rwxr-xr-x 1 www-data www-data 177 Oct 15 09:52 index.html <br>drwxrwxrwx 9 root root 4096 Oct 15 11:55 <br>

What’s the output of <code>ls -la /var/www</code>

its individual Wordpress setup and each has a .htaccess in the same directory as the wordpress: <br> <br># BEGIN WordPress <br><IfModule mod_rewrite.c> <br>RewriteEngine On <br>RewriteBase / <br>RewriteRule ^index.php$ - [L] <br>RewriteCond %{REQUEST_FILENAME} !-f <br>RewriteCond %{REQUEST_FILENAME} !-d <br>RewriteRule . /index.php [L] <br></IfModule> <br># END WordPress <br> <br>

In what directory is your <code>.htaccess</code> file saved? Can you post the contents? Are you running WordPress Multisite?

Hi, no they are different domain names on both droplets but the settings are the same with different domain names in the files obviously. <br> <br>My module rewrite is also active!! just seems dead strange its pointing to sub level folder on www <br> <br>Thanks for your input

Are you trying to associate both droplets with the same domain, i.e. <br> <br>Also, do you have the Apache re-write module activated?