Apache2 virtualHost config problem
Once upon a time about 2 weeks ago the vhosts worked fine. But that was when i had apache 2.0.40 installed from the rpm that i got by using apt-get (apt-get install httpd). Then i wanted to configure Apache Tomcat and using mod_jk to connect apache and tomcat. I tried for a week strait to get them to work but couldn't, so in frustration i removed httpd and followed an awesome tuturial on setting up apache and tomcat:
for anyone looking to do that i suggest: http://johnturner.com/howto/apache2-...rh9-howto.html NOW, I got everything up and got all of the test pages and mod_jk working and everything. However when i copied the virtual host info from my old httpd.conf file i get an interesting problem. they all point to the default webiste which is located at /web/apps/ROOT but the directives are pointing them to /web/apps/glaznerfamily/ROOT , /web/apps/industrial_design/ROOT and /web/apps/designers_coalition/ROOT. you can see the problem first hand if you go to http://www.coldcrow.com (default site) http://www.glaznerfamily.com (second site) http://www.dcasu.org (third site) http://www.unspokenbalance.com (fourth site) httpd.conf NameVirtualHost *:80 # # 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 *:80> ServerAdmin webmaster@coldcrow.com DocumentRoot /web/apps/ROOT ServerName www.coldcrow.com ServerAlias www.coldcrow.com ErrorLog logs/coldcrow.com-error_log ScriptAlias /cgi-bin/ "/web/apps/ROOT/cgi-bin/" <Directory "/web/apps/ROOT/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> # CustomLog logs/dummy-host.example.com-access_log common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@glaznerfamily.com DocumentRoot /web/apps/glaznerfamily/ROOT ServerName www.glaznerfamily.com ServerAlias www.glaznerfamily.com ErrorLog logs/glaznerfamily.com-error_log ScriptAlias /cgi-bin/ "/web/apps/glaznerfamily/ROOT/cgi-bin/" <Directory "/web/apps/glaznerfamily/ROOT/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> # CustomLog logs/dummy-host.example.com-access_log common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@dcasu.org DocumentRoot /web/apps/designers_coalition/ROOT ServerName www.dcasu.org ServerAlias www.dcasu.org ErrorLog logs/dcasu.org-error_log ScriptAlias /cgi-bin/ "/web/apps/designers_coalition/ROOT/cgi-bin/" <Directory "/web/apps/designers_coalition/ROOT/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> # CustomLog logs/dummy-host.example.com-access_log common </VirtualHost> <VirtualHost *:80> ServerAdmin webmaster@unspokenbalance.com DocumentRoot /web/apps/industrial_design/ROOT ServerName www.unspokenbalance.com ServerAlias www.unspokenbalance.com ErrorLog logs/unspokenbalance.com-error_log ScriptAlias /cgi-bin/ "/web/apps/industrial_design/ROOT/cgi-bin/" <Directory "/web/apps/industrial_design/ROOT/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all </Directory> # CustomLog logs/dummy-host.example.com-access_log common </VirtualHost> Include /usr/local/tomcat/conf/auto/mod_jk.conf End httpd.conf I did a config test and got "Syntax OK". then i tried httpd -S and got the following: 208.187.207.30:80 coldcrow.com (/usr/local/tomcat/conf/auto/mod_jk.conf:14) wildcard NameVirtualHosts and _default_ servers: *:80 is a NameVirtualHost default server www.coldcrow.com (/usr/local/apache/conf/httpd.conf:1035) port 80 namevhost www.coldcrow.com (/usr/local/apache/conf/httpd.conf:1035) port 80 namevhost www.glaznerfamily.com (/usr/local/apache/conf/httpd.conf:1051) port 80 namevhost www.dcasu.org (/usr/local/apache/conf/httpd.conf:1067) port 80 namevhost www.unspokenbalance.com (/usr/local/apache/conf/httpd.conf:1083) Syntax OK any help would be appreciated. |
STILL HAVING THIS PROBLEM
I'm really stuck here. I'm completely at a loss here. I don't kow what to do. Does anyone have any ideas? I have tried doing everyghing possible. I have searched this forum for similar problems and tried the solutions offered there but nothing. PLEASE HELP!!! SOMEONE ANYONE
|
some progress at least
Ok well i found the problem but now i don't know how to fix it. the problem is the include mod_jk.conf directive at the bottom. If i uncomment that out then i get proper redirection. I set up hosts directives in the tomcat server.xml file and now when i start apache i get this message:
VirtualHost coldcrow.com:80 overlpas with VirtualHost glaznerfamily.com:80, the first has precedence, perhaps you need a NameVirtualHost directive any ideas??? so far i have found nothing. |
problem solved
Well i finally got it fixed. After consulting lots and lots of documentation on jakarta-tomcat's website i decided to move away from the older mod_jk and go with mod_jk2 which is better suited for Apache 2.0 They have a pretty good how to here:
http://jakarta.apache.org/tomcat/tom...hosthowto.html OH so yeah anyway it was the Include directive that caused the problem. after installing mod_jk2 (which if you are using the rpm based httpd you need to get httpd-devel to compile mod_jk2.so) and adding the sites to the workers2.properties file and in the virtual host directives it worked out fine. If anyone ever decides to read this i am now some what of an expert on it (thanks to hours and hours of reading badly written howto's) i could probably help you. jglazner-AT-creditback-DOT-com |
All times are GMT -5. The time now is 08:25 AM. |