LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-28-2007, 05:59 PM   #1
gooddesi
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Rep: Reputation: 0
Unhappy Apache VirtualHost - http://www. problem


Hi all,

I have installed Apache (httpd 2.2.0) on my Fedora 5.

When i type http://www.myname.mydomain.com or http://myname.mydomain.com
URL in browser it works fines. But when I type http://www.yourname.mydomain.com in browser it is not displaying any page, while http://yourname.mydomain.com link works fine. I have same problem with http://www.ourname.mydomain.com

Can you please help me to find why “www” is only working with first entry and is not working for 2nd and 3rd virtualhost entry?

My httpd.conf file is as below.
-----------------------------------------------------------------------------
.
.
ServerName localhost:80 (also tried www.myname.mydomian.com)
.
.
DocumentRoot "/Data/html"
.
.

NameVirtualHost *:80
.
.
<VirtualHost *:80>
ServerName www.myname.mydomain.com
ServerAlias myname.mydomain.com
DocumentRoot "/Data/html/myname"
</VirtualHost>



<VirtualHost *:80>
ServerName www.yourname.mydomain.com
ServerAlias www.yourname.mydomain.com yourname.mydomain.com
DocumentRoot "/Data/html/yourname"
</VirtualHost>


<VirtualHost *:80>
ServerName www.ourname.mydomain.com
ServerAlias www.ourname.mydomain.com ourname.mydomain.com
DocumentRoot "/Data/html/ourname"
</VirtualHost>

Last edited by gooddesi; 04-29-2007 at 10:44 AM.
 
Old 04-29-2007, 12:45 AM   #2
leandean
Member
 
Registered: Oct 2005
Location: Burley, WA
Distribution: Sabayon
Posts: 276

Rep: Reputation: Disabled
Apache isn't reading the second entry. Try one alias per line.

ServerAlias 1
ServerAlias 2

Last edited by leandean; 04-29-2007 at 12:48 AM.
 
Old 04-29-2007, 01:07 AM   #3
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Why the " at the end of your DocumentRoot statements?
 
Old 04-29-2007, 10:48 AM   #4
gooddesi
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Original Poster
Rep: Reputation: 0
leandean,

I tried creating 2 alias as you said but it not working.

ServerAlias www.yourname.mydomain.com
ServerAlias yourname.mydomain.com

and billymayday " was the typo error in DocumentRoot statements.
 
Old 04-29-2007, 11:30 AM   #5
SlackDaemon
Member
 
Registered: Mar 2006
Distribution: RedHat, Slackware, Experimenting with FreeBSD
Posts: 222

Rep: Reputation: 30
Do you have all these hostnames specified in your /etc/hosts file or on a DNS server? Otherwise the browser is trying to find an actual host on the internet with that name.

try to ping each of the hostnames in turn and see if they all point to your virtual server.
 
Old 04-29-2007, 09:57 PM   #6
gooddesi
LQ Newbie
 
Registered: Apr 2007
Posts: 4

Original Poster
Rep: Reputation: 0
I tried
# dig www.myname.yourdomain.com and found there is problem with DNS entry.

I add entry in DNS and now site is working fine.

Thank you for all your help.
 
  


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 08:41 AM
apache: http redirect for any request going to www.foo.com/* psychobyte Linux - Software 1 04-11-2005 05:57 PM
VirtualHost Apache 2 Problem Chris_K1 Linux - Networking 0 01-25-2005 10:00 AM
apache and http://www.domainname.com xviddivxoggmp3 Linux - Software 4 04-07-2004 11:14 AM
Apache: Virtualhost configuration problem deepika Linux - Software 3 08-12-2003 10:13 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration