Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: Cannot get mod_proxy_ajp to work. Tried many times. :-( |
|
Author |
|
awebpro
Joined: 29 Aug 2007 Posts: 2
|
Posted: Fri 07 Sep '07 19:51 Post subject: Cannot get mod_proxy_ajp to work. Tried many times. :-( |
|
|
I have Apache 2.2 and Tomcat6.
I have a URL: www.domain1.com.
I have a working Struts application at http://localhost:8080/myApp/index.do (It is a struts action that is called from index.jsp)
I need to point the domain name,www.domain1.com, to the application running on Tomcat 6 as in when someone types in www.domain1.com, I want him to
see the starting page of the app at http://localhost:8080/myApp/index.do.
P.S I have already tried all the forum posts and google to no effect.
Here is my configuration.
I have LoadModule mod_proxy and mod_proxy_ajp in httpd file.
Here is my virtual host declaration in httpd-vhosts file. I have rewritten it to the original problem hence no references to ajp.
<VirtualHost *:80>
<Directory "C:/vhosts/domain1">
Order deny,allow
Allow from all
</Directory>
DocumentRoot "C:/vhosts/domain1"
ServerName www.domain1.com
DirectoryIndex index.jsp
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyRequests Off
ProxyPreserveHost Off
ProxyPass / http://localhost:8080/myApp/
ProxyPassReverse / http://localhost:8080/myApp/
</VirtualHost>
It works when I type in www.domain1.com and gives me the index page of myApp. However, it switches the www.domain1.com name to http://localhost:8080/myApp/index.do on all subsequent links starting from the index page. To prevent that, I turn ProxyPreserveHost On which breaks it completely.
Could someone show me EXACTLY how to fix my virtual host declaration AND ANYTHING ELSE to make this thing work with mod_proxy_ajp? Do I need to make any changes on Tomcat side in server.xml? If so, could someone please tell me exactly what to do to get this working. I have already tried google and forum posts but can't make this work. It's been a week already. Thanks in advance. |
|
Back to top |
|
James Blond Moderator

Joined: 19 Jan 2006 Posts: 7404 Location: EU, Germany, Next to Hamburg
|
|
Back to top |
|
|
|
|
|
|