| Author |
Message |
dotmil
Joined: 15 Dec 2004
Posts: 12
|
| Posted: Fri Dec 24, 2004 12:43 pm Post subject: Apache default server is showing virtual server directory |
|
|
I have my Linode set up as hostname dotmil.org with several virtual servers for other domains. Before I added the virtual servers dotmil.org showed the /var/www directory for it's root, but now when I go to dotmil.org, it maps to the first virtual server's home/public_html instead. The only things that were changed on the httpd.conf was adding the virtual servers, any ideas on where to begin to fix this? Google, et. al. weren't much help.
My httpd.conf can be seen at this link. This is on a Debian Sarge installation too FWIW. |
|
| Back to top |
|
caker
Joined: 15 Apr 2003
Posts: 2404
Location: Galloway, NJ
|
| Posted: Fri Dec 24, 2004 12:57 pm Post subject: |
|
|
I've faced this before and know of one way to fix it. There might be a more "correct" way, but:
Since you're doing Name Based virtual hosts on the primary/single IP, you need to add dotmill as another <VirtualHost>, with a proper "ServerName" option.
-Chris |
|
| Back to top |
|
dotmil
Joined: 15 Dec 2004
Posts: 12
|
| Posted: Fri Dec 24, 2004 1:35 pm Post subject: |
|
|
Thanks, that fixed it.
Just curious, I do have a second IP for my Linode (for DNS purposes), could I configure virtual servers on that IP as well? I'm assuming yes, but it would probably be with little or no purpose unless for SSL or something like that? |
|
| Back to top |
|
caker
Joined: 15 Apr 2003
Posts: 2404
Location: Galloway, NJ
|
| Posted: Fri Dec 24, 2004 1:38 pm Post subject: |
|
|
dotmil wrote: curious, I do have a second IP for my Linode (for DNS purposes), could I configure virtual servers on that IP as well? I'm assuming yes, but it would probably be with little or no purpose unless for SSL or something like that?
You are exactly correct. SSL certs are the only thing that requires an additional IP for hosting...
-Chris |
|
| Back to top |
|
pclissold
Joined: 24 Oct 2003
Posts: 481
Location: Netherlands
|
| Posted: Fri Dec 24, 2004 6:45 pm Post subject: |
|
|
caker wrote: I've faced this before and know of one way to fix it. There might be a more "correct" way, but:
caker's way is the correct way.
apache docs wrote: If you are adding virtual hosts to an existing web server, you must also create a <VirtualHost> block for the existing host. The ServerName and DocumentRoot included in this virtual host should be the same as the global ServerName and DocumentRoot. List this virtual host first in the configuration file so that it will act as the default host.
Virtual host documentation |
|
| Back to top |
|
dotmil
Joined: 15 Dec 2004
Posts: 12
|
| Posted: Sat Dec 25, 2004 11:58 am Post subject: |
|
|
| Thanks pclissolid; time to RTFM. |
|
| Back to top |
|
| |