Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I’ve configure my apache accordingly from what I’ve read in the apache 2.2 manual. Taking the following as an example of my configuration.

ProxyRequests Off

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

ProxyPass "/home/kwokfu/sandbox" "http://localhost:8080/sandbox"
ProxyPassReverse "/home/kwokfu/sandbox" "http://localhost:8080/sandbox"

Everytime when I visit to http://localhost:8080/sandbox the server still point me back to where my localhost’s default document root instead of the one that I stated in the proxy configuration.

I don’t know what am I doing wrong here and that any help is really much appreciated!

For your reference, I compile my proxy module as following:

$ apxs -cia mod_proxy.c proxy_util.c
$ apxs -cia mod_proxy_http.c
$ apachectl -M
 ...
 proxy_module (shared)
 proxy_http_module (shared)
 ...

and get the following log message everytime i visit http://localhost:8080/sandbox:

"GET /sandbox HTTP/1.1" 404 206 "-" "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.13) Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13"
...
[debug] proxy_util.c(1806): proxy: grabbed scoreboard slot 0 in child 11225 for worker http://localhost:8080/sandbox
[debug] proxy_util.c(1825): proxy: worker http://localhost:8080/sandbox already initialized
[debug] proxy_util.c(1922): proxy: initialized single connection worker 0 in child 11225 for (localhost)
[debug] proxy_util.c(1806): proxy: grabbed scoreboard slot 1 in child 11225 for worker proxy:reverse
[debug] proxy_util.c(1825): proxy: worker proxy:reverse already initialized
[debug] proxy_util.c(1922): proxy: initialized single connection worker 1 in child 11225 for (*)
[debug] proxy_util.c(1791): proxy: worker http://localhost:8080/sandbox already initialized
[debug] proxy_util.c(1791): proxy: worker http://localhost:8080/sandbox already initialized
...
[error] [client 127.0.0.1] File does not exist: /opt/apache2/2.2.12/htdocs/sandbox
...

Seems like the proxy is not working... This is driving me crazy...

share|improve this question

2 Answers 2

From your description I think you should have the following:

ProxyPass "/sandbox" "http://localhost:8080/home/kwokfu/sandbox"
ProxyPassReverse "/sandbox" "http://localhost:8080/home/kwokfu/sandbox"
share|improve this answer

You are visiting the wrong URI. You should got to http://localhost/sandbox and the proxying Apache instance should then direct the request to the instance listening on port 8080. Of course that instance will also have to be configured. Did you set a DocumentRoot for this virtual host?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.