Solved

Adding web application to existing Apache/Tomcat installation

Posted on 2012-03-16
4
202 Views
Last Modified: 2012-03-20
Dear All,

we are trying to add a web application to an already existing installation of Apache/Tomcat but cannot seem to get this to work. Does anyone have a good tutorial or description on how to do this? We are fairly new to the configuration of Apache/Tomcat and are getting a bit confused by all the different configuration files and how they are linked. So any hints, pointers or tutorials on how this is done will be greatly appreciated.

Best regards
Daniel Martinsson
0
Comment
Question by:Daniel Södling
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:Charlie2012
ID: 37729365
Hi Daniel,

Can you confirm if you are using mod-JK or mod-proxy as the configuration is quite different.
0
 

Author Comment

by:Daniel Södling
ID: 37736632
Good morning,

it seems we are using mod-proxy

this is from the httpd.conf file
LoadModule proxy_module modules/mod_proxy.so
0
 
LVL 3

Accepted Solution

by:
Charlie2012 earned 500 total points
ID: 37737893
There are a couple of things you need to do.
(if you make any changes to server.xml/web.xml you need to restart tomcat if oyu make changes to httpd.conf you wil need to restart apache).

1: Ensure you have your application resources configured in catalina_home/conf/server.xml
(your database resources)
EG:
         <Resource
                name="jdbc/DBNAME"
                auth="Container"
                type="javax.sql.DataSource"
                driverClassName="com.mysql.jdbc.Driver"
                url="jdbc:mysql://localhost/DBNAME"
                username="DBUSER"
                password="DBPASS"
                maxActive="10"
                maxIdle="5"
                minIdle="1"
                maxWait="15000" />

2: Ensure you have your modules configured in catalina_home/conf/web.xml
(mime types and servet mappings):
EG:    
<servlet-mapping>
        <servlet-name>jsp</servlet-name>
        <url-pattern>*.html</url-pattern>
    </servlet-mapping>
EG:
    <mime-mapping>
        <extension>shtm</extension>
        <mime-type>text/html</mime-type>
    </mime-mapping>


3: Ensure you have your app proxy configuration in httpd.conf (apache conf file)
EG:

#Tomcat configuration
ProxyRequests off
<proxy *>
  Order deny,allow
  Allow from all
</proxy>

ProxyPass /MYAPP http://mydomain.com:8080/MYAPP
ProxyPassReverse /MYAPP http://mydomain.com:8080/MYAPP


Here are some links that may help you:

http://oreilly.com/java/archive/tomcat-tips.html
http://tomcat.apache.org/tomcat-6.0-doc/proxy-howto.html
http://www.apachetutor.org/admin/reverseproxies
http://www.ehow.com/how_6108865_configure-apache-reverse-proxy.html

These also have some good documentaion that may be worth you looking at:

http://www.wellho.net/

Also PSI probe may help you:
http://code.google.com/p/psi-probe/

Deploy the war file. It uses the same username and password as tomcat manager.  connect using: myurl.com:8080 or if you have chnaged the port for manager access it will be: mydomain:myport.
0
 

Author Closing Comment

by:Daniel Södling
ID: 37741436
Great stuff!
Thanks a bunch!

We hade missed out on parts of the proxy configuration. Works now thanks to your advise. Thanks again!

Regards
Daniel
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now