View previous topic :: View next topic |
Author |
Message |
shinobSS n00b
Joined: 23 Aug 2002 Posts: 62 Location: Dallas, TX
|
Posted: Tue Sep 10, 2002 12:47 pm Post subject: Apache Vhosts question |
|
|
Hiya,
I am on a pppoe DSL connection, with a router that handles NAT internal addressing for my network. Recently I built a dev box, and started working with Apache.
What I need to do is set up two different domains, shinobi.mine.nu, and kscbs.mine.nu on my IP that's updated with ddclient. I've read through the Apache docs, and I'm not sure if what I want to do is possible. I want to make shinobi.mine.nu the default webpage, but if someone types in kscbs.mine.nu, they will be directed to that page.
The way that I have it set up at the moment, kscbs.mine.nu is the name vhost, and I have the default server's directoryroot pointing to shinobi.mine.nu. What foils my plans however is this doc which (if I uderstand it correctly) says that Apache first checks the vhosts for the listening IP, and if it's not the right one, go to the default server.
Is there a possible workaround for this? I have been searching high and low for one, but havent been able to find one. I was under the impression that maybe the host request (ie: type in kscbs.mine.nu, and Apache takes you to the documentroot for kscbs) was what determined the page that comes up...
My though was that maybe I could make shinobi.mine.nu the nameVhost, but then noone would be able to access kscbs.mine.nu..
Here's a look at the NameVirtualHost I've defined for kscbs.mine.nu..hopefully it will help:
Code: |
NameVirtualHost *
<VirtualHost *>
ServerName kscbd.mine.nu
DocumentRoot /home/httpd/htdocs/kscbd
#ErrorLogs /home/kscbd/apache_log
</VirtualHost>
|
I just modified the Vhosts.conf file with the above.
Any help would be appreciated |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Tue Sep 10, 2002 5:46 pm Post subject: Re: Apache Vhosts question |
|
|
shinobSS wrote: | What foils my plans however is this doc which (if I uderstand it correctly) says that Apache first checks the vhosts for the listening IP, and if it's not the right one, go to the default server. |
You lost me here. Could you go into a little more detail as to what is going wrong?
Quote: | I was under the impression that maybe the host request (ie: type in kscbs.mine.nu, and Apache takes you to the documentroot for kscbs) was what determined the page that comes up... |
Yes, that's the way that name-based virtual hosts work. You have to add DNS A records for each of the aliases by which you want to refer to the server, and then it should work exactly as you describe here.
Quote: | My though was that maybe I could make shinobi.mine.nu the nameVhost, but then noone would be able to access kscbs.mine.nu.. |
I don't see why this matters - it should work either way.
Quote: | Here's a look at the NameVirtualHost I've defined for kscbs.mine.nu..hopefully it will help: |
Nothing problematic jumps out at me. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
shinobSS n00b
Joined: 23 Aug 2002 Posts: 62 Location: Dallas, TX
|
Posted: Tue Sep 10, 2002 11:24 pm Post subject: |
|
|
Hmm..now I'm totally lost. The only thing that I see that I havent done is any kind of DNS...I thought dyndns.org was handling that..
Is there any way to set up an internal DNS? I imagine that would kill two birds with one stone, since to get to my pages, I have to put in the IP address or else the name wont resolve..
Thanks =) |
|
Back to top |
|
|
rac Bodhisattva
Joined: 30 May 2002 Posts: 6553 Location: Japanifornia
|
Posted: Tue Sep 10, 2002 11:33 pm Post subject: |
|
|
shinobSS wrote: | Is there any way to set up an internal DNS? |
Sure. I use tinydns, aka djbdns, but you could use BIND if you prefer. _________________ For every higher wall, there is a taller ladder |
|
Back to top |
|
|
shinobSS n00b
Joined: 23 Aug 2002 Posts: 62 Location: Dallas, TX
|
Posted: Wed Sep 11, 2002 1:05 am Post subject: |
|
|
I could beat myself over the head.
I dont know if this is the workaround, or maybe I just accidentally did it right, but I now have both domains up and running without issue (as far as I'm aware).
All I did was make another NameVhost for shinobi.mine.nu, pointing to the same documentroot as the default server...and it worked!
On top of that, it would seem that I'm doubly insured: if Apache doenst hand the address over to kscbs.mine.nu, or shinobi.mine.nu, it'll default to my shinobi.mine.nu frontpage.
Thanks for the help =) |
|
Back to top |
|
|
shakti Guru
Joined: 15 May 2002 Posts: 358 Location: omnipresent
|
Posted: Wed Oct 30, 2002 9:46 pm Post subject: Re: Apache Vhosts question |
|
|
rac wrote: | ?
Quote: | I was under the impression that maybe the host request (ie: type in kscbs.mine.nu, and Apache takes you to the documentroot for kscbs) was what determined the page that comes up... |
Yes, that's the way that name-based virtual hosts work. You have to add DNS A records for each of the aliases by which you want to refer to the server, and then it should work exactly as you describe here.
Nothing problematic jumps out at me. |
I have to disagree that you need DNS A records for every alias....just one entry with wildcard *.domain.com. should work and vhosts in apache does the rest. _________________ Using Gentoo since 2002. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|