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.. |
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.
|
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> |
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 |
oh heh didn;t readthat part lol srry...
|
:D
|
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 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". |
Should the DirectoryIndex be in each of ther <Virtualhost> tags?
|
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. |
Greetings friend:
Right now it doesn't have a setting. Should it be the same? thanks... |
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.
|
use NameVirtualHost * and <VirtualHost *> and learn to RTFM
|
Quote:
|
All times are GMT -5. The time now is 09:29 AM. |