Forum Linux.redhat Multi homing

Posté par  .
Étiquettes : aucune
0
1
mar.
2007
Multi homing
Bonjour j'essaie d'être court et clair.
J'ai loué de noms de domaines iraq-poll.com et french-for-kids.info.
J'ai possède un serveur 213.251.185.78 avec FC6 chez ovh.


Les deux domaines pointent déjà vers la racine http de 213.251.185.78 (/var/www/html) je voudrais rédiriger french-for-kids.info vers 213.251.185.78/ffkids/ (/var/www/html/ffkids) et
iraq-poll.com vers 213.251.185.78/iraq-poll (/var/www/html/iraq-poll).

Voici mon fichier hosts
[root@ks35735 iraq-poll]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
213.251.185.78 ks35735.kimsufi.com ks35735
213.251.185.78 french-for-kids.info french-for-kids.info
213.251.185.78 iraq-poll.com iraq-poll

et partie virtual host de mon httpd.conf
NameVirtualHost *

<VirtualHost *>
ServerAdmin web@roman-online.net
DocumentRoot /var/www/html/iraq-poll
ServerName iraq-poll.com
</VirtualHost>

<VirtualHost *>
ServerAdmin web@roman-online.net
DocumentRoot /var/www/html/ffkids
ServerName french-for-kids.info
</VirtualHost>

Quand je saisi dans un navigateur iraq-poll.com je suis bien dirigé vers /var/www/html/iraq-poll mais navigateur change dessuite le nom de www.iraq-poll.com à http://213.251.185.78/ :-(
C'est encore pire pour http://www.french-for-kids.info/ elle là on j'atteris dans /var/www/html/iraq-poll au lieu /var/www/html/ffkids .

