-   Linux - Networking (
-   -   can't access virtual host from local machine (

curos 02-06-2006 04:21 PM

can't access virtual host from local machine
Odd problem here. I've successfully setup virtual hosts on my computer and I can access them from everyone elses computer, but I can't access them from the local computer.

So is the default to go to. It is set as the global DocumentRoot and ServerName.
I can access it by typing its address in the browser on the local computer.

On the other hand, doesn't load at all and times out. On other computers, it loads fine. Any suggestions? Even better, is there a way I can trace what is happening when the request for is sent from my computer and how apache or whatever catches that request and interprets it?

Some more thoughts about it:
I was thinking the firewall might be a problem, since i manually did iptables myself with very basic rules, and perhaps virtual hosting gets confused that the localhost is trying to access it:

iptables -P INPUT DROP
iptables -P FORWARD DROP

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -s -d -i lo -j ACCEPT

iptables -A INPUT -p icmp -j ACCEPT

# apache
iptables -A INPUT -p tcp --dport 80 -i eth0 -j ACCEPT

Here is also my virtual host settings. As I said, they work when accessed from any computer that is not the local computer hosting the server.


<VirtualHost *:80>
    DocumentRoot /websites/sandwich/WWW
    ErrorLog /websites/sandwich/logs/error_log
    CustomLog /websites/sandwich/logs/access_log common

<VirtualHost *:80>
    ServerAlias mentoring
    DocumentRoot /websites/mentoring/WWW
    ErrorLog /websites/mentoring/logs/error_log
    CustomLog /home/share/websites/svsa/mentoring/logs/access_log common

Brian1 02-06-2006 04:44 PM

Not exactly what you are after but is based on dnat redirect of the connection. This ones talks about setting it so DNS names are seen from inside if using and internal machine to see the local dns server. Check the links from Capt Caveman there.


jschiwal 02-06-2006 05:12 PM

I believe that the behavior you are seeing is normal. You could simply enter the names and local ip address in your /etc/hosts file.

curos 02-06-2006 09:18 PM

Thanks! you're right, i just had to add it to my hosts file.

All times are GMT -5. The time now is 01:42 PM.