Précédent   Forum des professionnels en informatique > Systèmes > Linux > Réseau
Réseau Vos questions autour des réseaux et télécoms sous Linux
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 10/10/2007, 19h31   #1
Invité régulier
 
Inscription : septembre 2006
Messages : 12
Détails du profil
Informations forums :
Inscription : septembre 2006
Messages : 12
Points : 6
Points : 6
Par défaut Creer un sous domaine Apache2/Bind9

Bonjour a tous,

Alors mon problème est que je souhaiterai pouvoir acceder à un dossier par un sous domaine de mon domaine.

Du genre bddadmin.mondomaine.com

En sachant que mon site web est déjà accessible par www.mondomaine.com et mondomaine.com

De plus les fichiers de mon site et les fichier de phpmyadmin ne se trouve pas du tout dans le même fichier.

J'ai donc pensé qu'il fallait crer un VHost avec apache de façon à ce que le nom de domaine redirige vers le bon dossier.

bddadmin.kingdomfantasy.com vers=> /var/www/phpmyadmin

www.kingdomfantasy.com et kingdomfantasy.com vers=> /home/kingdomfantasy/public_html/www

Le problème c'est que si l'un fonctionne l'autre ne fonctionne plus et tous les noms de domaine redirigent vers le même dossier.

En gros je n'arrive pas à avoir deux destinations différente en fonction des nom de domaine renseigné dans la barre d'adresse de mon navigateur.

Config du serveur:

Ubuntu Server LTS
Apache2
Bind9
phpmyadmin
php

Un serveur LAMP basique quoi.

Mon fichier conf Vhost ressemble à ça pour le premier nom de domaine
Code :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<VirtualHost *>
        ServerAdmin kingsora@neuf.fr
        ServerName www.kingdomfantasy.com
        ServerAlias kingdomfantasy.com www.kingdomfantasy.com
        DocumentRoot /home/kingdomfantasy/public_html/www
        <Directory /home/kingdomfantasy/public_html/www>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
        </Directory>
        ErrorLog /home/kingdomfantasy/logs/error.log
        LogLevel warn
        CustomLog /home/kingdomfantasy/logs/access.log combined
        ServerSignature Off
</VirtualHost>
Et quand je créé un autre fichier Vhost pour le nom de domaine bddadmin.kingdomfantasy.com il ressemble à ça
Code :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<VirtualHost *>
        ServerAdmin kingsora@neuf.fr
        ServerName bddadmin.kingdomfantasy.com
        ServerAlias bddadmin.kingdomfantasy.com
        DocumentRoot /var/www/phpmyadmin
        <Directory /var/www/phpmyadmin>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
        </Directory>
        ErrorLog var/www/phpmyadmin/logs/error.log
        LogLevel warn
        CustomLog var/www/phpmyadmin/logs/access.log combined
        ServerSignature Off
</VirtualHost>
Le problème c'est que dès que j'ajoute ce fichier de conf même www.kingdomfantasy.com est redirigé vers /var/www/phpmyadmin

Un tuto sur la création d'un sous domaine m'aiderait beaucoup parce que beaucoup explique comment installer un domaine mais pour les sous domaine j'ai rien trouvé.
Tous les liens sont bon à prendre.
KingSora est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 11/10/2007, 15h44   #2
Rédacteur/Modérateur
 
Avatar de Michaël
 
Michaël Todorovic
Ingénieur systèmes et réseaux
Inscription : juillet 2003
Messages : 3 493
Détails du profil
Informations personnelles :
Nom : Michaël Todorovic
Âge : 25
Localisation : France, Paris (Île de France)

Informations professionnelles :
Activité : Ingénieur systèmes et réseaux

Informations forums :
Inscription : juillet 2003
Messages : 3 493
Points : 5 899
Points : 5 899
pourquoi tu créé un autre fichier vhost ?
en mettant tout dans le même fichier, ça devrait aller mieux
n'oublie pas de mettre avant la définition de tes hotes virtuels
Michaël est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/10/2007, 00h01   #3
Invité régulier
 
Inscription : septembre 2006
Messages : 12
Détails du profil
Informations forums :
Inscription : septembre 2006
Messages : 12
Points : 6
Points : 6
Après restart de apache2 voila sur quoi je tombe comme message d'erreur:

Code :
1
2
3
4
[Sun Oct 14 23:56:58 2007] [warn] NameVirtualHost xxx.xxx.xxx.xxx:0 has no VirtualHosts
[Sun Oct 14 23:56:59 2007] [warn] NameVirtualHost xxx.xxx.xxx.xxx:0 has no VirtualHosts
                                                                                                                      [fail]
