LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-30-2002, 02:41 PM   #1
disayas
LQ Newbie
 
Registered: Nov 2002
Location: US
Distribution: Redhat *.0
Posts: 18

Rep: Reputation: 0
Apache Assistance


Greetings all:

Can someone help me with a small apache problem? I was able to get it up and running but for some reason when setting up virtual domains it defaults to the the main "default" site unless you include a /index.html. Thus, if I try www.site1.com or www.site2.com I get www.default.com. It's only when I try www.site1.com/index.html that I can get www,site1.com.

My suspicion is that it has something to do with the Host Header but being such a newbie to Linux I am not sure.

Please help and your assistance is greatly appreciated.

thanks...

dawit..
 
Old 11-30-2002, 11:38 PM   #2
jdc2048
Member
 
Registered: Jul 2002
Location: Ohio, USA
Distribution: Redhat, Gentoo, Solaris, HP-UX, etc...
Posts: 391

Rep: Reputation: 30
You may want to post your httpd.conf file, or at least the pertinent parts of it (recommended). Like for instance the Vhost stuff to begin with.

Last edited by jdc2048; 11-30-2002 at 11:41 PM.
 
Old 12-01-2002, 12:02 AM   #3
disayas
LQ Newbie
 
Registered: Nov 2002
Location: US
Distribution: Redhat *.0
Posts: 18

Original Poster
Rep: Reputation: 0
Thanks in advance for any assistance you can provide. Here is the config file. I am not using 192.168.0.1 as an address but do have a fixed static IP address assigned

NameVirtualHost 192.168.0.1:80

# Where do we put the lock and pif files?
LockFile "/var/lock/httpd.lock"
CoreDumpDirectory "/etc/httpd"

# Defaults for virtual hosts

# Logs

#
# Virtual hosts
#

# Virtual host Default Virtual Host
# <VirtualHost 192.168.0.1:80>
# ServerName default
# ServerSignature email
# DirectoryIndex index.php index.html index.htm index.shtml
# ServerSignature email
# LogLevel debug
# HostNameLookups off
# </VirtualHost>

# Virtual host site1
<VirtualHost 192.168.0.1:80>
DocumentRoot /var/www/html/site1

ServerAdmin wembaster@site1.com
ServerName www.site1.com

ServerAlias *.site1.com
ServerSignature email



</VirtualHost>

# Virtual host site2
<VirtualHost 192.168.0.1:80>
DocumentRoot /var/www/html/site2

ServerAdmin webmaster@site2.com
ServerName www.site2.com

ServerAlias site2.com
ServerAlias *.site2.com
ServerSignature email




ServerSignature email










</VirtualHost>

# Virtual host site3
<VirtualHost 192.168.0.1:80>
DocumentRoot /var/www/html/site3

ServerAdmin webmaster@site3.com
ServerName www.site3.com

ServerAlias site3.com
ServerAlias *.site3.com
ServerSignature email




ServerSignature email










</VirtualHost>
 
Old 12-01-2002, 01:05 AM   #4
Nefarious
Member
 
Registered: Nov 2002
Location: NY, USA
Distribution: Slackware / College Linux / WinXP
Posts: 198

Rep: Reputation: 30
Ummm..... well guessing by that ip.... you are using Linksys router... If so go to http://192.168.1.1 type in ur username/password... if u never changed urs which you should have it will be admin//admin .... Now go to the Status tab on the top of your router configuration... Under the WAN section it will list your static ip not the 1 designated to you by the router... and poof there is ur static ip address... so it would be that at port 80 not 192.168.0.1

(ie.) http://24.1.1.1:80 (Your static ip address at port 80)
http://192.168.0.1:80 (Your designated ip by your router... at port 80 which shouldent work
 
Old 12-01-2002, 01:05 AM   #5
Nefarious
Member
 
Registered: Nov 2002
Location: NY, USA
Distribution: Slackware / College Linux / WinXP
Posts: 198

