qweqwe1
01-28-2003, 05:06 AM
i know this a very common topic here ..i did searched in this forum and also on google ..some how i am unable to make this work...
i hv a RH 6.2 and Apache 1.3.9 box. i hv registered two domains domain1.com and domain2.com. both pointing to my static IP address. now i want to set up virtual hosts ..i mean when anyone types www.domain1.com it shd take them to /home/httpd/html and for www.domain2.com to www/docs/www.domain2.com.
i checked the VirtualHost docs ..its said i need to modify my http.conf as follows ..
<VirtualHost www.domain1.com>
ServerAdmin root@.domain1.com
DocumentRoot /home/httpd/html/virtual/linux
ServerName www.domain1.com
ErrorLog logs/linux-error_log
TransferLog logs/linux-access_log
</VirtualHost>
accordingly i modified my http.conf file ..
<VirtualHost www.ojoobala.com>
ServerAdmin root@localhost
DocumentRoot /home/httpd/html
ServerName www.ojoobala.com
ErrorLog logs/www.ojoobala.com-error_log
TransferLog logs/www.ojoobala.com-access_log
</VirtualHost>
<VirtualHost www.ashhirwaadassociates.com>
ServerAdmin root@localhost
DocumentRoot /www/docs/www.ashhirwaadassociates.com
ServerName www.ashhirwaadassociates.com
ErrorLog logs/www.ashhirwaadassociates.com-error_log
TransferLog logs/www.ashhirwaadassociates.com-access_log
</VirtualHost>
serversignature off
servertokens full
when i restarted httpd ..i got error VirtualHost www.ojoobala.com overlaps VirtualHost www.ashhirwaadassociates.com perhaps u need a NamedVirtualHost Directive.
i searched again ..then one of post mentioned to use the IP address so i modified my httpd.conf as follows
<VirtualHost my.ip.add.ress>
ServerAdmin root@localhost
DocumentRoot /home/httpd/html
ServerName www.ojoobala.com
ErrorLog logs/www.ojoobala.com-error_log
TransferLog logs/www.ojoobala.com-access_log
</VirtualHost>
<VirtualHost my.ip.add.ress>
ServerAdmin root@localhost
DocumentRoot /www/docs/www.ashhirwaadassociates.com
ServerName www.ashhirwaadassociates.com
ErrorLog logs/www.ashhirwaadassociates.com-error_log
TransferLog logs/www.ashhirwaadassociates.com-access_log
</VirtualHost>
once again when i restarted httpd i got the same overlap error but this time with ip address.
when i access the website with www.ojoobala.com i am getting the www.ashhirwaadassociates.com default page.
i dont know what i am doing wrong ...i appreciate ur help ..thanks a lot...
-qweqwe
i hv a RH 6.2 and Apache 1.3.9 box. i hv registered two domains domain1.com and domain2.com. both pointing to my static IP address. now i want to set up virtual hosts ..i mean when anyone types www.domain1.com it shd take them to /home/httpd/html and for www.domain2.com to www/docs/www.domain2.com.
i checked the VirtualHost docs ..its said i need to modify my http.conf as follows ..
<VirtualHost www.domain1.com>
ServerAdmin root@.domain1.com
DocumentRoot /home/httpd/html/virtual/linux
ServerName www.domain1.com
ErrorLog logs/linux-error_log
TransferLog logs/linux-access_log
</VirtualHost>
accordingly i modified my http.conf file ..
<VirtualHost www.ojoobala.com>
ServerAdmin root@localhost
DocumentRoot /home/httpd/html
ServerName www.ojoobala.com
ErrorLog logs/www.ojoobala.com-error_log
TransferLog logs/www.ojoobala.com-access_log
</VirtualHost>
<VirtualHost www.ashhirwaadassociates.com>
ServerAdmin root@localhost
DocumentRoot /www/docs/www.ashhirwaadassociates.com
ServerName www.ashhirwaadassociates.com
ErrorLog logs/www.ashhirwaadassociates.com-error_log
TransferLog logs/www.ashhirwaadassociates.com-access_log
</VirtualHost>
serversignature off
servertokens full
when i restarted httpd ..i got error VirtualHost www.ojoobala.com overlaps VirtualHost www.ashhirwaadassociates.com perhaps u need a NamedVirtualHost Directive.
i searched again ..then one of post mentioned to use the IP address so i modified my httpd.conf as follows
<VirtualHost my.ip.add.ress>
ServerAdmin root@localhost
DocumentRoot /home/httpd/html
ServerName www.ojoobala.com
ErrorLog logs/www.ojoobala.com-error_log
TransferLog logs/www.ojoobala.com-access_log
</VirtualHost>
<VirtualHost my.ip.add.ress>
ServerAdmin root@localhost
DocumentRoot /www/docs/www.ashhirwaadassociates.com
ServerName www.ashhirwaadassociates.com
ErrorLog logs/www.ashhirwaadassociates.com-error_log
TransferLog logs/www.ashhirwaadassociates.com-access_log
</VirtualHost>
once again when i restarted httpd i got the same overlap error but this time with ip address.
when i access the website with www.ojoobala.com i am getting the www.ashhirwaadassociates.com default page.
i dont know what i am doing wrong ...i appreciate ur help ..thanks a lot...
-qweqwe