2

I'm Working on a developpement server where i've set a Virtualhost in order to make Zend Framework work has it's meant to.

Problem is, I'm working with people who have dynamic ips: so I can't restrict (allow from) specific access for everyone. I've installed an OpenVPN server then, which gives every client an ip like 10.8.0.1/128 on tun0 interface. So i'de like to set my VHost conf in order to allow access only to VPN connected users.

Tried this in my vhost conf:

Order        deny,allow
Deny from    all
Allow from   10.8.0.0 ::1/128

But doesn't seem to work, any ideas?

Wrikken
  • 69,272
  • 8
  • 97
  • 136
Oleiade
  • 6,156
  • 4
  • 30
  • 42

1 Answers1

3
Order deny,allow
Deny  from all
Allow from   10.8.
Allow from   ::1
Allow from   127.0.0.1
Wrikken
  • 69,272
  • 8
  • 97
  • 136
  • this solution didn't work for me, maybe you have an answer for my question: https://stackoverflow.com/questions/30560812/apache-allow-deny-ip-rules-not-working-for-openvpn-on-same-server – baptx Jun 20 '15 at 15:10
  • 1
    @baptx the solution works, but you need to place those setings in `Directory` definition instead of virtual host – Michał Aug 05 '15 at 17:24
  • @Michał Thanks for your comment, it made me try again and solve my problem! In my case, it didn't work because traffic was not routed through OpenVPN if I wanted to access my website which uses same IP. With `traceroute google.com`, I can see the connection to the tun0 interface, reaching local IP 172.27.232.1. This is not the case with traceroute to my-website.tld, there is no local IP displayed, it's going to my router IP. In fact, I have to add "172.27.232.1 my-website.tld" to /etc/hosts of my local computer, like @Conerliu said in my question. Then IP restriction with "Allow from 172.27". – baptx Aug 13 '15 at 18:43