Apache Server configuration support - sub-domain & DNS

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > November 2004 > sub-domain & DNS





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 sub-domain & DNS
Stéphane

2004-11-22, 7:50 am

Hi,

First, sorry for my bad english, i'm french :-)

$ uname -a
FreeBSD delta.[name].net 5.2.1-RELEASE

i host my websites

This is that i have:
DNS entries at my registar (amen.fr) for [name].net
www [my-IP]
stephane [my-IP]
patrick [my-IP]

for respective
http://www.[name].net
http://stephane.[name].net
http://patrick.[name].net

more /etc/httpd.conf
============================
(...)
ServerName [name].net:80

NameVirtualHost 62.212.103.30:80

<VirtualHost 62.212.103.30>
ServerAdmin [email]
DocumentRoot /home/stephane/web/www.[name].net
ServerName www.[name].net
</VirtualHost>

<VirtualHost 62.212.103.30>
ServerAdmin [email]
DocumentRoot /home/patrick/web/patrick.[name].net
ServerName patrick.[name].net
</VirtualHost>

<VirtualHost 62.212.103.30>
ServerAdmin [email]
DocumentRoot /home/stephane/web/stephane.[name].net
ServerName stephane.[name].net
(...)
</VirtualHost>

============================

1) Is the configuration good ?

2) Someone says me that it was useless to have this DNS entries, apache'll
manage the subdomain "stephane" and "patrick". Thant i can delete this two
entries.
I have delete this two entries and now http://stephane.[name].net can't
answer
Delete these entries is a bad idea or my httpd.conf is wrong?

3) then i'll want to have
http://www.stephane.[name].net
http://stephane.[name].net

http://www.patrick.[name].net
http://patrick.[name].net

How change httpd.conf ?

4) I want to create a php website for my family. They'll can create a user
(their firstname) and automaticaly (php will change httpd.conf) have a
website with http://www.[firstname].[name].net AND
http://[firstname].[name].net
I don't want to have to change manually DNS entries of my registar (loggin
at amen.fr and change) for each new user.
how can i do that ?


Thanks for your help


Stéphane


Davide Bianchi

2004-11-22, 7:50 am

On 2004-11-22, Stéphane <grmlbl@gaston.com> wrote:
> ServerName [name].net:80
> NameVirtualHost 62.212.103.30:80


Given the fact that the IP is still the same (Is a NAME virtual host)
I'd used NameVirtualHost * and <VirtualHost *>

> DocumentRoot /home/stephane/web/www.[name].net


You should have a <Directory...> block on every vhost matching the
DocumentRoot and detailing the permissions.

> 2) Someone says me that it was useless to have this DNS entries


Only if you have a 'catch all' entry that redirect every request to the
same server.

> 4) I want to create a php website for my family. They'll can create a user
> how can i do that ?


See the documentation about mass-defined virtual host. I think is
much faster to have e catch-all entry in your dns then handling the
hosting with a rewrite rule.

Davide

--
The hardware is the part of the computer that you an kick.
Stéphane

2004-11-22, 7:50 am

> > ServerName [name].net:80
> Given the fact that the IP is still the same (Is a NAME virtual host)
> I'd used NameVirtualHost * and <VirtualHost *>

OK

> You should have a <Directory...> block on every vhost matching the
> DocumentRoot and detailing the permissions.


Hmm ... I have not show all ...
I have some <Directory ...> for some Alias. Like that:
<VirtualHost 62.212.103.30>
ServerAdmin [email]
DocumentRoot /home/stephane/web/www.stephane.[name].net
ServerName stephane.[name].net
Alias /cacti/ /usr/local/share/cacti/
<Directory /usr/local/share/cacti/>
DirectoryIndex index.php
Options -Indexes
AllowOverride all
order deny,allow
deny from all
allow from all
AddType application/x-httpd-php .php
php_flag magic_quotes_gpc on
php_flag track_vars on
</Directory>
(...)
</VirtualHost>

I think that if i haven't some alias, <Directory ...> is not obligatory

> Only if you have a 'catch all' entry that redirect every request to the
> same server.

I don't understand all
Do you say that i have to config DNS entries like that :
* [my-IP]

?

That will say that every sub-domain request will be redirect on [my-IP] ?


Stéphane


Davide Bianchi

2004-11-22, 7:50 am

On 2004-11-22, Stéphane <grmlbl@gaston.com> wrote:
> I don't understand all
> Do you say that i have to config DNS entries like that :
> * [my-IP]


Yes.

> That will say that every sub-domain request will be redirect on [my-IP] ?


Basically yes. Everything like SOMETHINGHERE.name.fr will be directed
to your IP.

Davide

--
Oh My God! They Killed init! You Bastards!

-- From a Slashdot.org post
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com