AJP1.3 config issue with apache/Jboss/Tomcat
dbxliao Jul 8, 2011 2:04 PMI have been trying to setup two old EJB applications (apexmange and apeximport) to work on my laptop. Each of the apps will use different ports for http and https (for example for apeximport: 8011 for http, 8012 for https).
I am using apache web server to route the requests to JBoss/tomcat app server.
The app, apexmange, works as a charm, with or without apeximport that doesn't work.
From %JBOSS_HOME%\bin
I can't start the apeximport, and log file tell me it's started and the port # 8011 ans 8012 have been asigned.
INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8011
INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8012
INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Bran
ch_4_0 date=200610162339)] Started in 37s:94ms
However, when I try to access the page http://dliaoxp/apeximport/Index.do gives me "HTTP Status 404 - /import-voice/Index.do".
Here is the enviroment I'm using.
Operating Syste: Windows XP Professional, Version 2002, SP2
Apache http server: Version 2.2.19 with SSL
JBoss: jboss-4.0.5.GA
JBoss-Tomcat connector: jbossweb-tomcat55.sar
AJP 1.3 - Apache Jserv Protocol for apache-tomcat connector
Any advices are appreicated.
David
-----------------------------------------------------------------------------------------------------------
The following are the steps and/or files I've used.
1. httpd.conf (under C:/opt/Apache2.2/conf)
ServerRoot "C:/opt/Apache2.2"
Listen dliaoxp:80
ServerName dliaoxp:80
# LoadModule
# I've included everything, except the following two
# LoadModule proxy_scgi_module modules/mod_proxy_scgi.so
# LoadModule reqtimeout_module modules/mod_reqtimeout.so
DocumentRoot "C:/opt/Apache2.2/htdocs"
...
Include conf/extra/httpd-mpm.conf
Include conf/extra/httpd-multilang-errordoc.conf
Include conf/extra/httpd-autoindex.conf
Include conf/extra/httpd-languages.conf
Include conf/extra/httpd-info.conf
Include conf/extra/httpd-manual.conf
Include conf/extra/httpd-dav.conf
Include conf/extra/httpd-default.conf
Include conf/extra/httpd-ssl.conf
### I added this forajp1.3
Include conf/extra/httpd-proxy-ajp.conf
2. httpd-proxy-ajp.conf
<VirtualHost *:80>
### Manage ###
ProxyPass /tsi-manage/ ajp://dliaoxp:8010/tsi-manage/
ProxyPass /apexmanage/ ajp://dliaoxp:8010/tsi-manage/
ProxyPass /manage-status ajp://dliaoxp:8010/manage-status
ProxyPass /manage-jmx-console/ ajp://dliaoxp:8010/manage-jmx-console/
ProxyPass /manage-web-console/ ajp://dliaoxp:8010/manage-web-console/
### Import ###
ProxyPass /import-voice/ ajp://dliaoxp:8012/import-voice/
ProxyPass /apeximport/ ajp://dliaoxp:8012/import-voice/
ProxyPass /import-status ajp://dliaoxp:8012/import-status
ProxyPass /import-jmx-console/ ajp://dliaoxp:8012/import-jmx-console/
ProxyPass /import-web-console/ ajp://dliaoxp:8012/import-web-console/
RewriteEngine on
RewriteLog "rewrite.log"
ProxyPass /home/ ajp://dliaoxp:8009/
</VirtualHost>
3. httpd-ssl.conf
Listen dliaoxp:443
AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl .crl
SSLPassPhraseDialog builtin
SSLSessionCache "shmcb:C:/opt/Apache2.2/logs/ssl_scache(512000)"
SSLSessionCacheTimeout 300
SSLMutex default
<VirtualHost dliaoxp:443>
DocumentRoot "C:/opt/Apache2.2/htdocs"
ServerName dliaoxp:443
ServerAdmin dliao@transolutions.net
ErrorLog "C:/opt/Apache2.2/logs/error_ssl.log"
TransferLog "C:/opt/Apache2.2/logs/access_ssl.log"
SSLEngine on
SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
SSLCertificateFile "C:/opt/Apache2.2_OLD/conf/ssl-crt/dliaoxp.cert"
SSLCertificateKeyFile "C:/opt/Apache2.2_OLD/conf/ssl-key/dliaoxp.key"
...
##
# I have to add these lines here so that I can access page:
# http://dliaoxp/apexmanage/Index.do
##
ProxyPass /tsi-manage/ ajp://dliaoxp:8010/tsi-manage/
ProxyPass /apexmanage/ ajp://dliaoxp:8010/tsi-manage/
## So that I add the following as well, and wish I could visit page
# http://dliaoxp/apeximport/Index.do
##
ProxyPass /import-voice/ ajp://localhost:8012/import-voice/
ProxyPass /apeximport/ ajp://localhost:8012/import-voice/
</VirtualHost>
4. server.xml for the applications to bdeployed to JBoss/tomcat
4.1 %JBOSS_HOME%\server\apexmanage\deploy\jbossweb-tomcat55.sar\server.xml
<Server>
<Service name="jboss.web"
className="org.jboss.web.tomcat.tc5.StandardService">
<!-- A AJP 1.3 Connector on port 8080 -->
<Connector port="8080" address="${jboss.bind.address}"
maxThreads="250"
strategy="ms"
maxHttpHeaderSize="8192"
emptySessionPath="true"
enableLookups="false"
redirectPort="80"
acceptCount="100"
connectionTimeout="20000"
disableUploadTimeout="true"
debug="2"
scheme="http"
secure="false"
clientAuth="false"
protocol="AJP/1.3"/>
<!-- A AJP 1.3 Connector on port 8009 -->
<Connector port="8009" address="${jboss.bind.address}"
emptySessionPath="true"
enableLookups="false"
redirectPort="80"
allowTrace="true"
debug="2"
scheme="http"
secure="false"
clientAuth="false"
protocol="AJP/1.3"/>
<!-- A AJP 1.3 Connector on port 8010 -->
<Connector port="8010" address="${jboss.bind.address}"
allowTrace="true"
emptySessionPath="true"
enableLookups="false"
redirectPort="443"
debug="2"
scheme="https"
secure="true"
clientAuth="false"
protocol="AJP/1.3"/>
...
</Service>
</Server>
4.2 %JBOSS_HOME%\server\apeximport\deploy\jbossweb-tomcat55.sar\server.xml
<Server>
<Service name="jboss.web"
className="org.jboss.web.tomcat.tc5.StandardService">
<!-- A AJP 1.3 Connector on port 8011 -->
<Connector port="8011" address="${jboss.bind.address}"
emptySessionPath="true"
enableLookups="false"
redirectPort="80"
allowTrace="true"
debug="2"
scheme="http"
secure="false"
clientAuth="false"
protocol="AJP/1.3"/>
<!-- A AJP 1.3 Connector on port 8012 -->
<Connector port="8012" address="${jboss.bind.address}"
allowTrace="true"
emptySessionPath="true"
enableLookups="false"
redirectPort="443"
debug="2"
scheme="https"
secure="true"
clientAuth="false"
protocol="AJP/1.3"/>
...
</Service>
</Server>
5. Start Apache HTTP server
6. Start the java apps from %JBOSS_HOME%\bin
6.1
%run -c apexmanage
Log:
INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8080
INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8009
INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8010
INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Bran
ch_4_0 date=200610162339)] Started in 48s:15ms
6.2
%run -c apeximport
Log:
INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8011
INFO [ChannelSocket] JK: ajp13 listening on /0.0.0.0:8012
INFO [Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Bran
ch_4_0 date=200610162339)] Started in 37s:94ms
7. Test:
7.1 http://dliaoxp/apexmanage/Index.do works fine.
7.2 http://dliaoxp/apeximport/Index.do gives me "HTTP Status 404 - /import-voice/Index.do".
8. TCP/PORT checking:
TCP DLiaoXP:8012 localhost:13499 ESTABLISHED
TCP DLiaoXP:13499 localhost:8012 ESTABLISHED
TCP DLiaoXP:8010 localhost:13311 ESTABLISHED
TCP DLiaoXP:13311 localhost:8010 ESTABLISHED