Welcome to WebmasterWorld Guest from 184.108.40.206 , register , free tools , login , search , pro membership , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor 2014
Trouble setting up virtual host jasontheadams msg:4649480 7:40 pm on Feb 26, 2014 (gmt 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:
<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:
As far as I can tell, it's this simple. Am I missing something?
phranque msg:4649524 10:10 pm on Feb 26, 2014 (gmt 0)
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) jasontheadams msg:4649736 3:11 pm on Feb 27, 2014 (gmt 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!