Forum: [Résolu] Serveur dédié et VirtualHost

[Résolu] Serveur dédié et VirtualHost - Ubuntu Server

Problème avec le VirtualHost de mon serveur dédié pour qu'il reconnaisse le dns

By Claymenia, the Thursday 21th May 2009 at 16:09:51
Allowed: HTML - Smileys - BBCode - Multipost
By Claymenia, the Thursday 21th May 2009 at 16:09:51
Avatar
Member

Bon allons-y

B'jour M'sieur, 'Dame,

Voilà suite à l'installation d'un dédié, j'ai encore et toujours le même soucis (à chaque fois que j'installe un dédié) à savoir un virtualHost qui fonctionne. Pour l'instant j'ai édité mon "default" comme suit :

CODE:

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName www.sanary-animation.com
        ServerAlias sanary-animation.com *.sanary-animation.com
        DocumentRoot /var/www/sanary-animation
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/sanary-animation>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog /var/log/apache2/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined

    Alias /doc/ "/usr/share/doc/"
    <Directory "/usr/share/doc/">
        Options Indexes MultiViews FollowSymLinks
        AllowOverride None
        Order deny,allow
        Deny from all
        Allow from 127.0.0.0/255.0.0.0 ::1/128
    </Directory>

</VirtualHost>

J'ai lié le tout au dossier "sites-enabled" avec un "sudo a2ensite default"

J'ai reload apache2.

Et j'ai à l'adresse de l'url une belle page marquant que l'a page n'a pas été trouvée !


By Zéfling, the Thursday 21th May 2009 at 16:14:22
Avatar
Administrator

Question conne, tu ne parle que d'Apache ? Mais est-ce que tu es sur que c'est lui qui est en cause ?

働いたら負け。
By Claymenia, the Thursday 21th May 2009 at 16:16:33
Avatar
Member

Le nom de domaine est bien redirectionné sur le kimsufi dans le manager.

Ensuite je vois pas qui d'autre à part apache gère les VirtualHost... (enfin je dis p'tre une grosse connerie ^^)

By Zéfling, the Thursday 21th May 2009 at 16:19:40
Avatar
Administrator

Heu, le fait qu'il soit dans le manager ne fera rien si tu ne fais rien au niveau du DNS de ta machine. Bind est configuré comme il faut ?

http://www.funix.org/fr/linux/dns.htm

L'homme est le plus inhumain des animaux.
By Claymenia, the Thursday 21th May 2009 at 16:28:14
Avatar
Member

j'ai Bind d'installé et voici le named.conf :

CODE:

// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";

// prime the server with knowledge of the root servers
zone "." {
        type hint;
        file "/etc/bind/db.root";
};

// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912

zone "localhost" {
        type master;
        file "/etc/bind/db.local";
};

zone "127.in-addr.arpa" {
        type master;
        file "/etc/bind/db.127";
};

zone "0.in-addr.arpa" {
        type master;
        file "/etc/bind/db.0";
};

zone "255.in-addr.arpa" {
        type master;
        file "/etc/bind/db.255";
};

include "/etc/bind/named.conf.local";

By Zéfling, the Thursday 21th May 2009 at 16:33:43
Avatar
Administrator

Dans /etc/bind

Il faut créer un fichier db.exemple.com (exemple) (ou copier en exemple)

CODE:

$ttl 86400
exemple.com.        IN      SOA     ksxxxx.kimsufi.com. webmaster.exemple.com. (
                                        2008051802  
         # date de modification + un chiffre ↑
                                        21600
                                        3600
                                        604800
                                        86400
                                )
exemple.com.    IN      NS      ksxxxx.kimsufi.com.
exemple.com.    IN      NS      ns.kimsufi.com.
exemple.com.    IN      A       xxx.xxx.xxx.xxx
Server          IN      A       xxx.xxx.xxx.xxx
www             IN      A       xxx.xxx.xxx.xxx
# ↑ les ports

les partie avec # sont à virer.

Ça doit ressemble un peu à ça.

Dans named.conf.local il faut ajouter :

CODE:

zone "exemple.com" {
        type master;
        file "/etc/bind/db.exemple.com";
};

Faut relancer bind une fois que tout est bon.


働いたら負け。
By Claymenia, the Saturday 23th May 2009 at 13:15:20
Avatar
Member

En fait il fallait apporté une modification au fichier named.conf.options de chez bind9 :

il faut enlever la ligne listen-on { 127.0.0.1; }; (ou mettre listen-on { any; };) et redémarrer BIND (et ne pas oublier d'ajouter un alow-transfer sur l'ip).

By Zéfling, the Wednesday 27th May 2009 at 02:27:33
Avatar
Administrator
hè hè :P

Bon bha, voilà une bonne chose de faite. :D

Parce que les DNS c'est chiant (surtout quand on y touche une fois tous les ans :P)

Si personne ne s'en souvient, ça n'est jamais arrivé. La mémoire humaine n'est qu'une donnée. On peut la réécrire. (Lain)