PDA

View Full Version : Using ProxyPass to "hide" the port 81


crapufish
15th March 2007, 11:53
Hello!

I am trying to forward all the requests made to http://www.mydomain.com/ispconfig/ to the ISPConfig web interface using Apache's ProxyPass. Unfortunately this is not working...

I edited /etc/apache2/apache2.conf and added at the end of the file this:


ProxyRequests off
ProxyPass /ispconfig/ http://127.0.0.1:81/

Now, when I try to access http://www.mydomain.com/ispconfig/ it shows a "403 Access forbidden" page. Any idea why this doesn't work? It seems apache clearly wants to redirect to ISPConfig, but something goes wrong...

Thanks!

Dorian

Ben
15th March 2007, 15:20
What do you see in the error / access log of the apache serving mydomain.com?
Eventually it is helpfull to set the LogLevel to debug for that purpose...

crapufish
15th March 2007, 19:52
Hello!

I resolved this... Here is my solution (in case someone else might need it):

I added at the end of the Apache2 config file (/etc/apache2/apache2.conf) the following code:

ProxyRequests Off

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

ProxyPass /ispconfig http://127.0.0.1:81
ProxyPassReverse /ispconfig http://127.0.0.1:81


Now everytime I go to http://www.mydomain.com/ispconfig/ Apache forwards my request to localhost:81

I had however to edit /home/admispconfig/ispconfig/lib/config.inc.php as well because the HTML code for some images and css style files were generated using the full real url (the one with :81).

Here are the changes I made:

I replaced this:

if(isset($_SERVER['HTTP_HOST'])){
$go_info["server"]["server_url"] = 'http://'.$_SERVER['HTTP_HOST'];
} else {
$go_info["server"]["server_url"] = "http://www.mydomain.com:81";
}


with this


$go_info["server"]["server_url"] = "http://www.mydomain.com/ispconfig";



Happy ISPConfig'ing!

Dorian