I have been trying to set up a subdomain on my local development environment, dev.localhost
. I'm using Ubuntu 11.10 and Apache2. So far, I've edited my host file to include the line 127.0.0.1 dev.localhost
. I've created a file called axis
in /etc/apache2/sites-available
which looks like this:
<VirtualHost *:80>
DocumentRoot /var/www/Axis/trunk
ServerName dev.localhost
ServerAlias *.localhost
<Directory /var/www/Axis/trunk/>
Options Indexes FollowSymLinks MultiViews +Includes
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
I then enabled the site with sudo a2ensite axis
. I encountered a no host named error and added the line ServerName localhost
to my default
file in sites-available
. I also encountered an error that had something to do with NameVirtualHost
, which I solved by adding NameVirtualHost *:80
to httpd.conf
and also commenting it out in ports.conf
.
Now, when I navigate to dev.localhost
I get the SAME webpage as I would if I navigated to localhost
. In other words, both localhost
and dev.localhost
point to /var/www
but I want dev.localhost
to point to /var/www/Axis/trunk
.
Any idea where I'm going wrong? Thanks
EDIT: output from apache2ctl -S
ulimit: 88: error setting limit (Operation not permitted)
VirtualHost configuration:
wildcard NameVirtualHosts and _default_ servers:
*:80 is a NameVirtualHost
default server localhost (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost localhost (/etc/apache2/sites-enabled/000-default:1)
port 80 namevhost dev.localhost (/etc/apache2/sites-enabled/axis:1)
Syntax OK