Apache 2 – I have webmin running on port 10000…I want it to be accessed the normal HTTP port (80)

Posted on

Apache 2 – I have webmin running on port 10000…I want it to be accessed the normal HTTP port (80) – Managing your servers can streamline the performance of your team by allowing them to complete complex tasks faster. Plus, it can enable them to detect problems early on before they get out of hand and compromise your business. As a result, the risk of experiencing operational setbacks is drastically lower.

But the only way to make the most of your server management is to perform it correctly. And to help you do so, this article will share nine tips on improving your server management and fix some problem about apache-2.2, perl, port, configuration, .

Currently I am doing this with the config.

NameVirtualHost *
<VirtualHost *>
        ServerName testsite.org
        ServerAdmin webmaster@testsite.org
        DocumentRoot /var/www/
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature on

</VirtualHost>

<VirtualHost *>
        ServerName panel.testsite.org
        ProxyPass / http://panel.testsite.org:10000/
        ProxyPassReverse / http://panel.testsite.org:10000/
</VirtualHost>

This works, but now I need to use a Perl CGI on the panel.testsite.org to find the REMOTE_ADDR and its displaying the server’s IP…because of this proxy workaround. What is a better way I can perform what I need without using a proxy or anything that will mess up REMOTE_ADDR

Solution :

Given that you are using a proxy, you should be using the Reverse Proxy Request Headers:

  • X-Forwarded-For
    The IP address of the client.
  • X-Forwarded-Host
    The original host requested by the client in the Host HTTP request header.
  • X-Forwarded-Server
    The hostname of the proxy server.

Leave a Reply

Your email address will not be published. Required fields are marked *