version7x
December 21st, 2008, 12:14 AM
I'm doing some testing with a new apache install and cant get the desired results.
I've got my etc hosts file to show both example1.com and example2.com for the same address.
In my httpd.conf, i have set the server name as example1.com and have an entry for example2 as a virtualhost.
The problem is that I'm getting the virtual hosts index.html for both sites. If I remove the index.html from the virtualhost directory, i get a message that there is no index.html for either site.
I've posted the relevant lines form httpd.conf below.... what am i missing?
Listen 80
User apache
Group apache
ServerAdmin root@localhost
ServerName example1.com:80
UseCanonicalName Off
DocumentRoot "/var/www/html"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /virt1
ServerName example2.com
ErrorLog logs/example2.com-error_log
CustomLog logs/example2.com-access_log common
</VirtualHost>
Any help is appreciated!!!
Thanks in advance
I've got my etc hosts file to show both example1.com and example2.com for the same address.
In my httpd.conf, i have set the server name as example1.com and have an entry for example2 as a virtualhost.
The problem is that I'm getting the virtual hosts index.html for both sites. If I remove the index.html from the virtualhost directory, i get a message that there is no index.html for either site.
I've posted the relevant lines form httpd.conf below.... what am i missing?
Listen 80
User apache
Group apache
ServerAdmin root@localhost
ServerName example1.com:80
UseCanonicalName Off
DocumentRoot "/var/www/html"
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /virt1
ServerName example2.com
ErrorLog logs/example2.com-error_log
CustomLog logs/example2.com-access_log common
</VirtualHost>
Any help is appreciated!!!
Thanks in advance