|
Home > Archive > Apache Server configuration support > April 2007 > Virtual hosts won't work
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Virtual hosts won't work
|
|
| Travis 2007-04-27, 1:19 am |
| I am running the latest version of Apache on my Windows XP computer.
Currently, I use a subdomain at zentec.ath.cx. I set up server so that
the contents of my hard drive can be accessed via that site, and then
I wanted to set up a server where I can access my original htdocs for
my site when I do keynotes and presentations. I edited my httpd.conf
so I can the domain server.zentec.ath.cx pointed to htdocs. But every
time I open it, it goes to my HD. I did realize, that if I use
www.server.zentec.ath.cx it will work correctly and display the right
page. I'v used ServerAlias to server.zentec.ath.cx but it still
doesn't change.
Here is the config I have for Virtual servers:
##Virtual Hosts
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.zentec.ath.cx
ServerAlias zentec.ath.cx
DocumentRoot C:/
</VirtualHost>
<VirtualHost *:80>
ServerName www.server.zentec.ath.cx
DocumentRoot C:/Progra~1/XAMPP/xampp/htdocs
</VirtualHost>
| |
| shimmyshack 2007-04-27, 7:22 pm |
| On Apr 27, 2:18 am, Travis <trav1...@gmail.com> wrote:
> I am running the latest version of Apache on my Windows XP computer.
> Currently, I use a subdomain at zentec.ath.cx. I set up server so that
> the contents of my hard drive can be accessed via that site, and then
> I wanted to set up a server where I can access my original htdocs for
> my site when I do keynotes and presentations. I edited my httpd.conf
> so I can the domain server.zentec.ath.cx pointed to htdocs. But every
> time I open it, it goes to my HD. I did realize, that if I usewww.server.zentec.ath.cxit will work correctly and display the right
> page. I'v used ServerAlias to server.zentec.ath.cx but it still
> doesn't change.
>
> Here is the config I have for Virtual servers:
>
> ##Virtual Hosts
>
> NameVirtualHost *:80
>
> <VirtualHost *:80>
> ServerNamewww.zentec.ath.cx
> ServerAlias zentec.ath.cx
> DocumentRoot C:/
> </VirtualHost>
>
> <VirtualHost *:80>
> ServerNamewww.server.zentec.ath.cx
> DocumentRoot C:/Progra~1/XAMPP/xampp/htdocs
> </VirtualHost>
apart from being very dangerous to allow apache the rights to see (and
therefore if php is running to edit) any file on your hard disk, i do
not quite understand why if
www.server.zentec.ath.cx
will get you what you want,
server.zentec.ath.cx
wont! theres nothing special about one rather than the other, provided
ServerName server.zentec.ath.cx is there, it should work.
|
|
|
|
|