LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-06-2006, 04:21 PM   #1
curos
Member
 
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 sandwich.domain.edu 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, mentoring.domain.edu 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 mentoring.domain.edu 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:
Code:
iptables -P INPUT DROP
iptables -P FORWARD DROP

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -s 127.0.0.0/8 -d 127.0.0.0/8 -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.

Code:
<VirtualHost *:80>
    DocumentRoot /websites/sandwich/WWW
    ServerName sandwich.domain.edu
    ErrorLog /websites/sandwich/logs/error_log
    CustomLog /websites/sandwich/logs/access_log common
</VirtualHost>

<VirtualHost *:80>
    ServerName mentoring.domain.edu
    ServerAlias mentoring
    DocumentRoot /websites/mentoring/WWW
    ErrorLog /websites/mentoring/logs/error_log
    CustomLog /home/share/websites/svsa/mentoring/logs/access_log common
</VirtualHost>
 
Old 02-06-2006, 04:44 PM   #2
Brian1
LQ Guru
 
Registered: Jan 2003
Location: Seymour, Indiana
Distribution: Distribution: RHEL 5 with Pieces of this and that. Kernel 2.6.23.1, KDE 3.5.8 and KDE 4.0 beta, Plu
Posts: 5,700

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

http://www.linuxquestions.org/questi...72#post1944372

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

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
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
curos
Member
 
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.
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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

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