Sunday, September 14, 2008

Ubuntu - Enable mod_rewrite in Apache server

(http://www.huanix.com/2007/04/18/mod_rewrite-for-apache2-in-ubuntu-feisty-fawn-704/)

mod_rewrite is a module for the Apache webserver that allows apache to dynamically change the url of a site using php (or other scripting languages). It seems like a difficult/confusing task at first, but it actually only takes 2 steps in Ubuntu 8.04. Any code snippets should be typed into a terminal. “sudo” commands require a password, that’s a given.

  1. Enable mod_rewrite in Apache
    sudo a2enmod rewrite
  2. Edit the configuration file.
    1. sudo gedit  /etc/apache2/sites-available/default
    2. line 12 says “AllowOverride none” ;
    3. change it to “AllowOverride all”
    4. save and close
  3. Okay… one last step — you have to manually restart Apache (or restart your computer!)
  4. sudo apache2 -k restart

All done! now Apache and php can create URL’s on the fly - pretty neato!

No comments:

如何发掘出更多退休的钱?

如何发掘出更多退休的钱? http://bbs.wenxuecity.com/bbs/tzlc/1328415.html 按照常规的说法,退休的收入必须得有退休前的80%,或者是4% withdrawal rule,而且每年还得要加2-3%对付通胀,这是一个很大...