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.

EDIT:

I just went with Nginx to do the proxy in front of Apache. Much easier to set up and it actually worked.


I'm trying to get apache to forward all requests on port 80 to 127.0.0.1:8000, which is where the django dev server runs. I think I have it forwarding properly, but there must be an issue with 127.0.0.1:8000 not being run by apache?

I'm running the django dev server in an ubuntu vmware instance, and I'd other people in the office to see the apps in development without having to promote anything to our actual dev/staging servers.

Right now the virtual machine picks up an IP for itself, and when I point a browser to that url with the defualt apache config, I get the default apache page.

I've since changed the httpd.conf file to the following to try and get it to forward the requests to the django dev server:

ServerName localhost

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

<VirtualHost *>
    ServerName  localhost
    ServerAdmin alex@example.com

    ProxyRequests off
    ProxyPass * http://127.0.0.1:8000
</VirtualHost>

All I get are 404s with this, and in error.log I get the following (192.168.1.101 is the IP of my computer 192.168.1.142 is the IP of the virtual machine):

[Mon Mar 08 08:42:30 2010] [error] [client 192.168.1.101] File does not exist: /htdocs
share|improve this question
    
Which VMware product? Please consider changing the [vmware] tag on this with a product specific tag. This helps us better categorise questions. –  Ben Pilbrow May 4 '11 at 19:45

3 Answers 3

Is that better?

<VirtualHost *>
    ServerName  localhost
    ServerAdmin alex@example.com

ProxyRequests Off

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

ProxyPass *  http://127.0.0.1:8000
ProxyPassReverse *  http://127.0.0.1:8000
</VirtualHost>

Did you restart apache? Is the error message still about the directory??

share|improve this answer
    
Yup, restarted apache. Same errors with this conf. –  Alex Jillard Mar 8 '10 at 17:36
    
Find the directive that holds the htdocs in your httpd.conf and make it point to something that actually exists to start with –  Alexandre Nizoux Mar 8 '10 at 21:57
    
Set the DocumentRoot to /var/www but now it just loads the default index.html from there, rather than proxying. –  Alex Jillard Mar 9 '10 at 16:48

ProxyPass takes a path not a wildcard, try

ProxyPass /  http://127.0.0.1:8000
ProxyPassReverse /  http://127.0.0.1:8000
share|improve this answer

To check whats running on 127.0.0.1 (8000) you can:

curl -I http://127.0.0.1:8000 | grep Server

If it's apache, then other web servers should not start ok. But looking your answers to other solutions we can suspect on that.

If it's apache, just search/edit the Listen lines, to 192.168.1.142:80

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.