Solved

Apache, Tomcat, 6, Running on CentOS 5 with mod_jk connector

Posted on 2008-10-27
6
4,848 Views
Last Modified: 2013-12-16
Hello all,

   How is the configuration of Tomcat on Linux CentOS 5 different from windows config?  I got it to work on windows but I am having problems getting it to work on Linux for Tomcat 6.  

Thanks,
IT_Savant
0
Comment
Question by:IT_Savant
  • 3
  • 3
6 Comments
 
LVL 7

Assisted Solution

by:macker-
macker- earned 500 total points
Comment Utility
That's an extremely open-ended question.  Can you cite some specific issues you're having, symptoms, error messages, etc?
0
 

Author Comment

by:IT_Savant
Comment Utility
For example, if I compiled and ran a J2EE program on Windows, would it be automagically guranteed to work on a Linux Box assuming tomcat was properly installed.  That is to say, would I have to muck with the libraries to get a J2EE software that worked on Windows localhost to work on a Linux box (a virtual server)?

Thanks,
IT_Savant
0
 
LVL 7

Assisted Solution

by:macker-
macker- earned 500 total points
Comment Utility
Java, as provided by Sun, is made to be a platform independent programming language.  That is to say, the idea is that a Java app could be run on Linux, Windows, MacOS, etc.

Microsoft's licensed implementation of Java does include some Windows-specific extensions, that preclude apps from being used on other platforms, if they use these extensions.

If you have libraries installed on the Windows side, that are not yet installed on the Linux side, it could fail.

Sun offers a high-level difference of the explanations at http://java.sun.com/javaee/overview/faq/j2ee.jsp#tomcat

A key excerpt is: "Sun adapts and integrates the then-current Tomcat source code into new releases of the J2EE SDK. However, since Tomcat evolves rapidly at Apache, there are additional differences between the JSP and Servlet implementations in the J2EE SDK and in Tomcat between J2EE SDK releases."

It sounds like your question is, should my app that's working fine in Windows, be expected to work just fine on the Tomcat server under Linux, and how much work would be involved in making it work.

Unfortunately, there's unlikely to be a simple answer to that, because it depends largely on your app, and how close the specific version of J2EE is to the version of Tomcat.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:IT_Savant
Comment Utility
I used Java as provided by Sun, so all is well. Thank you Macker!  And it just so happened that I am using the current version of everything so there should be not much work to get everything to work.  I just needed to know if my there are any windows specific libraries that would have to be exchanged for a linux equivalent.

One more thing, I am having to type http://domain.com:8080/webapp  If you wouldn't mind, would you tell me what is necessary to make that http://domain.com/webapp? I have apache web server running on port 80 which is the default port. In fact, I wouldn't mind getting to a point where index.html is loading up my app on the default port.

Thanks,
IT_Savant
0
 
LVL 7

Assisted Solution

by:macker-
macker- earned 500 total points
Comment Utility
Unfortunately, I'm not familiar enough with the Windows implementation of J2EE to offer a useful answer on whether the libraries differ...

It sounds like your approach has been the same as mine would be; load up the app, see if it works, and research any errors.  Maybe someone else can offer some input on this.

With regards to the URL, you have two options here.  One is to have tomcat bind directly to port 80; this is possible, but is usually not recommended.  Tomcat does understand HTTP, but has very limited features, and is really useful in this manner only for basic testing, or if you're only exposing it to internal scripted applications and services.

The second option is to use mod_jk in apache; mod_jk is the Jakarta Connector, and allows Apache to field HTTP requests destined for Tomcat.  A basic mod_jk config, once mod_jk has been installed, might look something like this:

LoadModule jk_module modules/mod_jk.so
JkLogFile /var/log/httpd/mod_jk.log
JkLogLevel warn
JkWorkerProperty worker.local.port=8080
JkWorkerProperty worker.local.host=127.0.0.1
JkWorkerProperty worker.list=local

Then, if you have a VirtualHost directive, place the following within that section.  If not, then it can be in the main section. In either case, this should be near the relevant DocumentRoot statement:

JkMount /webapp/* local


It's also possible to do some auto-configuration with tomcat.  There's some great details on the mod_jk connector at the Tomcat site, though I'd look around the web for a primer specific to your distribution, e.g. "Red Hat tomcat mod_jk", as it'll offer more concise and useful suggestions.  (CentOS is effectively the same as Red Hat, but a different name; nearly all documentation applicable to Red Hat will apply to the same version of CentOS.)  The Tomcat document can be found at:

http://tomcat.apache.org/tomcat-3.3-doc/mod_jk-howto.html
0
 

Accepted Solution

by:
IT_Savant earned 0 total points
Comment Utility
this was a solution to my question although it was difficult to understand right off the bat. -Thanks Macker!
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

17 Experts available now in Live!

Get 1:1 Help Now