How to make virtualhosts visible to each other on a shared hosting server behind a Firewall.
Situation
You have a web hosting server with lots of virtual hosts running on it.
You also have a a firewall in front of the server.
The server has a private IP address assigned to the NIC of the server and the firewall provide a NAT (public_ip -> private_ip)
Problem
Some virtualhosts on the server need to connect to the public DNS name of a virtualhost on the same server.
The DNS resolution resolve the DNS name to the public IP of the server and according to the routing table the traffic is routed to the firewall that make the connection impossible for a "in-out-interface-problem".
Solution
I think that there are more than one solution:
- alias the public ip
- nat in OUTPUT chain
I prefer the iptables solution and this worked for me:
ETH0_IP=$(ifconfig eth0 | grep "inet addr" | awk '{print $2}' | awk 'BEGIN {FS=":"} {print $2}')
ETH0_IP_PUBLIC="YOUR.PUBLIC.IP.ADDRESS"
$IPTABLES -t nat -A OUTPUT -d $ETH0_IP_PUBLIC -j DNAT --to-destination $ETH0_IP

reply
Lots of specialists argue that loan aid people to live their own way, just because they can feel free to buy necessary goods. Moreover, a lot of banks present college loan for different persons.