.htaccess - Apache allow/deny IP rules not working for OpenVPN on same server -


i have .htaccess file limits access folder. ip allowed server ip , protect folder password:

order deny,allow allow x.x.x.x deny  authuserfile /path/to/.htpasswd authtype basic authname "test" require user username 

this worked great when used ssh tunnel dynamic port forwarding access folder (ssh -fnd 1080 user@host.com).

now want access folder openvpn installed on server, instead of ssh. installed preconfigured openvpn access server on debian gnu/linux virtual private server , can connect sudo openvpn --config client.ovpn , vpn username/password.

when visiting website http://whatismyipaddress.com/, can see server ip address appears. when access apache http server, openvpn server installed, can see real ip address appears in /var/log/apache2/access.log. don't have domain associated server , want access protected folder trough server ip address or default domain hosting provider (vpsxxxxx.ovh.net). question may related post restricting apache2 virtual host access vpn don't use domain name access server.

how can http server openvpn server ip address instead of real ip address, if servers use same ip address (but different ports)?

that's same problem in linked article: if have openvpn server on 1.2.3.4 , apache server listening on same 1.2.3.4 ip, when connect apache server connection not routed through vpn through internet. , since don't connect apache server through vpn, see public ip.

one solution resolve vpsxxxxx.ovh.net domain (only you) private ip somehow, route connection through vpn - maybe using local dns server or manually editing hosts file of local computer. if go approach, have make apache listen private ip listen x.y.z.t

there might better solution though.

relevant: https://forums.opensuse.org/showthread.php/481949-running-apache-when-using-an-openvpn-connection


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -