Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2490
  • Last Modified:

Setting up Tomcat

Can any one assist with (step by step) setting up Tomcat5.5 on Suse Linux 64bit.
  • 3
  • 3
  • 3
  • +1
1 Solution
I suggest you get an installer to do it for you...Setting up tomcat can be tedious...
It will seem simple until you try to run some java site and you get an error...tomcat installers are much more simpler...
have a read of the following

let me know if you get stuck and I'll see if I can help

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

zellarsAuthor Commented:
My issue is that I can get Tomcat running but exactly how do I deploy a webapp on a url to the world? I can connect to tomcat on localhost:8080 and to apache on ipaddress:80 but not to tomcat on ipaddress:8080 from other hosts. I keep playing with the config and breaking tomcat. I'm using SUSE 11 64bit and TOMCAT6 (Sorry not 5.5). I would like to deploy webapp on port 80 to internet using apache and tomcat6.
if apache is running on port 80, you 'll need to set it up to redirect to tomcat
(or get rid of apache on that port)

use xampp for linux to take of all this for you or lamp...these are installer's that sets all this up for you...my last shot at making you life easier...

Setting up tomcat is as easy as untaring the file and running it as long as you have the jvm in the class path and then point your browser to server hostname:8080.

But if you want tomcat to work over port 80 through apache, you will need to compile mod_jk (tomcat connector) and configure which is a bit involved.
Youll need
1. compile mod_jk for your apache version
2. setup mod_jk.conf in your /etc/httpd/conf.d/ (includes mod_jk config you need to add to httpd.conf)
3. setup up workers.properties in /etc/httpd/conf/
4. add jkmounts to your domains httpd.conf properties.
zellarsAuthor Commented:
OK, I think I will just NAT from port 80 to Tomcat port 8080.
Hello Zellers,

I provided you with step by step so that tomcat will work on port 80.

The key to making that happen is mod_jk and the /etc/httpd/conf/workers.properties.
Please list what you've done and I can guide you with more specifics.

Did you compile mod_jk?
Did you add the mod_jk.conf details in /etc/httpd/conf.d/
Did you create the worker for ajp13 in workers? Default workers.properties that comes with mod_jk should suffice.

Did you add the jkmounts? I can post here exactly what you need in the mod_jk.conf and the httpd conf for your virtual domain here this afternoon. Please provide the root path locations to your tomcat.

Ah, turns out I have a minute. Ill lay it all out.

1. Download tomcat's mod_jk coyote connector: JK 1.2.27 Source Release tar.gz to /root/

2. Compile mod_jk:
untar and then
$> cd native
$> ./configure --with-apxs=/usr/sbin/apxs (or where ever the apxs/apxs2 is)
$> make
$> su -c 'make install'

3. Setup mod_jk.conf in /etc/httpd/conf.d/ (apache's include dir)
touch /etc/httpd/conf.d/mod_jk.conf

paste the following in the file:
    DirectoryIndex index.jsp index.do
    # Load mod_jk module  ### use correct path to your mod_jk.so ####
    LoadModule    jk_module  /usr/lib/httpd/modules/mod_jk.so
    # Declare the module for <IfModule directive>
    # AddModule     mod_jk.c
    # Where to find workers.properties
    JkWorkersFile /etc/httpd/conf/workers.properties
    # Where to put jk logs
    JkLogFile     /var/log/httpd/mod_jk.log
    # Set the jk log level [debug/error/info]
    JkLogLevel    info
    # Select the log format
    JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " 
    # JkOptions indicate to send SSL KEY SIZE,
    # JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
    # JkRequestLogFormat set the request format
    JkRequestLogFormat     "%w %V %T"

# SSL Directives
    # Should mod_jk send SSL information to Tomcat (default is On)
    JkExtractSSL On
    # What is the indicator for SSL (default is HTTPS)
    JkHTTPSIndicator HTTPS
    # What is the indicator for SSL session (default is SSL_SESSION_ID)
    # What is the indicator for client SSL cipher suit (default is SSL_CIPHER)
    # What is the indicator for the client SSL certificated (default is SSL_CLIENT_CERT)

4. Go back to the mod_jk files you untarred in /root/ and find the copy of the workers.properties file. cp this file to /etc/httpd/conf/

5. Add httpd conf data to your virtual host entry
<Location /WEB-INF/ > 
    AllowOverride None
    deny from all
 <Location /META-INF/ > 
    AllowOverride None
    deny from all

       JkAutoAlias /home/user/path to tomcat webapps/
       JkMount /*.jsp ajp13
       JkMount /servlet/* ajp13
       JkMount /*.xml  ajp13
       AddType text/xml .xml

Restart tomcat and then httpd.
You may need to make some changes to your server.xml
But this is how I set up tomcats for virtual hosting over port 80 and I've hosted hundreds of tomcat sites this way, so I know this works.

zellarsAuthor Commented:
Thank you sir for your expertise. I will keeping working towards attaining your skill level!

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now