LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   apache2 virtual hosts (https://www.linuxquestions.org/questions/linux-software-2/apache2-virtual-hosts-142822/)

viniosity 02-05-2004 09:45 PM

apache2 virtual hosts
 
I'm trying to get virtual hosts working with apache2. I had it working once (thanks to viewing other posts in this forum) and I don't think I changed my httpd.conf file but it's not working anymore. Can you all check out this part of my /usr/loca;/apache2/conf/httpd.conf file and let me know if you see any errors? (in this example two domains are replaced by foo.com and foo2.com) Many thanks!

# Use name-based virtual hosting.
#
# NameVirtualHost *
NameVirtualHost *

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
#<VirtualHost *>
# ServerAdmin webmaster@dummy-host.example.com
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>
<VirtualHost *>
#ServerAdmin webmaster@foo.com
#ServerPath /foo/
ServerName www.foo.com:80
ServerAlias foo.com store.foo.com
DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/foo
#JkMount /*.jsp ajp13
ErrorLog logs/foo.com-error_log
# CustomLog logs/foo.com-access_log common
</VirtualHost>
<VirtualHost *>
#ServerAdmin webmaster@foo2.com
#ServerPath /foo2/
ServerName www.foo2.com
ServerAlias store.foo2.com foo2.com
DocumentRoot /usr/local/jakarta-tomcat-3.3.1/webapps/foo2
ErrorLog logs/foo2.com-error_log
#CustomLog logs/foo2.com_log common
</VirtualHost>

Include /usr/local/jakarta-tomcat-3.3.1/conf/auto/mod_jk.conf

DavidPhillips 02-06-2004 12:29 AM

What are you getting from the server now?

kevinatkins 02-06-2004 04:13 AM

I think that your /etc/hosts file must contain the host names you intend to use....

DavidPhillips 02-06-2004 11:43 PM

Not really, unless there's no dns entry.

z-man 02-07-2004 12:15 AM

why port in ServerName
ServerName www.foo.com:80

Maybe this helps
http://httpd.apache.org/docs/mod/core.html#listen

also hash ServerName in httpd.conf if you use virtual hosts



Hope this helps


All times are GMT -5. The time now is 10:43 AM.