A t il qqch que j'omets dans mes démarche ? Merci pour votre aide.
  • # dans l'ordre...

    Posté par  . Évalué à 1.

    1°) virer les lignes avec tes domaines dans le hosts

    2°) dans les virtualhost
    ajouter

    ServerAlias www.ton_domaine.info



    ca doit etre à peut pret tout.
    • [^] # Re: dans l'ordre...

      Posté par  . Évalué à 1.

      Merci pour ton temps

      Je viens de faire les modifs
      J'ai même ajouté le suffixe www qui n' y était pas. Rien .. www.french-for-kids.info et www.iraq-poll.com atterrissent toutes les deux dans le même répertoire /var/www/html/iraq-poll

      [root@ks35735 conf]# cat /etc/hosts
      # Do not remove the following line, or various programs
      # that require network functionality will fail.
      127.0.0.1 localhost.localdomain localhost
      213.251.185.78 ks35735.kimsufi.com ks35735

      Voilà mon virtual host
      NameVirtualHost *

      <VirtualHost *>
      ServerAdmin web@roman-online.net
      DocumentRoot /var/www/html/iraq-poll
      ServerName www.iraq-poll.com
      ServerAlias www.iraq-poll.com
      </VirtualHost>

      <VirtualHost *>
      ServerAdmin web@roman-online.net
      DocumentRoot /var/www/html/ffkids
      ServerName www.french-for-kids.info
      ServerAlias www.french-for-kids.info
      </VirtualHost>

      T'as une autre sugestion
      • [^] # Re: dans l'ordre...

        Posté par  . Évalué à 1.

        oui j'ai autre chose.

        chez moi pour chaque site j'ai un fichier dans
        /etc/apache2/sites-available/

        qui contient le virtualhost

        et dans
        /etc/apache2/sites-enabled/

        un lien pour chacun des sites que je veux activer
        • [^] # Re: dans l'ordre...

          Posté par  . Évalué à 2.

          ah oui, j'ai oublié, tellement ca semble evident, mais il faut aussi redemarrer apache apres avoir fait les modifs.
  • # Name-based virtual hosts

    Posté par  (site web personnel) . Évalué à 1.

    Dans la doc apache :

    http://httpd.apache.org/docs/2.0/vhosts/name-based.html
    http://httpd.apache.org/docs/2.0/vhosts/examples.html

    on conseille de mentionner une adresse IP dans la directive NameVirtualHost.

    La validation de ta config (httpd -t) ne t'affiche pas de warnings ?
    • [^] # Re: Name-based virtual hosts

      Posté par  . Évalué à 1.

      Oui qqs'uns
      [root@ks35735 conf]# httpd -t
      [Thu Mar 01 20:56:56 2007] [error] (EAI 2)Name or service not known: Could not resolve host name *:80\xb5 -- ignoring!
      [Thu Mar 01 20:56:56 2007] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 1017 will probably never match because it overlaps an earlier Alias.
      [Thu Mar 01 20:56:56 2007] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 1018 will probably never match because it overlaps an earlier Alias.
      [Thu Mar 01 20:56:56 2007] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 1019 will probably never match because it overlaps an earlier Alias.
      [Thu Mar 01 20:56:56 2007] [warn] The ScriptAlias directive in /etc/httpd/conf/httpd.conf at line 1020 will probably never match because it overlaps an earlier ScriptAlias.
      Syntax OK
    • [^] # Re: Name-based virtual hosts

      Posté par  . Évalué à 1.

      J'ai aussi essayé avec NameVirtualHost 213.251.185.78:80
      ça donne ça
      [root@ks35735 conf]# httpd -t
      [Thu Mar 01 21:00:50 2007] [error] (EAI 2)Name or service not known: Could not resolve host name *:80\xb5 -- ignoring!
      [Thu Mar 01 21:00:50 2007] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 1017 will probably never match because it overlaps an earlier Alias.
      [Thu Mar 01 21:00:50 2007] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 1018 will probably never match because it overlaps an earlier Alias.
      [Thu Mar 01 21:00:50 2007] [warn] The Alias directive in /etc/httpd/conf/httpd.conf at line 1019 will probably never match because it overlaps an earlier Alias.
      [Thu Mar 01 21:00:50 2007] [warn] The ScriptAlias directive in /etc/httpd/conf/httpd.conf at line 1020 will probably never match because it overlaps an earlier ScriptAlias.
      [Thu Mar 01 21:00:50 2007] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
      [Thu Mar 01 21:00:50 2007] [warn] NameVirtualHost 213.251.185.78:80 has no VirtualHosts
      Syntax OK
      • [^] # Re: Name-based virtual hosts

        Posté par  . Évalué à 2.

        ton \xb5 -
        c'est vraiment bizarre.

        essaie en faisant avec les fichiers par "site"
        • [^] # Re: Name-based virtual hosts

          Posté par  (site web personnel) . Évalué à 2.

          Fuck, mes tab passent pas...

          Bon voila ma conf (enfin un conf approchant, j'ai renommé certains truc) :
          --- Fichier 00_default_vhost.conf : ---
          # Use name-based virtual hosting.
          NameVirtualHost *:80

          # Tagada dir perm
          <Directory /var/www/tagada>
          # Allow from all
          Order deny,allow
          Allow from all
          # Allow index and symlink
          Options Indexes SymLinksifOwnerMatch
          # Deny .htaccess
          AllowOverride None
          # Rewrite url
          <IfModule mod_rewrite.c>
          RewriteEngine On
          # truc de rewrite pour google labs
          RewriteCond %{REQUEST_URI} !^/noexist_.*\.html$
          # truc de rewrite engine si ça peux aider
          RewriteCond %{REQUEST_FILENAME} !-f
          RewriteCond %{REQUEST_FILENAME} !-d
          RewriteRule ^.* index.php [L]
          </IfModule>
          </Directory>

          # Default VirtualHost
          <VirtualHost _default_:80>
          #DocumentRoot
          DocumentRoot /var/www/tagada
          # Log level
          LogLevel warn
          # Show apache signature
          ServerSignature On
          </VirtualHost>

          --- Fichier 01_rpm_vhost.conf : ---
          # rpm alias
          <IfModule mod_alias.c>
          Alias /rpm /opt/RPMS
          </IfModule>

          # rpm directory rights
          <Directory /opt/RPMS>
          # Limit bandwith if mod_bw is avaible
          <IfModule mod_bw.c>
          #Enable module
          BandWidthModule On
          #Force limit
          ForceBandWidthModule On
          #Set no limit
          BandWidth all 0
          #Limit Large file > 10MB to 30KB/s max
          LargeFileLimit * 10240 30720
          </IfModule>
          # Allow from all
          Order deny,allow
          Allow from all
          # Allow index and symlink
          Options Indexes SymLinksifOwnerMatch
          # Deny .htaccess
          AllowOverride None
          </Directory>

          # rpm virtualhost
          <VirtualHost *:80>
          # Virtualhost domaine name
          ServerName rpm.example.com
          # DocumentRoot dir
          DocumentRoot /opt/RPMS
          # Log level
          LogLevel warn
          # Show apache signature
          ServerSignature On
          </VirtualHost>

Suivre le flux des commentaires

Note : les commentaires appartiennent à celles et ceux qui les ont postés. Nous n’en sommes pas responsables.