Solved

Adding web application to existing Apache/Tomcat installation

Posted on 2012-03-16
4
245 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my time as an SEO for the last 2 years and in the questions I have assisted with on here I have always seen the need to redirect from non-www urls to their www versions. For instance redirecting http://domain.com (http://domain.com) to http…
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

688 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