On 2011-06-12, Martin Pelikan <martin.peli...@gmail.com> wrote: > 2011/6/12 Bambero <bamb...@gmail.com>: >> Hello >> >> I have many IP and IP based virtualhost configured. >> Everything works fine. But when making request (for ex. fsockopen) >> with php the outgoing IP is 123.456.789.66. >> Does anybody know how to tell php to bind to virualhost IP when making >> request ?
This is really a PHP-related question, you should ask on one of their mailing lists. > There's a memory-wasting way by creating separate rdomain per each IP, > and running multiple web servers in each of those. Or you can run multiple PHP FastCGI processes, one for each virtual host where you want a separate source address, running each one as a separate uid (this is a great idea anyway if you are trying to isolate the virtual hosts from each other). Then you can use PF: 'match out from user $foo nat-to $fooip'. This is probably simpler than using rdomains.