Problem deploying GWT application on apache and tomcat using mod_jk

Posted by Colin on Server Fault See other posts from Server Fault or by Colin
Published on 2011-01-13T11:55:43Z Indexed on 2011/01/13 12:55 UTC
Read the original article Hit count: 303

Filed under:
|
|
|

I'm trying to deploy a GWT app on Apache using mod_jk connector. I have compiled the application and tested it on tomcat on the address localhost:8080/loginapp and it works ok. However when I deploy it to apache using mod_jk I get the starter page which gives me a login form but trying to login I get this error

404 Not Found Not Found The requested URL /loginapp/loginapp/login was not found on this server

Looking at the apache log files i see this

[Thu Jan 13 13:43:17 2011] [error] [client 127.0.0.1] client denied by server configuration: /usr/local/tomcat/webapps/loginapp/WEB-INF/ [Thu Jan 13 13:43:26 2011] [error] [client 127.0.0.1] File does not exist: /usr/local/tomcat/webapps/loginapp/loginapp/login, referer: http://localhost/loginapp/LoginApp.html

The mod_jk configurations on my apache2.conf file are as follows

LoadModule jk_module /usr/lib/apache2/modules/mod_jk.so
JkWorkersFile /etc/apache2/workers.properties
JkLogFile /var/log/apache2/mod_jk.log
JkLogLevel info
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
JkRequestLogFormat "%w %V %T"

<IfModule mod_jk.c>

Alias /loginapp "/usr/local/tomcat/webapps/loginapp/"

<Directory "/usr/local/tomcat/webapps/loginapp/">
    Options Indexes +FollowSymLinks
    AllowOverride None
    Allow from all
</Directory>

<Location /*/WEB-INF/*>
    AllowOverride None
    deny from all
</Location>

JkMount /loginapp/*.html loginapp

My workers.properties file is as follows

workers.tomcat_home=/usr/local/tomcat
workers.java_home=/usr/lib/jvm/java-6-sun
ps=/
worker.list=loginapp

worker.loginapp.type=ajp13
worker.loginapp.host=localhost
worker.loginapp.port=8009

worker.loginapp.cachesize=10
worker.loginapp.cache_timeout=600
worker.loginapp.socket_keepalive=1
worker.loginapp.recycle_timeout=300
worker.loginapp.lbfactor=1

And this is my servlet mappings for my app on the application's web.xml

<servlet>
<servlet-name>loginServlet</servlet-name>
<servlet-class>com.example.loginapp.server.LoginServiceImpl</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>loginServlet</servlet-name>
<url-pattern>/loginapp/login</url-pattern>
</servlet-mapping>

<servlet>
<servlet-name>myAppServlet</servlet-name>
<servlet-class>com.example.loginapp.server.MyAppServiceImpl</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>myAppServlet</servlet-name>
<url-pattern>/loginapp/mapdata</url-pattern>
</servlet-mapping>

Ive tried everything and it seems to still elude me. Even tried changing the deny from all directive on the WEBINF folder to allow from all and still it doesnt work. Maybe im missing something. Any help will be highly appreciated.

© Server Fault or respective owner

Related posts about apache

Related posts about tomcat