Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache/tomcat on linux

Status
Not open for further replies.

takisd

Programmer
Oct 12, 2002
2
AU
hi folks

i'm new to linux and have previously run tomcat and apche on a windows machine with no issues.

i'm now trying to run apache and tomcat together on linux and i'm having a few issues. each one works fine individually but don't seem to cooperate with eachother. i compiled and installed apache on linux using a distribution from the apache web site. all ok with that. problem is that it won't accept LoadModule when i want to add the mod_jk.so module to the list. my mod_jk.conf which is inlcuded at the end of my httpd.conf file is as follows:

<IfModule !mod_jk.c>
LoadModule jk_module /usr/local/tomcat_4.1.12/modules/mod_jk.so
</IfModule>

JkWorkersFile &quot;/usr/local/tomcat_4.1.12/conf/jk/workers.properties&quot;
JkLogFile &quot;/usr/local/tomcat_4.1.12/logs/mod_jk.log&quot;

the httpd.conf file contains no LoadModule or AddModule directives at all (which i thought was odd since i'm use to a large list when using on win32). when i start apache i get the following message:

Syntax error on line 14 of /usr/local/tomcat_4.1.12/conf/jk/mod_jk.conf:
Invalid command 'LoadModule', perhaps mis-spelled or defined by a module not included in the server configuration
bin/apachectl start: httpd could not be started

if i add the LoadModule in httpd.conf i receive the same message. could i have the incorrect distribution of mod_jk, or perhaps my apache installation isn't quite right eben though it works fine serving static pages?? perhaps i need to build mod_jk also - if so from where and how?
i know i've got a few issues here... any help at all would be greatly appreciated.

thanks heaps
Takis
 
Ok sorry but this will not address your module issue but you can always have your Apache webserver do a ProxyPass to the Tomcat port to serve up your app.

Take a look at this excerpt from an example httpd.conf:
[START OF EXCERPT]
### Section 3: Virtual Hosts

# Do virtual hosting on any IPs and any ports we're bound to.
NameVirtualHost *

# Service any request that gets to us - no matter the port/IP
# - that the HTTP headers say is to '# This virtual host proxies all requests to tomcat on the appropriate
# your-tomcat-app# server
<VirtualHost *>
ServerName ProxyRequests Off
ProxyPass / ProxyPassReverse / ProxyVia On

CacheRoot &quot;/var/cache/httpd&quot;
# CacheSize is in KB - so ~50Mb
CacheSize 50000
CacheGcInterval 4
CacheMaxExpire 1
CacheLastModifiedFactor 0.1
CacheDefaultExpire 0.1

</VirtualHost>
[END OF EXCERPT]

I hope this helps someone (maybe you even ?)

good luck
 
Hi all,

The problem is that you didn't include DSO on Apache compilation.

Reinstall Apache with the following commands :

./configure --prefix=<APACHE_DIR> --enable-module=so
./make
./make install

Then you can add the LoadModule in httpd.conf

I hope this help,

[]'s

Paidar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top