Loreno Oliveira
Loreno Oliveira

Reputation: 367

Problem redirecting calls from apache2 to tomcat with mod_proxy

I'm trying to figure out what is wrong with this configuration of mod_proxy (I should say that I'm not familiar with apache). This is the content of my httpd.conf:

LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
LoadModule proxy_http_module /usr/lib/apache2/modules/mod_proxy_http.so

ProxyRequests Off
ProxyPreserveHost On

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

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

<Location / >
    Order allow,deny
    Allow from all
</Location>

What I need is to show the tomcat's examples application when the main apache page is accessed. That is, run the examples application when I access http://[server ip].

I thought the previous configuration was sufficient for that, but when I try to access the main page of apache, I get the following error on browser:

HTTP Status 404 - /examplesexamples/

type Status report

message /examplesexamples/

description The requested resource (/examplesexamples/) is not available.
Apache Tomcat/6.0.29

In the browser URL bar, I can see that there was made a redirect to http://[server ip]/examples.

Any idea on that?

Upvotes: 1

Views: 796

Answers (1)

hariprasad
hariprasad

Reputation: 11

This worked for me

ProxyPass /examples http://127.0.0.1:8083/examples
ProxyPassReverse /examples http://127.0.0.1:8083/examples

Upvotes: 1

Related Questions