Using ProxyPass to "hide" the port 81

Discussion in 'Installation/Configuration' started by crapufish, Mar 15, 2007.

  1. crapufish

    crapufish New Member

    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:

    Code:
    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
     
  2. Ben

    Ben ISPConfig Developer ISPConfig Developer

    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...
     
  3. crapufish

    crapufish New Member

    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:

    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:
    Code:
    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

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

    Happy ISPConfig'ing!

    Dorian
     

Share This Page