Operating System - HP-UX
1831939 Members
3028 Online
110032 Solutions
New Discussion

Re: Apache+Tomcat or Tomcat only

 
Soumen Ghosh_1
Occasional Advisor

Apache+Tomcat or Tomcat only

Hello,

We are developing a web based application which will be primarily dynamic content based.
We have options between choosing Apache as Web Server and Tomcat as servlet engine or using Tomcat as both. Our platform is HP-UX 11.0
Which option is more stable and gives more performance?
Thanks in advance.

Soumen Ghosh
7 REPLIES 7
James Beamish-White
Trusted Contributor

Re: Apache+Tomcat or Tomcat only

My basis would be - if you don't have a good reason *to* use Apache, then don't.

I have had a lot of problems getting them to work together, and why introduce an additional layer of complexity if it is not needed?

Cheers!
James
GARDENOFEDEN> create light

Re: Apache+Tomcat or Tomcat only

The most important reason to use apache as the front end is the fact only a root user can bind to ports below 1024. If your tomcat server needs to bind to port 80 then it will need to run as root, which I would image most admin would regard as a severe security issue, even if your code was properly written not to access system resources.

Apache on the other hand will also need to bind to port 80 as a root user but then it will spawn child process to perform the real work. These child process can then run as any other non-root user to ensure that they are not capable of damaging the system.


We have had good luck using mod_webapp connecting apache and tomcat. If you are worried about images, pdf's and the like, they can be installed outside the web application but within Apache docroot. We have only seen a few hundred millisecond additional
download time with apache/tomcat vs. a standalone tomcat.

See this ITRC thread for issue with installation on HP-UX
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xddccc8ecad09d6118ff40090279cd0f9,00.html
Soumen Ghosh_1
Occasional Advisor

Re: Apache+Tomcat or Tomcat only

Hello,

Thanks for the answers.
I could not install mod_webapp on HP-UX but mod_jk was perfectly alright. Buy the way, could you install mod_webapp on HP-UX 11.0?
I would also like to know about all the tools (preferably free) using which I can stress-test my web application.
Thanks again.

Soumen Ghosh

Re: Apache+Tomcat or Tomcat only

The Configure script for mod_webapp has some HP-UX compliance issues as described in the link in my previous reply. If you have mod_jk working it is most likely not worth the effort to get mod_webapp working.

In terms of stress testing I would recomend Apache Jmeter from the www.apache.org site.

HP offers a similar product available at
http://www.hp.com/go/java
Kyle Brown_1
New Member

Re: Apache+Tomcat or Tomcat only

I am attempting to get apache and tomcat to work together but am having all kinds of trouble. I have gotten the tomcat mod_jk.so created. Placed the mod_jk.so in the libexec/ folder, modified the httpd.conf
LoadModule jk_module libexec/mod_jk.so
But get an error when I try to start that apache does not know what LoadModule is. I'm sure I am missing something simple, do you have any suggestions as to where I can look?
Kyle

Re: Apache+Tomcat or Tomcat only

Was your apache built with the -enable=so option? LoadModule is provided by mod_so
Kyle Brown_1
New Member

Re: Apache+Tomcat or Tomcat only

It did seem as though it needed a recompile, this time making sure to put the enable in. Now it is coming back with this:
amefird2:/usr/local/apache/bin# ./apachectl start
/usr/lib/dld.sl: Unresolved symbol: apr_palloc (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_table_make (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_sockaddr_port_get (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_table_elts (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: ap_hook_map_to_storage (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_pstrdup (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_table_overlay (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_table_setn (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: ap_hook_handler (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_table_get (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: ap_hook_translate_name (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: ap_hook_child_init (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_table_add (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: ap_hook_post_config (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_pstrcat (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_pvsprintf (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_table_set (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_filename_of_pathname (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_psprintf (code) from /usr/local/apache/libexec/mod_jk.so
/usr/lib/dld.sl: Unresolved symbol: apr_date_parse_http (code) from /usr/local/apache/libexec/mod_jk.so
Syntax error on line 984 of /usr/local/apache/conf/httpd.conf:
Cannot load /usr/local/apache/libexec/mod_jk.so into server: Unresolved external
./apachectl start: httpd could not be started

Any suggestions?