Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 02-06-2006, 04:21 PM   #1
Registered: Aug 2003
Distribution: Slackware
Posts: 72

Rep: Reputation: 15
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
Old 02-06-2006, 04:44 PM   #2
LQ Guru
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

Rep: Reputation: 62
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.

Old 02-06-2006, 05:12 PM   #3
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
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.

Last edited by jschiwal; 02-06-2006 at 05:14 PM.
Old 02-06-2006, 09:18 PM   #4
Registered: Aug 2003
Distribution: Slackware
Posts: 72

Original Poster
Rep: Reputation: 15
Thanks! you're right, i just had to add it to my hosts file.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache, virtual host, access problem ivanatora Linux - Software 2 04-05-2005 04:39 AM
Access Virtual host by IP mikeshn Linux - Networking 2 01-10-2004 10:25 AM
MD9.1 - Apache 2.0 - Can't access a virtual host Kronos3 Linux - Networking 1 10-13-2003 12:25 AM
virtual host for local testing tr3s Red Hat 1 09-02-2003 12:50 PM
Apache SSL - how to virtual host two or more secure websites on the same machine? bjoshi Linux - Networking 0 08-30-2001 07:01 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:01 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration