0
votes

I have configured an apache 2.2 server to forward requests to a tomcat 6 application listen on 8080/tcp. When the request is processed by apache, it duplicates the name of the application. So an error is posted on the browser. Apache and tomcat are living at the same server, behind a firewall. On the firewall, I have created a redirect rule to forward all 80/tcp requisitions to apache´s server. 8080 tcp port is blocked on firewall.

Here is my apache 2.2 config:

<VirtualHost *:80>
   ServerName myaddress.com
   ServerAlias myaddress.com
   ServerAdmin [email protected]
   ProxyRequests Off
   ProxyPreserveHost On
   <Proxy *>
      Order deny,allow
      Allow from all
   </Proxy>
   <Location />
      Order allow,deny
      Allow from all
      ProxyPass http://localhost:8080/portal
      ProxyPassReverse http://localhost:8080/portal
   </Location>
</VirtualHost>

Here is my server.xml config:

   <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" proxyPort="80" proxyName="myaddress.com"/>

When I type http://myaddress.com in the browser, the address is replaced by http://myaddress.com/portal and the following error message is showed:

HTTP Status 404 - /portalportal/

type Status report

message /portalportal/

description The requested resource (/portalportal/) is not available.

2
better chances if you ask this on serverfault.comJoseK
does http://localhost:8080/portal work? 404 simply means the app you looking for is not there. it's more likely the connector between tomcat and apache is reconfigured, check your mod_jkWill

2 Answers

2
votes

It should look like:

ProxyPass / http://localhost:8080/
ProxyPassReverse / http://localhost:8080/

the "/" means it should be accessed from http://localhost -> proxied to -> http://localhost:8080/portal.

0
votes

Instead of this you can connect tomcat to apache using workers so that you never have to deal with port 8080, only the apache ones. A good source is http://www3.ntu.edu.sg/home/ehchua/programming/howto/ApachePlusTomcat_HowTo.html and there are many more guides you can find. So you will have JKmount with the desired path along with your worker name

JkMount /path worker1 for example

Hope I didn't misunderstand your question, and hope it helps!