artichoke
Verified User
This starts out as almost a HOWTO, and ends with a feature request.
To make Directadmin operating via https (i.e., SSL) on port 2222 also accessible via http (i.e., no SSL), one solution is to uncomment the references to mod_proxy in httpd.conf, then create a user and add a custom httpd configuration for that user that contains:
ProxyRequests Off
ProxyPass / https://localhost:2222/
ProxyPassReverse / https://localhost:2222/
This causes incoming non-SSL hits on port 80 for that user's domain to be proxied by Apache to reach Directadmin. If the user's domain was 'insecure.example.com', then connecting to http://insecure.example.com/ will cause you to reach the SSL-enabled Directadmin server on port 2222.
The same could be done using stunnel.
Now here is where the feature request comes in. Accesses on non-SSL port 80 as above will appear to the Directadmin server to come from 127.0.0.1. This has two adverse effects. (a) If somebody breaks into a user's account and accesses his Directadmin control panel via port 80, the user's login history wil show only 127.0.0.1 and not the intruder's actual IP address. (b) Directadmin's "Blacklist IPs for excessive login attempts" feature won't prevent intrusion attempts because login attempts will all appear to come from 127.0.0.1.
The solution, and feature request, is that the Directadmin server should parse any X-HTTP-Forwarded-For header in an incoming connection and, if and only if the remote IP address is 127.0.0.1, then Directadmin should use the first IP address contained in the X-Http-Forwarded-For header as the IP address to use in the user's login history and for detecting excessive login attempts. I am almost sure that Apache's mod_proxy adds this header by default.
Rahul
To make Directadmin operating via https (i.e., SSL) on port 2222 also accessible via http (i.e., no SSL), one solution is to uncomment the references to mod_proxy in httpd.conf, then create a user and add a custom httpd configuration for that user that contains:
ProxyRequests Off
ProxyPass / https://localhost:2222/
ProxyPassReverse / https://localhost:2222/
This causes incoming non-SSL hits on port 80 for that user's domain to be proxied by Apache to reach Directadmin. If the user's domain was 'insecure.example.com', then connecting to http://insecure.example.com/ will cause you to reach the SSL-enabled Directadmin server on port 2222.
The same could be done using stunnel.
Now here is where the feature request comes in. Accesses on non-SSL port 80 as above will appear to the Directadmin server to come from 127.0.0.1. This has two adverse effects. (a) If somebody breaks into a user's account and accesses his Directadmin control panel via port 80, the user's login history wil show only 127.0.0.1 and not the intruder's actual IP address. (b) Directadmin's "Blacklist IPs for excessive login attempts" feature won't prevent intrusion attempts because login attempts will all appear to come from 127.0.0.1.
The solution, and feature request, is that the Directadmin server should parse any X-HTTP-Forwarded-For header in an incoming connection and, if and only if the remote IP address is 127.0.0.1, then Directadmin should use the first IP address contained in the X-Http-Forwarded-For header as the IP address to use in the user's login history and for detecting excessive login attempts. I am almost sure that Apache's mod_proxy adds this header by default.
Rahul