Re: How to limit source IP in PHP
| From: | Antonio Nati) | Date: | Wed, 12 Sep 2012 14:18:53 +0000 |
| Subject: | Re: How to limit source IP in PHP | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-319044@lists.php.net to get a copy of this message | ||
Il 12/09/2012 16:08, Tommy Pham ha scritto:
On Wed, Sep 12, 2012 at 6:53 AM, Tonix (Antonio Nati) <tonix@interazioni.it> wrote:1) is only for listening. 2) means a VPS for each domain, which we already do with vmware and FreeBSD jails, but it is too expensive for some customers. 3) means I'm writing the script, which is not the standard situation. You must suppose the script to be written from a malicious user in a shared environment. Is PHP able to 'force' binding IP? I hoped there was an external directive I did not see, but probably this is a PHP lack. Regards, Tonino -- ------------------------------------------------------------ Inter@zioni Interazioni di Antonio Nati http://www.interazioni.it tonix@interazioni.it ------------------------------------------------------------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 ------------------------------------------------------------1) Use Listen in Apache 2) Use VM such as KVM, VMWare, etc. 3) Make an array containing permissible domains. Check the $_SERVER['SERVER_NAME'] if exists in that array. React/respond accordingly.Inter@zioni Interazioni di Antonio Nati http://www.interazioni.it tonix@interazioni.it------------------------------------------------------------