homepage Welcome to WebmasterWorld Guest from 54.225.57.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
VirtualServer problem
problem with multiple Named VirtualServer s
mAgnim




msg:1497567
 12:16 am on Jul 23, 2005 (gmt 0)

I am currently running a server with 2 Name virtual host sites, and and I want to add a 3rd.

However, just copying the directives from one of the 2 sites already operation, and editing the appropriate sections isn't working. It keeps resolving back to the first site

Here are the directives for the 2 operational sites:

<VirtualHost 192.168.1.102:80>
ServerAdmin webmaster@mydomain.org
DocumentRoot /var/www/html
ServerName www.mydomain.org
ErrorLog /var/log/httpd/mydomain-error.log
<Directory "/var/www/html">
allow from all
Options All Includes Indexes
</Directory>
</VirtualHost>

<VirtualHost 192.168.1.102:80>
ServerAdmin webmaster@mydomain.org
DocumentRoot "/var/www/site2"
ServerName site2.mydomain.org
ErrorLog /var/log/httpd/site2-error.log
<Directory "/var/www/site2">
allow from all
Options +Indexes
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order allow,deny
Deny from all
</LimitExcept>
</Directory>
</VirtualHost>

This is the 3rd one that I wish to add (totally different domain name, which has also been added to my /etc/hosts file):
<VirtualHost 192.168.1.102:80>
ServerAdmin webmaster@domain2.net
DocumentRoot /var/www/dam
ServerName www.domain2.net
ServerAlias domain2.net
ErrorLog /var/log/httpd/domain2-error.log
<Directory "/var/www/domain2">
allow from all
Options +Indexes
<Limit GET POST OPTIONS PROPFIND>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS PROPFIND>
Order allow,deny
Deny from all
</LimitExcept>
</Directory>
</VirtualHost>

 

mAgnim




msg:1497568
 8:05 am on Jul 23, 2005 (gmt 0)

Running httpd2 -S returns syntax OK, and lists all the intended virtual servers

rharri




msg:1497569
 9:19 pm on Jul 27, 2005 (gmt 0)

Aren't the document root and directory supposed to be the same?

Bob

mAgnim




msg:1497570
 3:10 am on Jul 28, 2005 (gmt 0)

My mistake in editing...they are in fact the same.
/var/www/dam is the real name of the directory, and is the DocumentRoot

...I was editing the post to substitute domain2 and missed that line :P

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved