Solved

Adding web application to existing Apache/Tomcat installation

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

Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

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…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Suggested Courses

738 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