?
Solved

Adding web application to existing Apache/Tomcat installation

Posted on 2012-03-16
4
Medium Priority
?
253 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 2000 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

777 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