Solved

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

Posted on 2008-10-27
6
4,850 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
ID: 22837184
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
ID: 22837489
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
ID: 22843518
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
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 

Author Comment

by:IT_Savant
ID: 22844240
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
ID: 22846625
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
ID: 22919137
this was a solution to my question although it was difficult to understand right off the bat. -Thanks Macker!
0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

Suggested Solutions

This article is about some of the basic and important steps to be used to improve the performance in web-sphere commerce application development. 1) Always leverage the Dyna-caching facility provided by the product 2) Remove the unwanted code …
Upgrading Tomcat – There are a couple of methods to upgrade Tomcat is to use The Apache Installer is to download and unzip and run the services.bat remove|install Tomcat6 Because of the App that we are working with, we can only use Tomcat 6.…
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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

911 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

24 Experts available now in Live!

Get 1:1 Help Now