Apache Server configuration support - Followup: VirtualHosts..

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > February 2006 > Followup: VirtualHosts..





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 Followup: VirtualHosts..
Evan Platt

2006-02-12, 5:58 pm

Following up to my post a few months back, My friend finally pointed
his IP for his domain to my server - a mac g4 running apache 2.0.52.

I've added to the top of my httpd.conf:

NameVirtualHost www.hisdomain.be:80

<VirtualHost www.hisdomain.be:80>

ServerName www.hisdomain.be
ServerAlias hisdomain.be *.hisdomain.be
DocumentRoot /Users/hisdirectory/public_html

</VirtualHost>

<VirtualHost *:80>

ServerName www.espphotography.com
DocumentRoot /Library/WebServer/Documents

</VirtualHost>


But still, going to hisdomain.be goes to my index.php.

The mac is behind a NAT router (Netgear), 192.168.1.3.

Is that the problem? Am I doing something else wrong?

Thanks.

Evan
--
To reply, remove TheObvious from my e-mail address.
Evan Platt

2006-02-12, 5:58 pm

On Sun, 12 Feb 2006 10:22:33 -0800, Evan Platt
<evan@theobvious.espphotography.com> wrote:

>Following up to my post a few months back, My friend finally pointed
>his IP for his domain to my server - a mac g4 running apache 2.0.52.


Ok, rereading the reply to my original post from hansh:
"Right, the _name_ entered is passed in request header to the server
and has to match a the setting of servername -or serveralias-.
Using the IPadress, although passed to the sever- will _fail_ for
being non-distinctive between vhosts.
Thus, any domainname hosted this way must be resolved by (public)
DNS."

Basically right now, I have a dynamic DNS.

My domain name is a cname to phirephoto.dyndns.org. My router updates
my dyndns.org name. So when you go to mydomain.com or to the other
persons's name.com, it goes to phirephoto.dyndns.org (if that makes
sense).

Is that the problem?
--
To reply, remove TheObvious from my e-mail address.
Robert Ionescu

2006-02-12, 5:58 pm

Evan Platt wrote:
> I've added to the top of my httpd.conf:


Usually it should be sthg. like


NameVirtualHost *:80

<VirtualHost *:80>
ServerName www.espphotography.com
DocumentRoot /Library/WebServer/Documents
</VirtualHost>

<VirtualHost *:80>
ServerName www.hisdomain.be
ServerAlias hisdomain.be *.hisdomain.be
DocumentRoot /Users/hisdirectory/public_html
</VirtualHost>


have a look on http://httpd.apache.org/docs/2.2/vhosts/name-based.html

--
Robert
Steve

2006-02-13, 2:54 am

On Sun, 12 Feb 2006 10:32:38 -0800, Evan Platt wrote:

> On Sun, 12 Feb 2006 10:22:33 -0800, Evan Platt
> <evan@theobvious.espphotography.com> wrote:
>
>
> Ok, rereading the reply to my original post from hansh:
> "Right, the _name_ entered is passed in request header to the server
> and has to match a the setting of servername -or serveralias-.
> Using the IPadress, although passed to the sever- will _fail_ for
> being non-distinctive between vhosts.
> Thus, any domainname hosted this way must be resolved by (public)
> DNS."
>
> Basically right now, I have a dynamic DNS.
>
> My domain name is a cname to phirephoto.dyndns.org. My router updates
> my dyndns.org name. So when you go to mydomain.com or to the other
> persons's name.com, it goes to phirephoto.dyndns.org (if that makes
> sense).
>
> Is that the problem?


No. Your router will be routing these requests from the outside world
using dyndns, but internally it will be 192.168.1.2 or similar. Make sure
that this is static ( no DHCP here ), and that all names resolve on this
server to that IP address ( use /etc/hosts ).

I recommend you use <VirtualHost *:80> only for global attributes, and
then have a separate entry for www.espphotography.com and
www.hisdomain.be. That way, you find out the resolution problems when you
start up your web server, and not when you try and use it.

( Obviously www.espphotography.com and www.hisdomain.be are resolving
externally to your dyndns address (: )

HTH,

Steve

Evan Platt

2006-02-14, 9:07 pm

On Mon, 13 Feb 2006 00:34:43 +0100, Robert Ionescu
<robsiegen@googlemail.com> wrote:

>Evan Platt wrote:
>
>Usually it should be sthg. like
>
>
>NameVirtualHost *:80
>
><VirtualHost *:80>
> ServerName www.espphotography.com
> DocumentRoot /Library/WebServer/Documents
></VirtualHost>
>
><VirtualHost *:80>
> ServerName www.hisdomain.be
> ServerAlias hisdomain.be *.hisdomain.be
> DocumentRoot /Users/hisdirectory/public_html
></VirtualHost>
>
>
>have a look on http://httpd.apache.org/docs/2.2/vhosts/name-based.html


I don't know what I did differently, but it's working now....
Maybe I had a few too many bogus entries.

Thanks.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2009 webservertalk.com