htaccess

Business solution to host your own OpenVPN server with web management interface and bundled clients.
Post Reply
micjo01
OpenVpn Newbie
Posts: 1
Joined: Thu Mar 08, 2018 9:22 am

htaccess

Post by micjo01 » Thu Mar 08, 2018 9:29 am

Hi,

We've setup an Apache website and using .htaccess to allow access only to a specific set of internal ip addresses. This works well as long as my computer is connected to the internal network, but as soon as I try it at home and connect to the Openvpn server, I can no longer access it.

I've added the ip address that is my laptop receives from the Openvpn server to the htaccess file, but still no access. I also tried adding the internal and public ip address of the Openvpn server to htaccess but still no luck.

How can I make this work ?

Thanks for your help.
Best regards


Joeri

User avatar
novaflash
OpenVPN Inc.
Posts: 1073
Joined: Fri Apr 13, 2012 8:43 pm

Re: htaccess

Post by novaflash » Thu Mar 08, 2018 1:35 pm

Figure out which IP address your Apache2 server is seeing when you make a connection and then add that? See the Apache2 log files for that information.
I'm still alive, just posting under the openvpn_inc alias now as part of a larger group.

nehakakar
OpenVpn Newbie
Posts: 11
Joined: Tue Jul 11, 2023 1:29 pm

Re: htaccess

Post by nehakakar » Tue Jul 11, 2023 7:52 pm

If you're trying to access the Apache website with limited access from external IP addresses through an OpenVPN connection, you may need to adjust your configuration to allow traffic from the OpenVPN network.
Add add the following lineon your .htaccess.

Code: Select all

Allow from <OpenVPN_client_IP_address>
Also check your Apache configuration and add the lne...

Code: Select all

<Directory "/path/to/your protected_directory">
    AllowOverride All
</Directory>
Then Restart Apache hope it work to you.

Post Reply