Solved

Adding web application to existing Apache/Tomcat installation

Posted on 2012-03-16
4
215 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

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 …
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

816 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

8 Experts available now in Live!

Get 1:1 Help Now