External proxypass and CMD_LOGIN/CMD_LOGOUT (those two still redirect to port 2222)

wierben

Verified User
Joined
May 21, 2013
Messages
6
Hi all!

It's my first time I'm working with DirectAdmin. Part of my website "routing" is done on 1 single point (offsite of customer shared servers), for SSL reasons, I'm redirecting traffic from my secured environment to serveral servers through proxy. This works fine for DirectAdmin aswell, thanks to the extended support and feature articles. However, 1 problem remains:

When I login to DA (CMD_LOGIN ?), the POST goed wel and I am logged in, however, I get redirected to port 2222 on my secure (sub)domain. When I remove the :2222 from the URL in my browser, all works fine and I'm logged in as I would expect to be. Until I login, the CMD_LOGOUT (?) again redirects me to port 2222 on my secure (sub)domain. On this server, this port is not open, so the customer will think he/she cannot login..

Summary:
I have an external apache with mod_proxy, mod_http_proxy and mod_html_proxy which connect to the shared server with directadmin throgh ProxyPass and ProxyPassReverse. Only login and logout do not function as expected.

Anyone who can fire me away into the right direction to solve this problem? Thanks!
Wybren
 
Did you check this article http://help.directadmin.com/item.php?id=84 ? It might give you answers.

Hi Alex,

yes I did, and it helped me through some other problems I had, but this article describes the proxypass for when the (sub)domain is hosted on the same server. Which is not the case..

Everything works as expected when logged in, even the login form (POST METHOD) works as it should, only, after the login, I get redirected to port 2222 instead of the port 80 I am on, when i correct manually in my browser (remove the :2222 from the url, I am logged in and can do everything I want as expected) Same is for when I log out (but this could be solved by a custom login page). On the server which is redirecting through the proxy module, there is no DirectAdmin nor is port 2222 open :(

So I'm guessing this port is somewhere hardcoded into the source of the directadmin login/logout commands?

Greetings,
Wybren
 
Regarding logout, probably you need to check this http://help.directadmin.com/item.php?id=61 and add this:

HTML:
<input type="hidden" name="FAIL_URL" value="http://www.yourdomain.com/login_failed.html">
<input type="hidden" name="LOGOUT_URL" value="http://www.yourdomain.com/logged_out.html">

Regarding redirecting to port 2222 after you login, what configuration do you have ther? What are the directives you use for proxy?
 
Code:
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

ProxyPass / http://server.example.com:2222/
ProxyPassReverse / http://server.example.com:2222/

(changed the URL offcourse).

I don't see anything wrong there :/
 
Just tried myself, the things are OK, working without redirecting, if to disable referrer checks:

Code:
check_referer=0

and ProxyPreserveHost

Code:
ProxyRequests Off
ProxyPreserveHost Off
<Proxy *>
  Order deny,allow
  Allow from all
</Proxy>

ProxyPass / http://server.example.com:2222/
ProxyPassReverse / http://server.example.com:2222/

Related: http://www.directadmin.com/features.php?id=1050
 
Thanks,

had the refferal_check on 0 allready, but the ProxyPreserveHost had to be off indeed. Thanks alot for your great thinking!
 
Back
Top