2007年4月3日星期二

Integrate Apache2.2.3 and tomcat5.5

Integrate Apache2.2.3 and tomcat5.5
 
modify  /usr/loca/apache2/conf/httpd.conf and  add below command to the end of this file
Include conf/extra/httpd-vhosts.conf
ProxyPass / ajp://127.0.0.1:8009/
ProxyPassReverse / ajp://127.0.0.1:8009/
 
modify /usr/local/apache2/conf/extra/httpd-vhosts.conf  and add below command to the end of this file
<VirtualHost *:80>
    ServerAdmin
zh1229@gmail.com
    DocumentRoot /opt/tomcat5/webapps/ROOT/
    ServerName 127.0.0.1
    ErrorLog logs/tomcat-error_log
    CustomLog logs/tomcat-access_log common
    ProxyPass / ajp://localhost:8009/
    ProxyPassReverse / ajp://localhost:8009/
    ServerName localhost
    ServerAlias 127.0.0.1
</VirtualHost>
 
Modify /opt/tomcat5/conf/server.xml
      <Host name="localhost" appBase="webapps"
       unpackWARs="true" autoDeploy="true"
       xmlValidation="false" xmlNamespaceAware="false">
make sure DocumentRoot and appBase is the same path.
 
Now you can restart your apache and tomcat to check.
Sure, if   below three module if not built-in, you could add it to the modules of apache using apxs tool.
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
#LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
 
Your sincere,
Henry
2007-04-03
 
 

1 条评论:

匿名 说...

Refer:
http://www.20wq.com/blog/article.asp?id=88