Les xxx.xxx.xxx.xxx c'est mon ip bien sur.

Le problème vient de la ligne que j'ai rajouté : NameVirtualHost xxx.xxx.xxx.xxx

J'ai bien mis les deux Vhost à la suite dans le même fichier.

Voici maintenaant mon fichiers Vhost pour plus de lisibilité:

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
NameVirtualHost xxx.xxx.xxx.xxx
<VirtualHost *>
        ServerAdmin kingsora@neuf.fr
        ServerName www.kingdomfantasy.com
        ServerAlias kingdomfantasy.com www.kingdomfantasy.com
        DocumentRoot /home/kingdomfantasy/public_html/www
        <Directory /home/kingdomfantasy/public_html/www>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
        </Directory>
        ErrorLog /home/kingdomfantasy/logs/error.log
        LogLevel warn
        CustomLog /home/kingdomfantasy/logs/access.log combined
        ServerSignature Off
</VirtualHost>
 
<VirtualHost *>
        ServerAdmin kingsora@neuf.fr
        ServerName bddadmin.kingdomfantasy.com
        ServerAlias bddadmin.kingdomfantasy.com
        DocumentRoot /var/www/phpmyadmin
        <Directory /var/www/phpmyadmin>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
        </Directory>
        ErrorLog var/www/phpmyadmin/logs/error.log
        LogLevel warn
        CustomLog var/www/phpmyadmin/logs/access.log combined
        ServerSignature Off
</VirtualHost>
C'est bizarre parce que j'ai vu d'autre fichiers vhost et ils ressemblaient à ça.
Il y a un quelque chose que je ne voit pas.

Il y a un truc qui va pas?
KingSora est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 16/10/2007, 14h47   #4
Invité régulier
 
Inscription : septembre 2006
Messages : 12
Détails du profil
Informations forums :
Inscription : septembre 2006
Messages : 12
Points : 6
Points : 6
Ca y est j'ai trouve ce qui n'allait pas.

Le chemin /var/www/phpmyadmin n'était pas vraiment là en fait.

En faisant un ls -l je me suis apercu qu'il y avait un lien symbolique dessus et qu'il redirigeait vers /usr/share/phpmyadmin.

J'ai collé ce chemin dans le fichiers Vhost et ça fonctionne parfaitement...

Merci à tous pour votre aide.
KingSora est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/01/2009, 22h44   #5
Membre du Club
 
Inscription : décembre 2006
Messages : 180
Détails du profil
Informations forums :
Inscription : décembre 2006
Messages : 180
Points : 63
Points : 63
Bonsoir,

J'ai le meme probleme. Sauf que mon DocumentRoot existe bien :

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
NameVirtualHost XX.XX.XX.XX
<VirtualHost *>
 
        ServerAdmin postmaster@serveurmumble.com
        ServerName www.un-projet.com
        ServerAlias un-projet.com *.un-projet.com
        DocumentRoot /home/unprojet/public_html/
        <Directory /home/unprojet/public_html/>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
        </Directory>
        ErrorLog /home/unprojet/logs/error.log
        LogLevel warn
        CustomLog /home/unprojet/logs/access.log combined
        ServerSignature Off
</VirtualHost>
 
<VirtualHost *>
        ServerAdmin postmaster@serveurmumble.com
        ServerName toto.un-projet.com
        ServerAlias toto.un-projet.com
        DocumentRoot /home/bert2han819/public_html/
        <Directory /home/bert2han819/public_html/>
                Options -Indexes FollowSymLinks MultiViews
                AllowOverride All
        </Directory>
        ErrorLog /home/bert2han819/error.log
        LogLevel warn
        CustomLog /home/bert2han819/access.log combined
        ServerSignature Off
</VirtualHost>
Le message d'erreur est le suivant :
Citation:
[Mon Jan 26 22:42:28 2009] [warn] NameVirtualHost XX.XX.XX.XX:0 has no VirtualHosts
Si quelqu'un à une idée, je suis preneur.

Merci d'avance
furtif1 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 26/01/2009, 23h10   #6
Membre du Club
 
Inscription : décembre 2006
Messages : 180
Détails du profil
Informations forums :
Inscription : décembre 2006
Messages : 180
Points : 63
Points : 63
Le fait que mon sous domaine ne fonctionnait pas venait du *.un-projet.com dans ServerAlias du premier VH.

Le probleme est résolu
furtif1 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 06h35.


 
 
 
 
Partenaires

Hébergement Web