LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Apache Assistance (https://www.linuxquestions.org/questions/linux-newbie-8/apache-assistance-36897/)

disayas 11-30-2002 01:41 PM

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..

jdc2048 11-30-2002 10:38 PM

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.

disayas 11-30-2002 11:02 PM

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>

Nefarious 12-01-2002 12:05 AM

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

Nefarious 12-01-2002 12:05 AM

oh heh didn;t readthat part lol srry...

disayas 12-01-2002 12:11 AM

:D

jdc2048 12-02-2002 09:29 AM

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".

disayas 12-02-2002 09:37 AM

Should the DirectoryIndex be in each of ther <Virtualhost> tags?

jdc2048 12-02-2002 10:34 AM

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.

disayas 12-02-2002 11:36 AM

Greetings friend:

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

thanks...

disayas 12-02-2002 12:19 PM

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.

404 12-10-2002 06:56 PM

use NameVirtualHost * and <VirtualHost *> and learn to RTFM

trickykid 12-10-2002 06:58 PM

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.


All times are GMT -5. The time now is 09:29 AM.