Welcome to WebmasterWorld Guest from 54.167.86.211

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Trouble setting up virtual host

     
7:40 pm on Feb 26, 2014 (gmt 0)

New User

joined:Feb 26, 2014
posts: 6
votes: 0


Greetings!

Important information: Running Apache 2.4.6 on Ubuntu 12.04. I have the vhost_alias module running.

I'm trying to set up a virtual host on my local machine, and for some reason when I go to example.com it routes me to /var/www instead of /var/www/example/wordpress, as I'm hoping it to do.

The following is the configuration in the sites-available folder, which I enable using a2ensite example:

NameVirtualHost *:80

<VirtualHost *:80>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /var/www/example/wordpress
<Directory /var/www/example/wordpress>
Options Indexes FollowSymLinks Includes
AllowOverride All
Require all granted
</Directory>
ErrorLog /var/log/apache2/example-error.log
</VirtualHost>


I also added the following line to the /etc/hosts file:

127.0.0.1  example.com


As far as I can tell, it's this simple. Am I missing something?
10:10 pm on Feb 26, 2014 (gmt 0)

Administrator

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Aug 10, 2004
posts:10544
votes: 8


is /var/www/example/wordpress a symbolic link by any chance?

check the error log.
you might even get some logging on startup that tells you what apache thinks the document root directory is as opposed to what you think it should be.

you can also try:
apachectl -S
(or the equivalent command in your case)
3:11 pm on Feb 27, 2014 (gmt 0)

New User

joined:Feb 26, 2014
posts: 6
votes: 0


I figured it out. I was improperly restarting Apache.. Oops! There's a huge difference, it seems, between 'service apache2 restart' and '/etc/init.d/apache2 restart'. I did not know that. The latter prompts apache to re-cache the config files.

Thanks!
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members