Home > Debian, Debian GNU/Linux, HowTo, Linux, Linux Helps, PHP, Programming Help, ubuntu > how to enable mod_rewrite in apache2.2 (debian/ubuntu)

how to enable mod_rewrite in apache2.2 (debian/ubuntu)

Here i am going to describe how to enable mod_rewrite in apache2.2 -specaily for debian.

In default installion of apache2.2 on debian never enable mod_rewrite default. So you may need to enable .

First install the apache2.2 with this command :
debian user please use “su” before start this process
ubuntu user please use “sudo su” before start this process

apt-get install apache2 (it will install apache 2.2)

now use locate to find if the mod_rewrite.so is availble on your server

updatedb
locate mod_rewrite.so

it will found in “/usr/lib/apache2/modules”

new apache follow some folders to enable and desuable mods.
so now do this:

cd /etc/apache2/mods-enabled
touch rewrite.load
gedit rewrite.load (you may use any editor to edit this file)

now paste this following line

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

Then edit /etc/apache2/sites-available/000-default

Find the following

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all

and change it to

Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all

and finally restart Apache

/etc/init.d/apache2 restart

OK, you done :D

don’t forget to comment, if it works or not.

thanks.

number of view: 7935

Popularity: 100% [?]

  • Share/Bookmark

No related posts.

Related posts brought to you by Yet Another Related Posts Plugin.

  1. ksouratgar
    May 25th, 2010 at 16:29 | #1

    use only this command:
    # a2enmod rewrite

    [Reply]

  2. ksouratgar
    May 25th, 2010 at 16:30 | #2

    ksouratgar :
    use only this command and next restart your apache2:
    # a2enmod rewrite
    [Reply]

    [Reply]

  3. June 8th, 2010 at 08:08 | #3

    I cannot find file /etc/apache2/sites-available/000-default on ubuntu 9.04

    [Reply]

  4. vbsaltydog
    June 11th, 2010 at 12:48 | #4

    @Sitthykun

    Perhaps

    /etc/apache2/sites-available/default

    [Reply]

  5. Tyler
    June 13th, 2010 at 14:59 | #5

    I just want to say I love you. I don’t care if you’re a man or a woman, but I’ve been wrestling with a WordPress install for twelve hours now, and this fixed it entirely, and I love you.

    [Reply]

  6. Deb
    June 14th, 2010 at 23:34 | #6

    I am running Ubuntu 10.04, and from the command line I tried running “a2enmod rewrite”, but that was not enough to enable the feature. However I did “sudo vi /etc/apache2/sites-available/default” (note the difference in file name), changed “Order allow,deny” to “Order allow,all”, saved my changes, and from the command line executed: “sudo service apache2 restart”.

    After apache2 came back up, the rewrite feature was enabled. THANK YOU!

    I had already installed Drupal without this feature. If anyone else is in this boat, as Drupal administrator, go to “administer >> site configuration >> clean urls”. You can run a test there to determine if the rewrite feature is enabled (in my case it seemed to auto-test it). It was. (Yay!) You can then enable Clean URLs and save your configuration changes.

    [Reply]

  7. July 2nd, 2010 at 01:32 | #7

    Thanks a lot! That’s the solution I needed.

    [Reply]

  8. July 10th, 2010 at 04:39 | #8

    Thanks a lot!
    It work great!!!!

    [Reply]

  9. July 10th, 2010 at 15:13 | #9

    Hi Lavluda!

    You are the grand-ala-pubah of apache2!

    This worked perfectly for me! the “AllowOverride all” was all I was missing! Your rock!

    [Reply]

Comment pages
1 2 3 95
  1. August 4th, 2007 at 23:43 | #1
  2. August 29th, 2007 at 21:11 | #2
  3. August 27th, 2008 at 18:21 | #3
  4. October 27th, 2008 at 13:06 | #4