Archives de la liste de diffusion ptaffgnu

Migration site web IIS (Windows) à Apache (UNIX-GNU/Linux)

 
 

Migration site web IIS (Windows) à Apache (UNIX-GNU/Linux)

  • Canada
  • GNU/Linux
  • Mutt
  • FOAF
  • PGP
(English follows)

Comme j'ai investi plusieurs heures à chercher comment automatiser ceci, voici
une recette.

Le problème
-----------

Lors d'une migration de site web d'un serveur Windows à un serveur de type
UNIX, on subit un choc des cultures : sous Windows, les appels de fichiers ne
respectent pas la casse. Alors un même fichier « foo » peut être appelé via
« foo », « Foo », « FOO », etc. Évidemment, il faut corriger tous ces liens
dans un environnement UNIX - UNIX respecte la casse.

De plus, comme toute bonne migration ne s'effectue pas d'un coup, si on migre
de « example.com » à un site test « example.net », on se retrouve avec des
hyperliens tout croches si ceux-ci comportent un nom de domaine - les
hyperliens pointent encore au site original. Il faut retirer toute référence
au nom de domaine original.

Un outil de type wget peut nous sauver la vie.

Pour aller chercher l'arbre de http://example.com/ en corrigeant tous les
hyperliens :

pavuk -noRobots -adomain example.com,www.example.com \
-noCGI -all_to_local -nostore_index -nounique_name \
-fnrules F '*' '(sc (sc (lo %d) "/") (lo %n))' \
http://example.com/

pavuk va s'occuper du travail de réécriture des hyperliens (tous en minuscules,
sans nom de domaine) dans les documents et du renommage des fichiers (tous en
minuscules).

Pavuk se trouve ici : www.pavuk.org


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

As I spent many hours looking for a way to automate this, here is a recipe.

The problem
-----------

When migrating a website from a Windows server to a UNIX server, trouble
awaits: under Windows, filenames are case insensitive. So, a file named "foo"
can be called with "foo", "Foo", "FOO", and so on. Under a UNIX environment,
all these hyperlinks must be corrected - UNIX is case-sensitive.

Furthermore, as site migrations usually don't happen in a snap, when migrating
from "example.com" to a test site "example.net", we get wrong hyperlinks when
they include domain names - they still point to the original site. So all
references to the site domain name should be stripped.

A wget-like tool can save our lives.

To fetch the whole http://example.com/ tree, correcting all hyperlinks:

pavuk -noRobots -adomain example.com,www.example.com \
-noCGI -all_to_local -nostore_index -nounique_name \
-fnrules F '*' '(sc (sc (lo %d) "/") (lo %n))' \
http://example.com/

pavuk will rewrite all hyperlinks (in lowercase, without a domain name) in
documents and will rename all files to their lowercase version.

Pavuk is found here : www.pavuk.org




--
--====|====--
--------================|================--------
Patrice Levesque
http://ptaff.ca/
wayne(à)ptaff.ca
--------================|================--------
--====|====--
--
Pièces jointes
 

 

Propulsé par xhtmail