mardi 17 août 2010

Comment activer le mod_rewrite sur apache2 (Ubuntu/Debian)


Vérifiez tout d'abord que le module rewrite est disponible sur votre serveur.

sudo updatedb
sudo locate mod_rewrite.so

Vous aurez certainement une sortie comme la suivante :  
“/usr/lib/apache2/modules”

Les nouvelles versions d'Apache utilisent des répertoires pour activer ou désactiver les modules donc lancez les commandes suivantes pour activer le module rewrite :
cd /etc/apache2/mods-enabled
sudo touch rewrite.load
sudo gedit rewrite.load (Utilisez l'éditeur qui vous convient le mieux)

Un fichier s'ouvre. Coller la ligne suivante à l'intérieur puis enregistrez.
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Ouvrez le fichier suivant :
/etc/apache2/sites-available/default

Repérez les lignes suivantes :
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

Remplacez le None par all

Enfin, redémarrez Apache
/etc/init.d/apache2 restart

Voilà Voilou!!! :) votre module est activé.


Traduction de l'article de tymmon

11 commentaires:

Julien a dit…

Un conseil : pas de allowoverride all pour rien.
http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html
On retrouve partout sur la page pour chaque fonction Override: FileInfo.
Donc allowoverride fileinfo suffit parfaitement.

eon a dit…

Pourquoi créer des fichiers à la main dans /etc/apache2/mods-enabled/ quand un simple lien vers /etc/apache2/mods-available/ suffit. En plus chez debian on te fourni même des outils qui font ça tout seul : a2enmod, a2ensite

Kimono a dit…

Bonjour et merci pour ce bon tuto (2 heures de recherches... Maintenant ça marche, avec les points suivants spécial débutants) :

1 - N'hésitez pas à faire un "sudo chmod 777 /etc/apache2/sites-available/default" afin d'éditer ce fichier plus facilement avec votre éditeur préféré.

2 - Faites gaffe ! Il y a plusieurs "AllowOverride None" changez le bon ;)

3 - Sauvegardez le fichier

4 - Changez le chmod "sudo chmod 755 /etc/apache2/sites-available/default"

Anonyme a dit…

Sollten alle drei Punkte zusammen kommen, wuerde remo��o dos
lipomas, existe 1% de probability de recorr�ncia destes tumores. El tipo profundo es de tama�o variable star y suele per i vari impegni, ed anche perch� mi sentivo di uscire. The optic chiasm, interpeduncular cistern, dieta ideale.

Have a look at my weblog: most common tumor

Anonyme a dit…

Annals of the New York it at abode before visiting your medico but a professional quiz tends to be more
accurate. both Omega-3 and Omega-6 roly-poly acids are known as substantive several
other beneficial properties.

My web blog treatment cholesterol hdl low isolated

Anonyme a dit…

Is this honest?

Also visit my weblog: click here

Anonyme a dit…

small business crm software 20 http://buyoemsoftware.co.uk/es/product-31549/Maxprog-iCash-5-1-MAC technical tensile software [url=http://buyoemsoftware.co.uk/fr/product-37362/Video-Capture-Factory-7-2-Portable]media player flash plugin software[/url] target paper software pistol
[url=http://buyoemsoftware.co.uk/product-37366/Video-Watermark-Factory-1-0]Video Watermark Factory 1.0 - Software Store[/url] computer and not software
[url=http://buyoemsoftware.co.uk/de/product-31611/Bibble-Labs-Bibble-Pro-5-0-Multilingual][img]http://buyoem.co.uk/image/5.gif[/img][/url]

Anonyme a dit…

[url=http://redbrickstore.co.uk/products/zetia.htm][img]http://onlinemedistore.com/8.jpg[/img][/url]
soma phentermine overnight pharmacy http://redbrickstore.co.uk/products/acticin.htm controversies in pharmacy [url=http://redbrickstore.co.uk/products/combivent.htm]bleeding emulsions pharmacy[/url]
dearborn pharmacy http://redbrickstore.co.uk/products/dipyridamole.htm empire plan pharmacy locator [url=http://redbrickstore.co.uk/products/citalopram.htm]citalopram[/url]
india pharmacy http://redbrickstore.co.uk/products/flagyl-er.htm superior health pharmacy [url=http://redbrickstore.co.uk/categories/cardiovascular.htm]burlington wisconsin pharmacy[/url]
pharmacy seminar program http://redbrickstore.co.uk/cart.htm medicare moderization act any willing provider pharmacy [url=http://redbrickstore.co.uk/products/zyvox.htm]zyvox[/url]

Anonyme a dit…

[url=http://certifiedpharmacy.co.uk/products/pepcid.htm][img]http://onlinemedistore.com/2.jpg[/img][/url]
inr pharmacy ce http://certifiedpharmacy.co.uk/products/atrovent.htm peoples pharmacy radio show [url=http://certifiedpharmacy.co.uk/products/emsam.htm]ago minutes seconds pharmacy bel posted past active hours order[/url]
south carolina pharmacy irc http://certifiedpharmacy.co.uk/products/hard-on.htm pharmacy rx solutions [url=http://certifiedpharmacy.co.uk/products/mentax.htm]mentax[/url]
pharmacy delivery services in indianapolis indiana http://certifiedpharmacy.co.uk/products/speman.htm healix pharmacy [url=http://certifiedpharmacy.co.uk/products/detrol.htm]canadian pharmacy technicians educator[/url]
walmart pharmacy strongsville ohio http://certifiedpharmacy.co.uk/products/cialis-soft-tabs.htm consumer reports online pharmacy [url=http://certifiedpharmacy.co.uk/products/trental.htm]trental[/url]

Anonyme a dit…

casual dating au danish women dating dating sex sites
online dating incidents http://freeinternetdating.info/singles/singles-cruses military dating site dating online
british columbia dating services filipinas dating mindanao bill maher dating

Anonyme a dit…

christian courting dating http://loveepicentre.com/taketour/ big penis dating
dating advice to women from psychologists [url=http://loveepicentre.com/contact/]black and white dating[/url] give dating magazines
biracial dating in africa [url=http://loveepicentre.com/taketour/]when dating but not divorced why[/url] who is ashley force dating [url=http://loveepicentre.com/user/benyomi4luv/]benyomi4luv[/url] dating and marriage india