You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@jakarta.apache.org by Adam Rossi <ad...@platinumsolutions.com> on 2000/04/21 09:11:44 UTC
It is 3:30 am and virtual hosts will not work.
Well, I have followed the examples on virtual hosts in the user's guide,
and it is late into the night, and I still can't get virtual hosts to
work with 3.1 current. I want to be able to have two applications
running on different ports or addresses. I have followed the example in
the user's guide closely, but I still cannot get it to work. I have seen
very different configurations posted on this topic...has anyone got the
current user's guide example to work?
I have included my tomcat.conf and server_bench.xml (renamed from
server.xml per the user's guide). Any help would be greatly appreciated.
Thanks.
************* tomcat.conf ***********************
LoadModule jserv_module /etc/httpd/modules/mod_jserv.so
<IfModule mod_jserv.c>
# Do not edit!
ApJServManual on
ApJServDefaultProtocol ajpv12
ApJServSecretKey DISABLED
ApJServMountCopy on
ApJServLogLevel notice
### Change if you run tomcat on a different host
#ApJServDefaultHost localhost
ApJServDefaultPort 8007
## - Creating an Apache virtual host configuration
# NameVirtualHost 192.168.0.4
## - Mounting the first virtual host
<VirtualHost 192.168.0.4:477>
ServerName 192.168.0.4
ApJServMount /bench ajpv12://localhost:8007/bench
</VirtualHost>
## ADAM 3 - Mounting the second virtual host
<VirtualHost 192.168.0.4:478>
ServerName 192.168.0.4
ApJServMount /isp ajpv12://localhost:8009/go
</VirtualHost>
#################### All jsp files will go to tomcat
####################
# ApJServMount default /root
AddType text/jsp .jsp
AddHandler jserv-servlet .jsp
############################## Context mapping - all requests go to
tomcat
# ApJServMount /examples /root
############################## Context mapping - you need to "deploy"
# ( copy or ln -s ) the context into htdocs
##
# ApJservMount /CONTEXT/servlet /root
# <Location /CONTEXT/WEB-INF/ >
# AllowOverride None
# deny from all
# </Location>
</IfModule>
**************** End tomcat.conf *********************************
**************** Start server_bench.xml *************************
<?xml version="1.0" encoding="ISO-8859-1"?>
<Server>
<!-- Debug low-level events in XmlMapper startup -->
<xmlmapper:debug level="0" />
<Logger name="tc_log"
path="logs/tomcat_bench.log"
customOutput="yes" />
<Logger name="servlet_log"
path="logs/servlet_bench.log"
customOutput="yes" />
<Logger name="JASPER_LOG"
path="logs/jasper_bench.log"
verbosityLevel = "INFORMATION" />
<ContextManager port="477" debug="0" workDir="work_bench" >
<!-- ContextInterceptor
className="org.apache.tomcat.context.LogEvents" / -->
<ContextInterceptor
className="org.apache.tomcat.context.AutoSetup" />
<ContextInterceptor
className="org.apache.tomcat.context.DefaultCMSetter" />
<ContextInterceptor
className="org.apache.tomcat.context.WorkDirInterceptor" />
<ContextInterceptor
className="org.apache.tomcat.context.WebXmlReader" />
<ContextInterceptor
className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
<!-- Request processing -->
<RequestInterceptor
className="org.apache.tomcat.request.SimpleMapper" debug="0" />
<RequestInterceptor
className="org.apache.tomcat.request.SessionInterceptor" />
<RequestInterceptor
className="org.apache.tomcat.request.SecurityCheck" />
<RequestInterceptor
className="org.apache.tomcat.request.FixHeaders" />
<Connector
className="org.apache.tomcat.service.SimpleTcpConnector">
<Parameter name="handler"
value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
<Parameter name="port" value="8007"/>
</Connector>
<Context path="/bench" docBase="webapps/bench" debug="0"
reloadable="true" >
</Context>
</ContextManager>
</Server>
*************************** end server_bench.xml
*************************
Re: It is 3:30 am and virtual hosts will not work.
Posted by Adam Rossi <ar...@mgfairfax.rr.com>.
> Look closer...
> You are running one Tomcat and tell it to be a server (listen) on Port
> 8007 in its <Connector .... port=8007 />
>
> Then in your tomcat.conf you tell that URLs starting from /bench should
> go to port 8007, and URLs starting from /isp should go to port 8009.
>
> But you have only one tomcat, do you?
Actually, I want to have two virtual hosts, one mapping to the "bench"
context and one mapping to the "isp" context. I want to be able to run two
instances of the same application code, and i do not want to worry about
switching all the paths in each application. Plus I like having two
independent processes for each application, two sets of logs, etc.
There is another file called server_isp.xml (not included with this message)
for the other virtual host. It is identical to the server_bench.xml file
below, but maps logs to *_isp files, etc. This is just like the example in
the user's guide (except I am trying to use different ports, and the example
did not). I did have apache/tomcat running just fine with the default
configuration. Any ideas?
- Adam
>
> At the beginning, I would start simple stuff:
>
> I would change the lines in tomcat.conf in your virtual hosts to be:
>
> ApJServMount /bench /root
>
> ApJServMount /isp /root
>
> and in your server.xml
>
> I would put:
>
> <Context path="/bench" docBase="/some/full/path/bench" debug="0"
> reloadable="true" >
> </Context>
>
> <Context path="/isp" docBase="/some/full/path/bench" debug="0"
> reloadable="true" >
> </Context>
>
> and leave the Connector element in server.xml
> as it comes with defauly server.xml.
>
> Jan
> jkl@osc.edu
>
>
>
> On Fri, 21 Apr 2000, Adam Rossi wrote:
>
> > Well, I have followed the examples on virtual hosts in the user's guide,
> > and it is late into the night, and I still can't get virtual hosts to
> > work with 3.1 current. I want to be able to have two applications
> > running on different ports or addresses. I have followed the example in
> > the user's guide closely, but I still cannot get it to work. I have seen
> > very different configurations posted on this topic...has anyone got the
> > current user's guide example to work?
> >
> > I have included my tomcat.conf and server_bench.xml (renamed from
> > server.xml per the user's guide). Any help would be greatly appreciated.
> >
> > Thanks.
> >
> >
> > ************* tomcat.conf ***********************
> >
> > LoadModule jserv_module /etc/httpd/modules/mod_jserv.so
> >
> > <IfModule mod_jserv.c>
> > # Do not edit!
> > ApJServManual on
> > ApJServDefaultProtocol ajpv12
> > ApJServSecretKey DISABLED
> > ApJServMountCopy on
> > ApJServLogLevel notice
> >
> >
> > ### Change if you run tomcat on a different host
> > #ApJServDefaultHost localhost
> > ApJServDefaultPort 8007
> >
> > ## - Creating an Apache virtual host configuration
> > # NameVirtualHost 192.168.0.4
> >
> > ## - Mounting the first virtual host
> > <VirtualHost 192.168.0.4:477>
> > ServerName 192.168.0.4
> > ApJServMount /bench ajpv12://localhost:8007/bench
> > </VirtualHost>
> >
> > ## ADAM 3 - Mounting the second virtual host
> > <VirtualHost 192.168.0.4:478>
> > ServerName 192.168.0.4
> > ApJServMount /isp ajpv12://localhost:8009/isp> > </VirtualHost>
> >
> > #################### All jsp files will go to tomcat
> > ####################
> > # ApJServMount default /root
> >
> > AddType text/jsp .jsp
> > AddHandler jserv-servlet .jsp
> >
> > ############################## Context mapping - all requests go to
> > tomcat
> >
> > # ApJServMount /examples /root
> >
> > ############################## Context mapping - you need to "deploy"
> > # ( copy or ln -s ) the context into htdocs
> > ##
> >
> > # ApJservMount /CONTEXT/servlet /root
> > # <Location /CONTEXT/WEB-INF/ >
> > # AllowOverride None
> > # deny from all
> > # </Location>
> >
> >
> > </IfModule>
> >
> > **************** End tomcat.conf *********************************
> >
> > **************** Start server_bench.xml *************************
> >
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > <Server>
> > <!-- Debug low-level events in XmlMapper startup -->
> > <xmlmapper:debug level="0" />
> >
> > <Logger name="tc_log"
> > path="logs/tomcat_bench.log"
> > customOutput="yes" />
> >
> > <Logger name="servlet_log"
> > path="logs/servlet_bench.log"
> > customOutput="yes" />
> >
> > <Logger name="JASPER_LOG"
> > path="logs/jasper_bench.log"
> > verbosityLevel = "INFORMATION" />
> >
> > <ContextManager port="477" debug="0" workDir="work_bench" >
> > <!-- ContextInterceptor
> > className="org.apache.tomcat.context.LogEvents" / -->
> > <ContextInterceptor
> > className="org.apache.tomcat.context.AutoSetup" />
> > <ContextInterceptor
> > className="org.apache.tomcat.context.DefaultCMSetter" />
> > <ContextInterceptor
> > className="org.apache.tomcat.context.WorkDirInterceptor" />
> > <ContextInterceptor
> > className="org.apache.tomcat.context.WebXmlReader" />
> > <ContextInterceptor
> > className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
> > <!-- Request processing -->
> > <RequestInterceptor
> > className="org.apache.tomcat.request.SimpleMapper" debug="0" />
> > <RequestInterceptor
> > className="org.apache.tomcat.request.SessionInterceptor" />
> > <RequestInterceptor
> > className="org.apache.tomcat.request.SecurityCheck" />
> > <RequestInterceptor
> > className="org.apache.tomcat.request.FixHeaders" />
> >
> > <Connector
> > className="org.apache.tomcat.service.SimpleTcpConnector">
> > <Parameter name="handler"
> > value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
> > <Parameter name="port" value="8007"/>
> > </Connector>
> >
> > <Context path="/bench" docBase="webapps/bench" debug="0"
> > reloadable="true" >
> > </Context>
> > </ContextManager>
> > </Server>
> >
> > *************************** end server_bench.xml
> > *************************
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: general-help@jakarta.apache.org
> >
>
> Jan K. Labanowski | phone: 614-292-9279, FAX: 614-292-7168
> Ohio Supercomputer Center | Internet: jkl@osc.edu
> 1224 Kinnear Rd, | http://www.ccl.net/chemistry.html
> Columbus, OH 43212-1163 | http://www.osc.edu/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>
>
Re: It is 3:30 am and virtual hosts will not work.
Posted by Jan Labanowski <jk...@osc.edu>.
Look closer...
You are running one Tomcat and tell it to be a server (listen) on Port
8007 in its <Connector .... port=8007 />
Then in your tomcat.conf you tell that URLs starting from /bench should
go to port 8007, and URLs starting from /isp should go to port 8009.
But you have only one tomcat, do you?
At the beginning, I would start simple stuff:
I would change the lines in tomcat.conf in your virtual hosts to be:
ApJServMount /bench /root
ApJServMount /isp /root
and in your server.xml
I would put:
<Context path="/bench" docBase="/some/full/path/bench" debug="0"
reloadable="true" >
</Context>
<Context path="/isp" docBase="/some/full/path/bench" debug="0"
reloadable="true" >
</Context>
and leave the Connector element in server.xml
as it comes with defauly server.xml.
Jan
jkl@osc.edu
On Fri, 21 Apr 2000, Adam Rossi wrote:
> Well, I have followed the examples on virtual hosts in the user's guide,
> and it is late into the night, and I still can't get virtual hosts to
> work with 3.1 current. I want to be able to have two applications
> running on different ports or addresses. I have followed the example in
> the user's guide closely, but I still cannot get it to work. I have seen
> very different configurations posted on this topic...has anyone got the
> current user's guide example to work?
>
> I have included my tomcat.conf and server_bench.xml (renamed from
> server.xml per the user's guide). Any help would be greatly appreciated.
>
> Thanks.
>
>
> ************* tomcat.conf ***********************
>
> LoadModule jserv_module /etc/httpd/modules/mod_jserv.so
>
> <IfModule mod_jserv.c>
> # Do not edit!
> ApJServManual on
> ApJServDefaultProtocol ajpv12
> ApJServSecretKey DISABLED
> ApJServMountCopy on
> ApJServLogLevel notice
>
>
> ### Change if you run tomcat on a different host
> #ApJServDefaultHost localhost
> ApJServDefaultPort 8007
>
> ## - Creating an Apache virtual host configuration
> # NameVirtualHost 192.168.0.4
>
> ## - Mounting the first virtual host
> <VirtualHost 192.168.0.4:477>
> ServerName 192.168.0.4
> ApJServMount /bench ajpv12://localhost:8007/bench
> </VirtualHost>
>
> ## ADAM 3 - Mounting the second virtual host
> <VirtualHost 192.168.0.4:478>
> ServerName 192.168.0.4
> ApJServMount /isp ajpv12://localhost:8009/go
> </VirtualHost>
>
> #################### All jsp files will go to tomcat
> ####################
> # ApJServMount default /root
>
> AddType text/jsp .jsp
> AddHandler jserv-servlet .jsp
>
> ############################## Context mapping - all requests go to
> tomcat
>
> # ApJServMount /examples /root
>
> ############################## Context mapping - you need to "deploy"
> # ( copy or ln -s ) the context into htdocs
> ##
>
> # ApJservMount /CONTEXT/servlet /root
> # <Location /CONTEXT/WEB-INF/ >
> # AllowOverride None
> # deny from all
> # </Location>
>
>
> </IfModule>
>
> **************** End tomcat.conf *********************************
>
> **************** Start server_bench.xml *************************
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> <Server>
> <!-- Debug low-level events in XmlMapper startup -->
> <xmlmapper:debug level="0" />
>
> <Logger name="tc_log"
> path="logs/tomcat_bench.log"
> customOutput="yes" />
>
> <Logger name="servlet_log"
> path="logs/servlet_bench.log"
> customOutput="yes" />
>
> <Logger name="JASPER_LOG"
> path="logs/jasper_bench.log"
> verbosityLevel = "INFORMATION" />
>
> <ContextManager port="477" debug="0" workDir="work_bench" >
> <!-- ContextInterceptor
> className="org.apache.tomcat.context.LogEvents" / -->
> <ContextInterceptor
> className="org.apache.tomcat.context.AutoSetup" />
> <ContextInterceptor
> className="org.apache.tomcat.context.DefaultCMSetter" />
> <ContextInterceptor
> className="org.apache.tomcat.context.WorkDirInterceptor" />
> <ContextInterceptor
> className="org.apache.tomcat.context.WebXmlReader" />
> <ContextInterceptor
> className="org.apache.tomcat.context.LoadOnStartupInterceptor" />
> <!-- Request processing -->
> <RequestInterceptor
> className="org.apache.tomcat.request.SimpleMapper" debug="0" />
> <RequestInterceptor
> className="org.apache.tomcat.request.SessionInterceptor" />
> <RequestInterceptor
> className="org.apache.tomcat.request.SecurityCheck" />
> <RequestInterceptor
> className="org.apache.tomcat.request.FixHeaders" />
>
> <Connector
> className="org.apache.tomcat.service.SimpleTcpConnector">
> <Parameter name="handler"
> value="org.apache.tomcat.service.connector.Ajp12ConnectionHandler"/>
> <Parameter name="port" value="8007"/>
> </Connector>
>
> <Context path="/bench" docBase="webapps/bench" debug="0"
> reloadable="true" >
> </Context>
> </ContextManager>
> </Server>
>
> *************************** end server_bench.xml
> *************************
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: general-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: general-help@jakarta.apache.org
>
Jan K. Labanowski | phone: 614-292-9279, FAX: 614-292-7168
Ohio Supercomputer Center | Internet: jkl@osc.edu
1224 Kinnear Rd, | http://www.ccl.net/chemistry.html
Columbus, OH 43212-1163 | http://www.osc.edu/