Rep: Reputation: 30
oh heh didn;t readthat part lol srry...
 
Old 12-01-2002, 01:11 AM   #6
disayas
LQ Newbie
 
Registered: Nov 2002
Location: US
Distribution: Redhat *.0
Posts: 18

Original Poster
Rep: Reputation: 0
Talking

 
Old 12-02-2002, 10:29 AM   #7
jdc2048
Member
 
Registered: Jul 2002
Location: Ohio, USA
Distribution: Redhat, Gentoo, Solaris, HP-UX, etc...
Posts: 391

Rep: Reputation: 30
My understanding from your question is that you can access the site by site3.com/index.html, but not by just site3.com.

Have you tried copying the line below into the <VirtualHost> tag?
Code:
DirectoryIndex index.php index.html index.htm index.shtml
See if that does the trick.

I also notice that you have "ServerSignature" being set twice in site2 and site3. While this is most likely not the cause of your troubles, it is not needed. You also are missing the alias "site1.com", where instead you have just "*.site1.com". Again, I doubt this is the problem, but you won't be able to access it from "site1.com".

Last edited by jdc2048; 12-02-2002 at 10:36 AM.
 
Old 12-02-2002, 10:37 AM   #8
disayas
LQ Newbie
 
Registered: Nov 2002
Location: US
Distribution: Redhat *.0
Posts: 18

Original Poster
Rep: Reputation: 0
Should the DirectoryIndex be in each of ther <Virtualhost> tags?
 
Old 12-02-2002, 11:34 AM   #9
jdc2048
Member
 
Registered: Jul 2002
Location: Ohio, USA
Distribution: Redhat, Gentoo, Solaris, HP-UX, etc...
Posts: 391

Rep: Reputation: 30
The directive "DirectoryIndex" can be used in the virtual host context. Although I see that the Default is "DirectoryIndex index.html". What is the "DirectoryIndex" set to in the context of the default server config?

<edit>
I am not going to be of much more help because I will be away from my computer for the next week. Sorry if this doesn't get it. There is some good documentation on apache.org.

Last edited by jdc2048; 12-02-2002 at 12:01 PM.
 
Old 12-02-2002, 12:36 PM   #10
disayas
LQ Newbie
 
Registered: Nov 2002
Location: US
Distribution: Redhat *.0
Posts: 18

Original Poster
Rep: Reputation: 0
Greetings friend:

Right now it doesn't have a setting. Should it be the same?

thanks...
 
Old 12-02-2002, 01:19 PM   #11
disayas
LQ Newbie
 
Registered: Nov 2002
Location: US
Distribution: Redhat *.0
Posts: 18

Original Poster
Rep: Reputation: 0
OK, I added the filenames to Directory inde and now instead of getting the default site I get the error "host cannot be found". I can still access the www.stie1.com/index.html without error.
 
Old 12-10-2002, 07:56 PM   #12
404
Member
 
Registered: Mar 2002
Location: USA
Distribution: slackware; what else is there?
Posts: 30

Rep: Reputation: 15
use NameVirtualHost * and <VirtualHost *> and learn to RTFM
 
Old 12-10-2002, 07:58 PM   #13
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 235Reputation: 235Reputation: 235
Quote:
Originally posted by 404
use NameVirtualHost * and <VirtualHost *> and learn to RTFM
Were not a RTFM type of site. Don't like it, don't post and reply telling people to just RTFM.
 
  


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
Need assistance please wennie Linux - Software 5 03-16-2005 08:24 AM
Need assistance spotslayer Linux - Software 1 11-18-2004 07:49 AM
apache virtual hosing assistance palmercabel Linux - Networking 1 07-27-2004 02:39 PM
Need Assistance Bizar Slackware 11 06-25-2003 10:10 PM
A little assistance with mod_ssl and apache glock19 Linux - General 2 06-25-2002 01:04 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:23 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration