Re: How to limit source IP in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/09/2012 14:53, Tonix (Antonio Nati) wrote:
> 
> Is there a way to force a PHP script to bind to a prefixed IP?
> 
> Actually, while you can assign more IPs to Apache for listening,
> assigning domains to specific IPs, it looks like any PHP script can
> freely choose which IP to bind. Instead I'd love some domains are
> permitted to open connections only from the domain IP.
> 
> In FreeBSD I do it easily, setting up dedicated jails for domains. But
> how to do it simply using PHP on Linux?
> 
> Regards,
> 
> Tonino

Hi,

I think its been established now that this cannot be done by any php
configuration so you will have to use other methods.


You could configure iptables to only allow outgoing packets from
specific IPs using the 'owner' module:

http://www.netfilter.org/documentation/HOWTO/packet-filtering-HOWTO-7.html
 (search for 'owner').


There is also SELINUX.


Or you could look at container based virtualisation like OpenVZ.


Regards

Ian
-- 




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux