View Full Version : [SOLVED] Integrating tomcat into apache

May 5th, 2009, 01:11 PM
See the third post

May 7th, 2009, 12:10 PM
See the third post

May 8th, 2009, 10:03 AM
I've been trying to configure tomcat and apache so that they can both be used on port 80 and asked here.
Problem solved now, so if anyone would like to know, there's a very good link on: http://www.waterlovinghead.com/Tomcat

Here's my config:

/etc/apache2/httpd.conf is empty


NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
# SSL name based virtual hosts are not yet supported, therefore no
# NameVirtualHost statement here
Listen 443


<VirtualHost *:80>
ServerName mydomainname
ServerAdmin webmaster@localhost

DocumentRoot /var/www
DirectoryIndex index.html index.php index.jsp
<Directory />
Options FollowSymLinks
AllowOverride None
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all

ErrorLog /var/log/apache2/ajp.error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog /var/log/apache2/ajp.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order Deny,Allow
Deny from all
Allow from ::1/128

<Proxy *>
AddDefaultCharset Off
Order Deny,Allow
Allow from all

ProxyPass /manager http://localhost:8080/manager/html
ProxyPassReverse /manager http://localhost:8080/manager/html

ProxyPass /examples ajp://localhost:8009/examples
ProxyPassReverse /examples ajp://localhost:8009/examples

RewriteEngine On
RewriteCond %{REQUEST_URI} /.*\.(jsp|do)
RewriteRule ^/(.*) ajp://localhost:8009/$1 [P]
RewriteCond %{REQUEST_URI} /examples/.*
RewriteRule ^/(.*) ajp://localhost:8009/$1 [P]
RewriteCond %{REQUEST_URI} /j_security_check
RewriteRule ^/(.*) ajp://localhost:8009/$1 [P]



LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_balancer_module /usr/lib/apache2/modules/mod_proxy_balancer.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so
LoadModule proxy_ajp_module /usr/lib/apache2/modules/mod_proxy_ajp.so


<Connector port="8009" enableLookups="false" protocol="AJP/1.3" redirectPort="8443" />