|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Apache and Tomcat together on the same port?
Hi there.
Im working on setting a server up, that is supposed to be able to parse PHP, CGI, Perl, ASP and JSP. Im actually quite unexperienced in the use of Tomcat and Apache, since Ive always been working under an NT platform, along with IIS. The problem for me when Im setting Tomcat up is that I cant get it to co-work with Apache, so that the regular apache mounted directories (/var/lib/apache/htdocs/) can parse JSP. I would have to connect to port 8080 first, then put my JSP pages under the Tomcat root directories. So, what I would like some help with is: How do I get Apache and Tomcat to work together, so that I can parse JSP files under an Apache server (on the regular port 80)? All help appreciated! Yours, Erik S. |
|
#2
|
|||
|
|||
Its always great fun to set a Java-System up...OK, here is how you do it - be sure you have the lastest versions of both: 1.) Install Apache that is is able to laod modules dynamically. mod_so needs to be built in. 2.) Install Tomcat. 3.) Load mod_jk into apache. You can get it from jakarta.apache.org. In your httpd.conf: Code:
LoadModule jk_module libexec/mod_jk.so 4.) edit your httpd.conf, append this text: Code:
<IfModule mod_jk.c>
JkWorkersFile *PATH-TO-TOMCAT*/conf/workers.properties
JkLogFile *PATH-TO-APACHE*/logs/mod_jk.log
JkLogLevel error
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
</IfModule>
5.) Edit server.xml of Tomcat. Create a new Context: Code:
<Context path=""
docBase="*PATH-TO-APACHE*/htdocs"
crossContext="true"
debug="0"
reloadable="true"
trusted="false" >
</Context>
This is the most important Part! You Context's docbase points to the same directory as Apache's document-root. 6. ) Still server.xml: uncomment these lines: Code:
<Connector className="org.apache.tomcat.service.PoolTcpConnector">
<Parameter name="handler" value="org.apache.tomcat.service.connector.Ajp13ConnectionHandler"/>
<Parameter name="port" value="8009"/>
</Connector>
7.) Start Tomcat first, then Apache For test-purposes, put a file test.jsp into the htdocs-folder: Code:
<%= new java.util.Date() %> HTH |
|
#3
|
|||
|
|||
|
Thanks!
Hi there!
Thanks alot for the help! ![]() Now I just have to see if im competent enough to do that stuff, without destroying my vhost, reverse dns and all mumbo jumbo I managed to setup ![]() Have a nice day! Yours, Erik S. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > Apache and Tomcat together on the same port? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|