Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old June 21st, 2001, 06:55 AM
mescon mescon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: sweden
Posts: 2 mescon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old June 21st, 2001, 07:40 AM
Pushkin Pushkin is offline
Caffeine - Nicotine - Sugar
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2001
Location: Germany, Cologne
Posts: 60 Pushkin User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old June 21st, 2001, 08:18 PM
mescon mescon is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: sweden
Posts: 2 mescon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > Apache and Tomcat together on the same port?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway