Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tomcat Virtual Host problem

Status
Not open for further replies.

babylion

Programmer
Nov 18, 2010
1
0
0
HK
I basically follow the tutorial and setup httpd.conf, workers.properties, and server.xml and want to create 2 virtual host

virtual1.name.com and
virtual2.name.com

the problem is I am not sure what I did wrong because that's no log file to help me to debug (no error in mod_jk.log and error.log)

my worker.properties:

worker.list = controller,tomcat1,tomcat2,connect_id,connect_id2

worker.tomcat1.port=8009
worker.tomcat1.host=127.0.0.1
worker.tomcat1.type=ajp13
worker.tomcat1.lbfactor = 3

worker.tomcat2.port=9009
worker.tomcat2.host=127.0.0.1
worker.tomcat2.type=ajp13
worker.tomcat2.lbfactor = 2

#virtual host worker 1
worker.connect_id.port=8112
worker.connect_id.host=192.168.0.1
worker.connect_id.type=ajp13
worker.connect_id.lbfactor=3

#virtual host 2
#worker.connect_id2.port=8113
#worker.connect_id2.host=192.168.0.2
#worker.connect_id2.type=ajp13
#worker.connect_id2.lbfactor=3


"server.conf"
I add
<!--- port from Tomcat-->
<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8112" minProcessors="3" maxProcessors="10"
acceptCount="10" debug="0"/>

<Connector className="org.apache.ajp.tomcat4.Ajp13Connector"
port="8113" minProcessors="3" maxProcessors="10"
acceptCount="10" debug="0"/>


<Host name="virtual1.name.com" debug="0" unpackWARs="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="virtual_log." suffix=".txt" timestamp="true"/>
<Context path="" docBase="C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/html_virtualhost" debug="0" reloadable="true"/>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="virtual_log." suffix=".txt"
pattern="common"/>
</Host>

<Host name="virtual2.name.com" debug="0" unpackWARs="true">
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="virtual_log2." suffix=".txt" timestamp="true"/>
<Context path="" docBase="C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/html_virtualhost2" debug="0" reloadable="true"/>
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="virtual_log2." suffix=".txt"
pattern="common"/>
</Host>




and httpd.conf

NameVirtualHost 192.168.0.1
NameVirtualHost 192.168.0.2


<VirtualHost 192.168.0.1>
ServerAdmin admin@name.com
DocumentRoot "C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/html_virtualhost1"
ServerName virtual1.name.com
ServerAlias #<Directory "C:/Program Files/Apache Software Foundation/Tomcat 7.0/webapps/html_virtualhost/cgi-bin">
# Options ExecCGI
# SetHandler cgi-script
#</Directory>
JkMount /servlet/* connect_id
JkMount /*.html connect_id
JkMount /*.jsp connect_id
</VirtualHost>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top