Virtual Hosts - whats wrong
Here is how I have my virtual hosts set up for my primary and secondary domain name. It is not directing the 2ndary domain name to the correct directory. I swear I've tried every port/IP/directory combination that exists... gah. What is wrong here? It is insisting I have a Default Virtual Host, and when I change that to specify port 80 apache will not restart. I swear this should work...?
Red Hat 8. Code:
# |
The wildcard in the 1st virtual host setup accepts all requests. Since there is no ServersAlias it processes everything.
Put a ServerName and ServerAlias in BOTH definitions to differentiate between them right after DocumentRoot. You can use <VirtualHost *> for both setups |
PS: the ServerName should be a valid domain that points to your IP address.
|
hmmm
Firstly:
NameVirtualHost * It doesn't matter if you have <VirtualHost *>, just as long as you specify the ServerName. ie. Code:
### www.example1.com ### The above configuration works fine for the 75+ sites i have setup on my linux box, so it should work fine for you. To test domains that don't exist by your account, alter your hosts file in: windows > system32 > drivers > etc > hosts and enter: [ipaddress] domainname.com then, use "domainname.com" in your browser to test it. Hope that helps |
Thanks for the advice... :) I gave up last night, I will go home and try the changes tonight.
|
not a problem. If you need any more help, continue posting on this thread. :)
|
Okay, this is what I have now... seems that my utahdogs.com domain name hangs for a while, then just stops without reaching the correct directory. It still stays on my main domain name's page. :( I did add the domain name to the /etc/hosts file as well.
Code:
# Use name-based virtual hosting. |
Waiting patiently seemed to help. :) Hung for a while, now it works.. good thing for that tv break. :)
Thanks for the help. :) |
hehe.
no problems. |
All times are GMT -5. The time now is 05:18 AM. |