LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-12-2003, 10:48 AM   #1
deepika
Member
 
Registered: Jul 2003
Distribution: Redhat
Posts: 88

Rep: Reputation: 15
Apache: Virtualhost configuration problem


Hi all,

I have installed Apache on my RH8.0 with below packages.

httpd
httpd-manual
mod_ssl
mod_perl
mod_python

The installation seemed to work fine as I could see the test page.
Now I want to configure it for name-based Virtual hosting and have changed my /etc/htpd/conf/httpd.conf as below .
-----------------------------------------------------------------------------------
.
.
ServerName deepika.mydomain.com:80
.
.
DocumentRoot "/var/www/html"
.
.
# Use name-based virtual hosting.
#
#NameVirtualHost *
NameVirtualHost 192.168.0.2

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#

<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/docs/pawan.domain.com
ServerName pawan.domain.com
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>


<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/docs/deepika.mydomain.com
ServerName deepika.mydomain.com
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>

<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/docs/pawan.mydomain.com
ServerName pawan.mydomain.com
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>

<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/docs/www.redhat.com
ServerName www.redhat.com
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>

<VirtualHost 192.168.0.2>
DocumentRoot /var/www/html/docs/www.hotmail.com
ServerName www.hotmail.com
DirectoryIndex index.php index.html index.htm index.shtml
</VirtualHost>

------------------------------------------------------------------------------------

Now when I use http://pawan.domain.com or http://deepika.mydomain.com or http://pawan.mydomain.com it works fine as it takes me to either test page or my own pages as expected but when I ues http://www.redhat.com or http://www.hotmail.com it takes me to internet site even when I have configured these in my /etc/hosts as below(where my eth1 = 192.168.0.2)

127.0.0.1 localhost.localdomain localhost
192.168.0.1 local0
192.168.1.2 local1
192.168.0.2 pawan.domain.com
192.168.0.2 pawan.mydomain.com
192.168.0.2 deepika.mydomain.com
#192.168.0.2 www.yahoo.com
192.168.0.2 www.redhat.com
192.168.0.2 www.hotmail.com

And the order defined in /etc/host.conf file is order hosts,bind

I don't understand why doesn't it uses the configuration from my /etc/hosts and httpd.conf file for www.redhat.com and www.hotmail.com.

Can anyone please help me in identifying the problem. Any help will be greatly appreciated.

Thanks & regards,
Deepika

 
Old 08-12-2003, 10:54 AM   #2
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
Ping www.redhat.com or www.hotmail.com and see what IP it resolves to...

If it does resolve to 192.168.0.2, then most probably u have a stale cache in your browser.
 
Old 08-12-2003, 11:08 AM   #3
deepika
Member
 
Registered: Jul 2003
Distribution: Redhat
Posts: 88

Original Poster
Rep: Reputation: 15
yes, it resolves to 192.168.0.2 but I tried reloading these links again and again and it still gives me the same results. How do I make the browser use my configuration for these links??
 
Old 08-12-2003, 11:13 AM   #4
Azmeen
Senior Member
 
Registered: May 2003
Location: Malaysia
Distribution: Slackware, LFS, CentOS
Posts: 1,307

Rep: Reputation: 47
If using most X-based browser, pressing on the Ctrl button while clicking on the Refresh button will do.

Have you tried opening those URLs in lynx or any other text-based browsers?
 
  


Reply


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 VirtualHost Redirect Problem... SiLiCoN Linux - Networking 5 05-03-2005 09:41 AM
Apache 2 VirtualHost woes, permissions problem, just can't work it out. utow Linux - Software 2 04-19-2005 02:48 PM
Apache - Problem when configure VirtualHost b:z Linux - Networking 17 04-07-2005 03:44 AM
VirtualHost Apache 2 Problem Chris_K1 Linux - Networking 0 01-25-2005 11:00 AM
SSL Configuration on an Apache VirtualHost sancho5 *BSD 6 07-29-2002 09:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:30 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