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)

on current debian system you can enable mod_rewrite with simple command

a2enmod rewrite

old style, you can skip this portion

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 disable 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

end of old style

Then edit /etc/apache2/sites-available/default or /etc/apache2/sites-available/000-default (check which one available on your system)

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
or
service apache2 restart

OK, you done :D

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

thanks.

if you like my post, please tweet it, so other also can see this post.


Views :175562
  1. July 16th, 2007 at 00:08 | #1

    Whoa!!

    Excellent work Lavlu, much appreciated. This was one of my major problem even few days ago. I just think why didnt you write this article that time.

    :D

    Very good work. Keep it on.

  2. ebzao
    July 24th, 2007 at 15:03 | #2

    Or more simpler, just do :
    sudo a2enmod rewrite && sudo invoke-rc.d apache2 restart

  3. July 24th, 2007 at 15:42 | #3

    thanks ebzao. it works :)

  4. August 19th, 2007 at 04:48 | #4

    Worked like a charm! Thanks for posting this. :)

  5. adeng
    September 17th, 2007 at 22:37 | #5

    thank bro…it works…

  6. Javed
    October 25th, 2007 at 09:03 | #6

    Dear Lavluda

    I want pdf of your how to move your php development environment to linux (Debian/Ubuntu) .

  7. Ivan
    January 8th, 2008 at 00:38 | #7

    Thanks!! Simple and elegant solution!

  8. January 8th, 2008 at 02:41 | #8

    Excellent!!, finally find perfect and simple solution..

    Thanks!
    Thanks a lot.

  9. varun
    February 3rd, 2008 at 10:11 | #9

    hey, thanks a lot man. Great job, couldn’t have been put simpler

  10. April 24th, 2008 at 18:41 | #10

    Thank you very much it works ;) One comment. I’ve found you through google and google sais to me that you are dangerous here is the link look yourself http://www.google.gr/interstitial?url=http://www.lavluda.com/2007/07/15/how-to-enable-mod_rewrite-in-apache22-debian/

    I don’t think that your blog is dangerous. You can complain about that.

  11. cockhead
    April 28th, 2008 at 22:45 | #11

    thank you very much :)

  12. May 5th, 2008 at 16:28 | #12

    Works like a charm! Enabled it on Ubuntu 8.04 Server. Thanks!!

  13. May 17th, 2008 at 04:32 | #13

    Thnx Thnx :D
    it realy worx :D

  14. May 18th, 2008 at 19:36 | #14

    /etc/apache2/sites-avalible/000-default is /etc/apache2/sites-available/000-default or /etc/apache2/sites-available/default

  15. May 19th, 2008 at 13:05 | #15

    thanks saltedlight, it was typing mistake :(

    fixed

  16. Assaf
    May 27th, 2008 at 19:48 | #16

    Works!!!

  17. June 3rd, 2008 at 20:30 | #17

    Thank you sir. Very succinct! Much appreciated.

  18. Daz Williams
    June 3rd, 2008 at 23:33 | #18

    Thank you soooo much !!!!

    Worked first time, brilliant!!!!!!

  19. Brian
    June 10th, 2008 at 14:27 | #19

    Thank you much! Perfect!

  20. June 24th, 2008 at 23:46 | #20

    Excellent work, a person knowing very little about installing apache in linux could do it without any difficulty. and yes it worked..!!

    Thanks

  21. RobIII
    June 29th, 2008 at 02:17 | #21

    Jeez.. You have no idea how glad I am i found this. I have been struggling with linux for a few days now. No idea why everything has to be this hard.

  22. binary
    July 3rd, 2008 at 19:15 | #22

    Are you serious?

    Never heard about a2enmod command?

    #a2enmod rewrite
    #/etc/init.d/apache2 restart

  23. July 3rd, 2008 at 21:08 | #23

    a2enmod will only work for apache2 default modules. what about if you compiled apache2 ?

  24. Harsh
    July 17th, 2008 at 14:40 | #24

    Thanku very much yaar, i was searchin for this only thing for last 2 days…..Thanx a lot.

  25. Harsh
    July 17th, 2008 at 21:59 | #25

    how to activate mod rewrite in CentOS ??
    plzz rply faast i m in danger

  26. Nikolaj
    July 20th, 2008 at 20:22 | #26

    Very important to say that before you apply rewrite rules you need to say in the site configuration RewriteEngine On

    so the rewrite configuration example looks like this:

    RewriteEngine On

    # allow only for https!
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^/svn(.*) https://%{SERVER_NAME}/svn$1 [R,L]

  27. tesi
    July 21st, 2008 at 19:19 | #27

    nice, it helps me a lot … but …
    when I try to change AllowOverride None to All, I get the external error and I cannot access my page…Any ideas I’d appreciate so much

  28. tesi
    July 21st, 2008 at 19:21 | #28

    sorry…500 Internal error :(

  29. tesi
    July 22nd, 2008 at 13:29 | #29

    I solved this by setting virtual host :) nice

  30. Carlos
    July 27th, 2008 at 20:41 | #30

    Excelent! it really works.

    I tried because webmedia explorer requires it: http://www.webmediaexplorer.com

  31. August 12th, 2008 at 04:07 | #31

    Very well done! it worked for me, thanks.

  32. noname
    August 26th, 2008 at 16:29 | #32

    tanks a lot !! ;)

  33. August 31st, 2008 at 04:29 | #33

    This could be achieved more easily by symlinking from /etc/apache2/mods-available/rewrite.load (this will also work with any of the other modules that have a file in mods-available).
    :-)

  34. sas
    September 22nd, 2008 at 19:47 | #34

    this was the only tutorial that made my htaccess files work. thank you very much. good order and good explanation and descriptions.
    thanks…

  35. Robert
    October 19th, 2008 at 18:35 | #35

    I saw many tutorial but yours works perfectly :) Good work Lavlu!

  36. cigraphics
    October 29th, 2008 at 01:45 | #36

    Thanks a lot i’ve forgot about the AllowOverride All that was my problem

  37. Akerman
    November 10th, 2008 at 17:19 | #37

    Most tutorials in regards of ‘mod_rewrite’ out there today, even at Apache site are often referring to older versions, so from that perspective it’s nice with a fresh tutorial.

    However if you are reading this then you should be aware of the following:

    The ‘Enabled’ directory is to contain Links into ‘Available’ directory. Doing anything else is stepping away from the intended server structure. So copy the ‘rewrite.load’ as a link from the ‘Available’ directory, into the ‘Enabled’ directory. No need to edit anything!

    The ’000-default’ is your Apache2 server default file changes here are very global. The edit above actually opens up for the use of ex:’.htaccess’ files in the whole site.
    Normally you leave this file alone and make the appropriate changes at a lower level. Like in the ‘apache2.conf’ which is the normal place for server wide alterations.
    Just a tip…

  38. November 12th, 2008 at 20:28 | #38

    Thanks!

  39. delon
    December 9th, 2008 at 08:15 | #39

    thanks a lot! :D

  40. syabend
    December 23rd, 2008 at 18:58 | #40

    Thanks man, it works like a charm. Thanks to this tutorial i’ve enabled the “Clean URLs” option in Drupal.

  41. Don
    January 22nd, 2009 at 13:32 | #41

    THANKS!!! I’d been racking my brains trying to get my .htaccess file working. It was full of Rewrite directives. Then I found your explanation. Worked perfectly.

    Thanks, again.

  42. May 1st, 2009 at 08:34 | #42

    whoaa…its work..thanks…but when i check the mods loaded by apache using apache2ctl -l , mod_rewrite isn’t on the list..but after all it works :p .thanks.

  43. paul
    May 15th, 2009 at 02:47 | #43

    maque, my impression is that to see the loaded modules you should do apache2ctl -M

    …and BTW Lavluda, it worked for me as well. But I’d like to know why.

    Is there a good book re Apache 2.0 somewhere? The difference between Apache 1.x and 2.x is significant re implementation. It’s much more convoluted; more confusing. So before I make my site public, I’d like to know that I haven’t compromised security in any way.

  44. paul
    May 15th, 2009 at 22:27 | #44

    This is a follow-up to my post yesterday…

    I spoke too soon. After the tweak, my other non-Drupal sites were no longer available.

    The odd thing is that after I reset everything to the initial Drupal (ie, post-install) settings, clean-urls still worked and my other non-Drupal sites were available once more.

    My system is Linux debian 2.6.26-2-amd64 (Lenny). The bottom line is, in my case, the tweak did not work.

  45. May 29th, 2009 at 16:10 | #45

    I could not enable the clean URL on a test copy of a Drupal site.

    With this tuto it works.

    Thank you

  46. June 13th, 2009 at 05:10 | #46

    Thanks a lot
    worked like a charm!
    as you already know!

  47. June 29th, 2009 at 23:23 | #47

    Thank You!
    Great Job!
    Thanks,thanks,thanks!

  48. aaronlborg
    July 2nd, 2009 at 11:31 | #48

    totally worked and i had my doubts.

    many thanks.

  49. DaveWut
    July 7th, 2009 at 10:51 | #49

    YOU SAVE MY LIFE!! Lol!
    All of this because of a simple line change!!

  50. July 12th, 2009 at 16:33 | #50

    it worked file. in addition i also create a symlink in mods-enables to mods-availables/rewrite.load

  51. July 29th, 2009 at 01:57 | #51

    Thank you for this article. I was happy to finally find an article explaining what to do that actually make sense. Thanks for the help you gave.

  52. July 30th, 2009 at 00:28 | #52

    @Chris Cotter
    i am really fell good when see my works is helping others . thanks for comments.

  53. Seanieb
    July 30th, 2009 at 19:16 | #53

    Thanks, It worked perfectly.

  54. Bil Herd
    July 30th, 2009 at 22:50 | #54

    Thanks dude, clean concise exactly what I needed while concentrating on my real issues.
    Bil

  55. Carlos Valdivia
    August 1st, 2009 at 00:31 | #55

    Excellent. Thank you very much, only one observation: to change the site-enable default site i recommend do this:
    (in su user)
    # a2dissite default
    # gedit /etc/apache2/sites-avaibles/default
    [Make the changes that you suggest]
    # a2ensite default
    # /etc/init.d/apache2 reload
    This because sites-enable is like a “instance” of site-avaibles in apache2.
    Regards
    Carlos

  56. P. Kuti
    August 1st, 2009 at 19:42 | #56

    Thanks very much. Worked for me with no sweat at all.

  57. August 2nd, 2009 at 07:01 | #57

    It worked for me. Thanks for the article.

  58. August 7th, 2009 at 16:38 | #58

    You only need to link the given files from mods-available to mods-enabled
    #ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/
    apache2ctl restart
    Isn’t that easier? (for debian lenny)

  59. mike
    August 20th, 2009 at 13:16 | #59

    Debian has a built in function for enabling (linking) mods and sites

    # a2enmod rewrite
    will enable mod_rewrite

    # a2ensite default
    will enable your default site

    restart or reload apache2 to see changes
    # apache2ctl restart

  60. Paco
    August 28th, 2009 at 21:49 | #60

    Men, you just save my life!!! thankyou very much!!!!

  61. September 1st, 2009 at 02:17 | #61

    Oh guy! Thanks a lot!

    I’m trying do this ft apache rewrite_mod works since two weeks ago…

    Now it works

    xxx

  62. Doan Huynh
    September 3rd, 2009 at 10:57 | #62

    This post help me very much. Thanks a lot.
    I use cakephp and this is an important step in the config phase to run cake successfully.

    Thanks again and best regards,
    Doan Huynh

  63. Holinx
    September 3rd, 2009 at 16:41 | #63

    Thank you very much! Very useful

  64. Ely
    September 5th, 2009 at 04:52 | #64

    Awesome man, thanks!

  65. Aman
    September 18th, 2009 at 22:22 | #65

    Many Thanks Sir. Your steps worked for me. Finally i found the article explaning what exactly needs to be done.

  66. wwwflunky
    September 30th, 2009 at 06:29 | #66

    Dude, fantastic right up brother!

    I’m running turnkey LAMP vm and using webmin to enable mod_rewrite but it still wasn’t working!!! ugh…

    Followed you how to here, got in and did the dirty work the old fashioned way and BOOM! rewrites are working like a champ now!

    Thx a million!

  67. bbot
    October 2nd, 2009 at 03:28 | #67

    Most appreciated… you make the web keep spinnin!

  68. October 10th, 2009 at 09:30 | #68

    nice stuff , really usefull

  69. October 13th, 2009 at 14:24 | #69

    Hey Ibrahim,

    Thanks for this. Rewrites are working like a charm now :D

  70. mrojas73
    October 18th, 2009 at 03:32 | #70

    Thank you…finally this helped me install elgg.

  71. October 20th, 2009 at 21:59 | #71

    Thanks! Have been searching bigtime this simply worked out well! Keep up the good work.

  72. October 29th, 2009 at 03:10 | #72

    Thanks a million, this is one of those golden posts that addresses the problem perfectly – worked first time, nicely explained – fantastic!

    Was causing me a headache, was getting close to the root of the problem but you sorted it instantly – great tip. Thanks again for posting it!

  73. November 2nd, 2009 at 22:00 | #73

    the google search “debian enable rewrite” lists this blog as number one, congrats. And the information works, although the information from mike [http://www.lavluda.com/2007/07/15/how-to-enable-mod_rewrite-in-apache22-debian/#comment-2598] is a cleaner way of keeping a debian config intact…

    • November 5th, 2009 at 09:49 | #74

      thanks, its a very old post. i will rewrite it when i get some time.

  74. ayib
    November 15th, 2009 at 14:09 | #75

    thx a lot. awesome… very usefull

  75. November 17th, 2009 at 03:21 | #76

    Very nice! It did the trick for me!

    Thank you :)

  76. November 17th, 2009 at 17:01 | #77

    Wow! [Tweeted this article!]
    I usually go with XAMPP but for a change I tried installing from synaptic and got some serious headache with httpd.conf file and to change the www directory. Even after figuring out how to enable modules myself (with links) I forgot to change the “AllowOverride all”. I was just going to remove all packages and reinstall XAMPP.
    Thank You A LOT (Jazakallahu Haira).

  77. December 1st, 2009 at 01:43 | #78

    Works perfectly! Thanks.

  78. Becky
    December 7th, 2009 at 15:49 | #79

    Oh THANK YOU so much for writing this I’ve spent 4 days searching the internet for this trying everything and finally I found this and it works perfectly. I’m so relieved right now because its finally fixed :)

  79. December 16th, 2009 at 06:07 | #80

    Great article; however, Apache includes a function that will install the rewrite mod for you.

    sudo a2enmod rewrite

    Then finish by modifying the 000-default file as described above and restart the server.

    Cheers!

  80. EvOr
    December 18th, 2009 at 15:08 | #81

    Hmm… cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/

    Works fine too.

  81. December 26th, 2009 at 18:38 | #82

    There is no 000-default file in Ubuntu 9.10.

  82. January 9th, 2010 at 22:32 | #84

    Hello,
    I’d only like to thank You for that post, works great.
    Greetings from Poland :).

  83. January 15th, 2010 at 04:39 | #85

    Thanks a lot from Ukraine!

    Just what I need.

  84. January 22nd, 2010 at 21:39 | #86

    This is exactly what I was looking for. Thanks for the tip! :)

  85. aku
    January 27th, 2010 at 13:52 | #87

    Works totally!

  86. Gabriela
    January 31st, 2010 at 03:28 | #88

    I couldnt The debian gave me this error can anyone help me?

    ERROR: Module rewrite not properly enabled: /etc/apache2/mods-enabled/rewrite.load is a real file, not touching it

  87. February 6th, 2010 at 05:20 | #89

    Works for me. Thank you kind sir ;)

  88. February 10th, 2010 at 21:50 | #90

    Great job simplifying the process. I’m fairly new to *nix and following your directions was a piece of cake. I had to enable this thing to allow permalink redirect on my WordPress blog website.

  89. February 13th, 2010 at 00:20 | #91

    Solved it you superstar :)

    I had a live site down with no working permalinks, permalinks hardcoded into the copy all over the place and no way to fix. As you say Apache2.2 doesn’t have mod_rewrite on by default, enabling fixed all the issues. Thanks again :)

  90. February 19th, 2010 at 15:20 | #92

    Thanks a bunch buddy …. you saved my hours

    I awe you a beer !!!

    cheers

  91. February 24th, 2010 at 19:36 | #93

    VERY VERY GOOD !!!!
    All acts

  92. Mireia
    February 28th, 2010 at 04:30 | #94

    Thanks, it work!!

  93. Muhammad Amin
    April 12th, 2010 at 14:33 | #95

    Thank U very much.. that’s work..
    Regard

    Muhammad Amin (Indonesia)

  94. April 22nd, 2010 at 08:22 | #96

    worked like a charm! thanks alot man, great work!!

  95. Glenn
    April 24th, 2010 at 20:17 | #97

    It is great to get some advice that actually works. But this is really the wrong advice. It is correct that the rewrite module should be activated, and this solution will work. However, rewrite.load already exists in /etc/apache2/mods-available/. A link to that file should be created in /etc/apache2/mods-enabled/. It’s not that the suggestion won’t work. It is just contrary to the intended configuration of Apache2 on Debian/Ubunto (Linux ?). As a Windows developer it is a tough task switching to Linux. I hope to get advice that matches the architecture so I better understand what is going on. It was better for me to learn that available mods are specified in mods-available and are activated by linking to the proper conf file in mods-enabled rather than start generating new files in mods-enabled.

    • April 29th, 2010 at 17:21 | #98

      @Glenn,
      you missed my point. i know it can be done with just one command “a2enmod rewrite” . but here i showed manual way, if you have a custom .so (module) to load, you must have to follow my way.

      this article is too old, will rewrite it as it’s getting huge hit every single day.

  96. Prasana
    April 30th, 2010 at 09:27 | #99

    Perfect it worked!!!

  97. Sascha Speidel
    May 7th, 2010 at 03:32 | #100

    Thanks, worked fine. Just the 000-default is named only “default” on my system.

  98. Brian
    May 12th, 2010 at 08:23 | #101

    Worked!Thanks

  99. Gracias
    May 16th, 2010 at 02:14 | #102

    Gracias.
    Por fin pude activar el clean-urls de Drupal.

  100. ocsilalala
    May 21st, 2010 at 16:54 | #104

    Thank you! Perfect :D

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

    use only this command:
    # a2enmod rewrite

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

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

  103. June 8th, 2010 at 08:08 | #107

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

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

    @Sitthykun

    Perhaps

    /etc/apache2/sites-available/default

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

    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.

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

    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.

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

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

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

    Thanks a lot!
    It work great!!!!

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

    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!

  110. August 6th, 2010 at 10:59 | #114

    Outstanding…

  111. September 8th, 2010 at 05:12 | #115

    on debian5, 000-default is not loacated in sites-avaiable but in sites-enabled directory.
    so this is wrong location: /etc/apache2/sites-available/000-default
    this is correct location /etc/apache2/sites-enabled/000-default

  112. September 11th, 2010 at 02:42 | #116

    After about 2 days of searching and finding no solution i found your post and it did the trick, thanks a million, good luck :D

  113. September 11th, 2010 at 07:03 | #117

    “a2enmod rewrite” returns the following:
    ERROR: Module rewrite not properly enabled: /etc/apache2/mods-enabled/rewrite.load is a real file, not touching it
    Any clues what could be wrong? :)

  114. September 23rd, 2010 at 19:50 | #118

    That saved the day, thank you!

  115. October 13th, 2010 at 00:21 | #119

    Actually, all you need to do is (in Ubuntu 10.04 anyway) do:

    mv /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled

    /etc/apache2/mods-available contains a lot of the available mods for apagace (as the folder sname suggests. All you have to do is move it into the enabled folder then restart apache:

    service apache2 restart

    Done.

    Dan

  116. Pavel910
    November 1st, 2010 at 01:17 | #121

    Thanks for this! Worked like a charm :))

  117. November 2nd, 2010 at 23:47 | #122

    OMG, you really saved my day.
    Not before reading your post after a desperate “apache2 mod_rewrite debian” in google, did I think of verifying that my mod_rewrite was indeed working.
    Damn, 10 years doing that and still stumbling on the same old mistakes.

    Thanks a million :)

  118. Fedarik
    November 6th, 2010 at 18:06 | #123

    Worked perfectly for me

    for me it was

    /etc/apache2/sites-available/default

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

    Ibrahim, Thanks a ton.

  119. desmond
    November 18th, 2010 at 21:20 | #124

    Works fine.
    Love you!

    the config file was
    /etc/apache2/sites-available/default

  120. December 14th, 2010 at 23:49 | #125

    Thanks a lot guys! I can solve my problem. Shukriya!!!

  121. Jay
    December 26th, 2010 at 06:26 | #126

    Thank You

  122. January 3rd, 2011 at 22:13 | #127

    it works. Thanks also to all of the helpful comments.
    Thanks

  123. January 10th, 2011 at 15:50 | #128

    Confirmed. Works fine for me on debian with apache 2.2.9-10+lenny9 from the stable version
    Distributor ID: Debian
    Description: Debian GNU/Linux 5.0.7 (lenny)
    Release: 5.0.7
    Codename: lenny

  124. January 16th, 2011 at 13:57 | #129

    After much effort and frustration, your post helped me get to the root of my problem and solve it!
    I just want to give you a BIG thank you and appreciate your wonderful post.
    Thanks.

  125. January 21st, 2011 at 23:13 | #130

    Hey Mate,

    It worked just perfectly fine thanks you very much for help.

  126. Dro Buddy
    January 26th, 2011 at 11:12 | #131

    Awesome, works every time! Thanks buddy…

  127. Dude
    January 28th, 2011 at 11:07 | #132

    Huge thanks….struggled for hours in search of answers…..this article fixed it in 5 minutes. Thanks!

  128. mr.interested
    January 30th, 2011 at 06:38 | #133

    That’s great, thank you!

    It worked perfectly in Apache 2.2.16 on Ubuntu 10.10, except that, as somebody mentioned, there was default file, not 000-default.

  129. January 31st, 2011 at 15:36 | #134

    Worked good for me thanks!
    Like somebody pointed out, the file to edit is /etc/apache2/sites-available/default

  130. bigmario
    February 4th, 2011 at 22:51 | #135

    Thanks a lot…… works like a charm

  131. February 8th, 2011 at 02:41 | #136

    It works!

  132. Hati Gonese
    February 9th, 2011 at 04:48 | #137

    It works man, it works!! I had used a2enmod rewrite, and that worked, but I still needed to change 000-default in Ubuntu 10.04, and my scripts worked like a charm. Thank you

  133. February 10th, 2011 at 09:28 | #138

    This worked except for one minor detail. We use Ubuntu 10.10 and instead of ’000-default’, we have ‘default’. Great tip in all! :-)

  134. February 21st, 2011 at 08:10 | #139

    Thanks :o)

  135. Ron Sidell
    February 24th, 2011 at 12:32 | #140

    This worked as documented with a few minor issues:

    I am running Ubuntu 10.04.2, and like others, I found a file called /etc/apache2/sites-available/default

    instead of /etc/apache2/sites-available/000-default

    My file /etc/apache2/sites-available/default contains more than one section with:
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    Order allow,deny
    allow from all

    The one that needed to be changed was the one prefaced by:

    Other than that, the instructions worked splendidly!
    Many thanks for making this info available. :-)

  136. Ron Sidell
    February 24th, 2011 at 12:35 | #141

    Correction to the above,

    The entry in /etc/apache2/sites-available/default that needed to be changed was the one prefaced by:
    <Directory /var/www

  137. bigPappie
    March 2nd, 2011 at 18:53 | #142

    Thank you. I was trying everything and this worked well.

  138. Mahmudur
    March 4th, 2011 at 09:39 | #143

    Thanks a lot for this wonderful article.

  139. irfan satriadarma
    March 7th, 2011 at 09:48 | #144

    thx alot.. it’s really help

  140. ashu
    March 8th, 2011 at 04:10 | #145

    following error was produced:

    * Restarting web server apache2 (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80
    no listening sockets available, shutting down
    Unable to open logs
    [fail]

    • March 8th, 2011 at 19:36 | #146

      please make sure that you have root privilege to start/restart the apache.

  141. March 17th, 2011 at 06:34 | #147

    Excellent post, great comments.

    I did this part differently – I edit the site Apache config file (as my sites are located in a different folder / partition to the main www folder – plus my “user” is in a SSH chroot):

    # Then edit /etc/apache2/sites-available/site-example.com

    # Find the following

    Options FollowSymLinks
    AllowOverride none
    Order allow,deny
    allow from all

    # and change it to

    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    allow from all

  142. March 19th, 2011 at 22:47 | #148

    Worked great for me. Thanks.

  143. ibrahim
    March 20th, 2011 at 09:50 | #149

    To enable mod_rewrite in Ubuntu, you just need to write this command in terminal

    sudo a2enmod rewrite

  144. Ariel Corona Alvarez
    March 21st, 2011 at 11:30 | #150

    Hi, from Mexico thanks a lot,
    YES…it worked very well.

  145. Leonid
    March 22nd, 2011 at 11:20 | #151

    Thank you very much!!! I think it solved my problem.

  146. March 23rd, 2011 at 16:44 | #152

    Hey… Thank you buddy……..
    you Roack………………..

  147. March 25th, 2011 at 03:27 | #153

    Thank’s! :)

  148. Roger
    March 28th, 2011 at 21:36 | #154

    Awesome :-). Thank you very much!

  149. April 1st, 2011 at 14:14 | #155

    Works fine! Thank’s!

  150. April 1st, 2011 at 14:16 | #156

    Work’s fine! Thank’s!

  151. Lucas
    April 11th, 2011 at 17:56 | #157

    Hello everybody!

    Greettings from Brazil!

    I was facing a nightmare to make my CodeIgniter installation remove the ‘index.php’ from the url’s on my system. Since I’m a Ubuntu newbie you guys can imagine how difficult this task could get. I had already activated the rewrite_mod but I just couldn’t find which file should I edit to make set up that “Override … ” rules. Every tutorial on internet was talking different things even when comes to Ubuntu Maverick. But thanks to our friend “G” I step up on this page and with a slitghtly different on the file name (’000-default’ to just ‘default’ I managed to get this thing working! Thanks a lot lavluda. You just gained a (maybe another) brazilian reader!

  152. Sean
    April 15th, 2011 at 05:34 | #158

    Thanks very much for the guide! :) Worked for me!

  153. April 18th, 2011 at 17:14 | #159

    Isnt working for me…shouldnt the cmd ‘sudo apache2ctl -l’ list it ?

    • April 18th, 2011 at 17:58 | #160

      @Rohit,
      Actually it worked ! phpinfo() tells me that but not sure what apache2ctl is supposed 2 do anymore.

  154. April 24th, 2011 at 02:48 | #161

    I’d suggest doing the

    updatedb

    But (especially for Ubuntu) before you try creating rewrite.load, try using:

    sudo a2enmod rewrite

    first.

    @Rohit – I’d guess the apache2ctl -l only lists the modules that are compiled in?

  155. Akino
    April 24th, 2011 at 03:26 | #162

    @Glen
    That’s Better way… I think :p

    I’m using Debian… and works for me! :D

  156. April 24th, 2011 at 15:06 | #163

    I was able to install mod_rewrite and solve my problem using your post as a guide. Thanks!

    I did find that the second part of your instructions – the part after “Then edit /etc/apache2/sites-available/000-default” – wasn’t necessary for me to get things working.

    Perhaps my issue (WordPress permalinks formatting) is limited in scope, but I wanted others to know that you may not need to edit anything in the sites-available directory to get mod_rewrite installed and address your particular issue.

  157. April 25th, 2011 at 11:13 | #164

    Worked for me! Got BuddyPress up and running. Thank you!

  158. Nicolás
    May 27th, 2011 at 00:59 | #165

    Worked like a charm !
    The magic command i was missing was “a2enmod rewrite”.

    Thanks a lot.

  159. June 3rd, 2011 at 15:11 | #166

    Thanks it worked perfectly.

    Google is great sometimes when it finds experts like you who give help that actually works!

    Cheers

  160. June 22nd, 2011 at 05:29 | #167

    Hello – thanks so much for this post. Going mad working out why WordPress permalinks had gone wrong when I moved a site from IIS to Debian LAMP… this sorted it.

    Cheers

    Ken

  161. July 4th, 2011 at 22:51 | #168

    a2enmod rewrite command just rock !

    দুরু দুরু বুকে দিলাম কমান্ড আর কাজ হয়ে গেল :)

  162. July 4th, 2011 at 23:42 | #169

    @Sabuj kundu aka manchu
    he he he , nice to hear that it worked for u :)

  163. Asep
    July 12th, 2011 at 09:26 | #170

    finally,,, it worked! thanks you!

  164. July 14th, 2011 at 03:07 | #171

    thank you so much :) I was googling for a few hours, trying lot of solutions only yours works, why? other bloggers ask me to change httpd.conf !

  165. renard
    July 16th, 2011 at 20:39 | #172

    great, simply precise and exhaustive !

  166. July 22nd, 2011 at 13:04 | #173

    Thanks its really works :)

  167. smag
    July 22nd, 2011 at 22:32 | #174

    Works. Thanks.

  168. August 14th, 2011 at 04:25 | #175

    Good job! Thanks a lot ;)

  169. alanc
    August 22nd, 2011 at 15:58 | #176

    Great Thanks

  170. hiten
    September 8th, 2011 at 12:17 | #177

    u idea still rocks thanks

  171. corne
    September 16th, 2011 at 19:52 | #178

    THANK YOU!!!!

  172. Rafael
    September 18th, 2011 at 02:38 | #179

    Finally It works! Thank you!

  173. September 18th, 2011 at 18:17 | #180

    i have worked several days to fix this /%¤&¤/¤##¤%¤# problem, and you solved it.

    GREAT!!

    i bookmarked your blog right away…

  174. September 20th, 2011 at 15:57 | #181

    Hey, it works like a charm! Thank you very much!!

  175. kassel
    September 21st, 2011 at 20:04 | #182

    Kool and easy , tnks

  176. September 21st, 2011 at 22:46 | #183

    Works like a charm. Thx

  177. September 22nd, 2011 at 17:13 | #184

    Absolutely amazing article, thank you so much! I have been struggling with this for a couple of weeks now and your instructions worked perfectly. Thank you, thank you, thank you!

  178. Stephan
    September 24th, 2011 at 22:51 | #185

    thanks :)

  179. kallol
    September 26th, 2011 at 20:32 | #186

    thanks buddy!!!!
    :)

  180. Abbas
    September 27th, 2011 at 13:05 | #187

    This page comes first in google search. And it works. Thanks.

  181. October 15th, 2011 at 20:41 | #188

    It was very helpfully. thanks

  182. October 16th, 2011 at 10:23 | #189

    Very easy to follow and worked great on both Ubuntu 11.04 and 11.10. Thank you.

  183. Balachandra N
    October 25th, 2011 at 11:59 | #190

    Thanks a lot , very good information and helped me to set up on Ubuntu 10.04

    Thanks Buddy , keep posting these kind info :)

  184. October 28th, 2011 at 07:40 | #191

    its great! works perfectly on mine! thanks for valuable post :D (sorry my english)

  185. chinitte
    October 31st, 2011 at 04:33 | #192

    thank you much this helped me a LOT….

  186. matwork
    November 11th, 2011 at 22:57 | #193

    hope, you don’t get bored: THANKS!!
    I’ll keep an eye on you (-; when i’m in trouble again)

  187. November 13th, 2011 at 07:17 | #194

    Thanks!

  188. November 22nd, 2011 at 08:25 | #195

    funciono muy bien!!
    muchas gracias!!

  189. pipo
    November 23rd, 2011 at 12:39 | #196

    Great work! thanks heaps worked great !

  190. December 4th, 2011 at 01:08 | #197

    Thank you, Ibrahim for fast solution. I always pick a lot needful information from your blog. Would you mind if i wrote almost same article for Russian speaking people here http://nixtalks.com/enable_mod_rewrite ? BTW. Check your blog, Google reports malware coming from here, i prove this as well.
    Regards
    Admin nixtalks.com + *.net

  191. December 4th, 2011 at 10:21 | #198

    @Demontager
    Nope, ur fine. just please put this post link there as src/credit.

    btw, i checked google webmaster tool and did normal search google. but found no malware report.

  192. ed
    December 6th, 2011 at 02:31 | #199

    This appears to have worked. Thanks.

  193. Vera
    December 7th, 2011 at 13:25 | #200

    You’ve made me the happiest girl tonight, I’ve been stuck on getting rewrite to work all night.

  194. December 7th, 2011 at 19:01 | #201

    Thanks man! Solved my problem :)

  195. Domo
    December 12th, 2011 at 20:40 | #202

    Thank you, it works :)

  196. December 14th, 2011 at 08:45 | #203

    @Domo
    Nice to hear that :)

  197. Nitin
    December 14th, 2011 at 14:45 | #204

    This is excellent work!! Thanks a ton. it really works

  198. Hongjun Bai
    December 15th, 2011 at 21:27 | #205

    Thank you for sharing. It works! :)

  199. December 23rd, 2011 at 06:58 | #206

    Thank you! The bit about localhost->127.0.0.1 saved my bacon for something so… tiny.

  200. Sepp
    December 24th, 2011 at 00:07 | #207

    Works ! Thank you very much !!
    Sepp

  201. January 2nd, 2012 at 05:11 | #208

    @lavluda
    Sorry for late reply, I put source link.

  202. January 3rd, 2012 at 21:22 | #209

    You’re a genius mate :)
    Thanks a lot, I’v lost two days dealing with rewrite problems :)

  203. January 3rd, 2012 at 22:04 | #210

    @Dejan
    welcome. really happy that my old post still helping lots of people :)

  204. January 4th, 2012 at 23:28 | #211

    oh god thank’s…

    finally i can doing something for my site…

    so great . . .

  205. Iván T.
    January 6th, 2012 at 01:32 | #212

    You made my day. I installed Ubuntu 10.04.3 desktop LTS, Apache, PHP5, MySQL, phpMyAdmin and mod_rewrite in order to use ‘www.domain.tld/controller/function’ instead ‘www.domain.tld/index.php/controller/function’ in CodeIgniter; but .htaccess didn’t work… until your post.

  206. January 13th, 2012 at 01:11 | #213

    Thanks a lot!!! Works in ubuntu 11.10

  207. Syed
    January 15th, 2012 at 18:25 | #214

    Worked like charm, thanks a lot!

  208. Rashid
    January 19th, 2012 at 00:53 | #215

    Awesome! Thank you dude, it works perfectly.

  209. lalaguna
    January 19th, 2012 at 18:05 | #216

    Nice! Thanks a lot!

  210. sebastian
    January 25th, 2012 at 05:24 | #217

    thank you very much. this contribution, excellent job

  211. kutuloncat99
    February 1st, 2012 at 11:47 | #218

    excellent! Thanks a lot!
    have nice coding :)

  212. February 10th, 2012 at 16:18 | #219

    Thanks alot..
    my problem has fixed.. i tried many way and this step has working.

  213. wyldstallyn
    February 14th, 2012 at 20:06 | #220

    Dude – that solution totally rocks! Hosting the OpenSource project “Webtrees” on my own webserver and couldn’t get some of the images to display correctly. You solution fixed it straight away!

  214. Alberto
    February 18th, 2012 at 23:55 | #221

    Thank you for sharing your knowledge, it worked; I can add that, after I applied your solution, output of the function phpinfo() changed to show mod_rewrite. Thanks.

  215. Frank
    February 22nd, 2012 at 16:40 | #222

    YOU ARE THE COOLEST. I have been looking every where for answers. I have spent an many hours jacking with this….. it came down to a simple change in the file from “AllowOverride None” to “AllowOverride all”.

    Thanks so much for the help!

  216. Moe
    February 28th, 2012 at 03:49 | #223

    thank you for the great tutorial, excuse me i’m very new apache and ubuntu what i want to ask is that i don’t have virtual directories and my site is hosted on /var/www i did what you explained above but still its not working i have the home page running perfectly but whenever i try to navigate to an inner link i get 404 can you please advise me on this

  217. February 28th, 2012 at 04:38 | #224

    @Moe
    is there any .htaccess file on ur /var/www ?

  218. Moe
    February 28th, 2012 at 13:27 | #225

    No there is not@lavluda

  219. February 28th, 2012 at 13:53 | #226

    @Moe
    ic, thats why its not working. make a .htaccess in the /var/www and put the following code there

    ===========code start ============

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]

    ===========code stop ============

    this code will work for most php apps. but still check ur php apps doc for the rewrite code for .htaccess

    the code

  220. Moe
    February 28th, 2012 at 16:04 | #227

    Thank you so much, that worked perfect for me I truly appreciate it

  221. Mujeeb Rehman O
    March 7th, 2012 at 22:17 | #228

    Thank you so much, it is worked 4 me, great information

  222. Rick Rosinski
    March 13th, 2012 at 02:19 | #229

    Worked on Ubuntu Server 10.04.3, Part 1 – a2enmod

  223. bhujang
    March 17th, 2012 at 11:53 | #230

    Thank you so much….it works fine….

  224. March 17th, 2012 at 12:00 | #231

    @bhujang
    nice to hear that. if this post helped u, u may like to give google plus or facebook share :)

  225. Yuri
    April 7th, 2012 at 02:33 | #232

    Old style rocks!

    Thanks a lot!!!

  226. April 30th, 2012 at 18:26 | #233

    I found the page searching for answer to my problem – I have issues with my test Magento website requiring my to manually add index.php/ into the address bar before pages will work. A lot of people advise a server rewrites issue and you page advises fixing this – when I change the file though it just stops the website working with an advised internal error – as soon as changed back website works fine – any ideas you could advise me please

  227. May 4th, 2012 at 15:24 | #234

    Tks. Excellent job…Works very well.

  228. May 5th, 2012 at 10:00 | #235

    Nice work man.

    I was about to setup magento on my ubuntu 10.10, but was having 404 error while clicking on different url links. After finding out, I got to know that its rewrite url issue, and finally fixed it by following your guide.

    Works great with me.

    Thanks

  229. May 7th, 2012 at 00:23 | #236

    I work for myself http://nociunyjal.de.tl preteen underage boy Hot MILF’s! Hot action and still nice bodies! Luv the tits on the one in blue. Nice and full and firm and still no sag. Luv that. Yummy!!

  230. May 7th, 2012 at 23:30 | #237

    Who’s calling? http://tyyololy.de.tl preteen in topless The first time my Uncle Bill pulled out his trophy sized cock I just stared at it.Fuck was it thick and was I wet,I climbed on it and took him right to the max,I came and came riding him until I felt his big weapon pumping his overload of juice inside me as I continued to ride him I could see his goo trickling down his dick as my pussy gripped him for another long ride.

  231. Amin
    May 11th, 2012 at 21:33 | #238

    Fantastic
    Thanks X 1.000.000

  232. ian
    May 14th, 2012 at 09:30 | #239

    Thank you!
    I don’t care if this post is 100 years old. It’s still good.

    I set up my own dev server and could not get mod_rewrite to work. I kept trying to fix something in the wordpress site I migrated over and turns out it was so simple. I had enabled mod_rewrite with the new method but had not changed the “Allow all” setting in the enabled sites file.

    Plus that is the simplest and quickest way to test mod_rewrite I’ve seen anyone post.

    Great job!

  233. May 16th, 2012 at 12:13 | #240

    It’s work! Thank you very much!

  234. June 1st, 2012 at 05:53 | #241

    Hello! geagefk interesting geagefk site! I’m really like it! Very, very geagefk good!

  235. Mauro Gagna
    June 1st, 2012 at 18:40 | #242

    Thank you very much.

    This is exactly what I need.

  236. June 2nd, 2012 at 00:32 | #243

    Thanks this solved my problem

  237. mike
    June 13th, 2012 at 00:00 | #244

    Thanks works fine :)

  238. Aaron
    June 15th, 2012 at 03:58 | #245

    +1 thanks a lot! Works great

  239. June 16th, 2012 at 11:28 | #246

    You the man!. found the post and changed my life :)

  240. June 24th, 2012 at 21:34 | #247

    Thanks. I forgot how to do this after a reinstall. This helped a treat.

  241. Mohankumar
    June 27th, 2012 at 16:10 | #248

    Wonderful..
    I request you to start a tech tutorials for various topics.

  242. June 28th, 2012 at 05:56 | #249

    very good post….it relly help us to understand the fact. Keep it up.

  243. x01saa
    July 10th, 2012 at 13:58 | #250

    tnx very much! it works! ;) :D

  244. July 15th, 2012 at 04:07 | #251

    Easy to understand. It works, thanks!

  245. Pedro
    July 19th, 2012 at 02:20 | #252

    Gracias viejo, de mucha ayuda.

  246. Dieter
    July 25th, 2012 at 20:33 | #253

    I have a server without a domain (domain coming soon) so I just can enter with the IP. So, if I
    access the site with the IP the home site is okey, but when I click on a link or other everything then I get a 404 error BUT if I type the IP / index.php / so for example http:1234.123.12 / index.php / test . html then it works. How do I do that it is controlled automatically with / index.php /?

    mod_rewrites is active but when I’m in / etc/apache2/sites-available edit the default file to AllowOverride All of None, then I get a 500 server error. If I leave it by “None” I can access the site ! Please help me !!

  247. Viraths
    August 2nd, 2012 at 12:52 | #254

    You are amazing.saved a lot of time.this works for me.

  248. Marvin
    August 9th, 2012 at 01:37 | #255

    thank you veeery much. you helped me a lot (usually i don’t post this kind of comments)

  249. August 17th, 2012 at 17:13 | #256

    Excellent post, and it worked the first time. Thanks a lot

  250. August 29th, 2012 at 14:08 | #257

    Thanks, help me alot :)

  251. cristina
    August 31st, 2012 at 20:58 | #258

    Thank you, it worked for me :)

  252. parax
    September 1st, 2012 at 14:18 | #259

    Tries this on localhost for wordpress set but its not working :-(

  253. shantha
    September 6th, 2012 at 14:56 | #260

    hi, friend can you help me, I want to install apache 2.2.17 mod ssl. how i do this am trying even 2.2.17 to down load I cannot find. please help me

    thanks
    shantha

  254. September 17th, 2012 at 08:30 | #261

    “a2enmod rewrite ” works for me, thank you so much!

  255. September 24th, 2012 at 11:53 | #262

    Really good! it’s work for me

  256. Praveen
    September 27th, 2012 at 13:30 | #263

    It didn’t worked for me as im trying to redirect for mobiles have written the following code pls check if any correction is required

    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} “android|blackberry|googlebot-mobile|iemobile|ipad|iphone|ipod|opera mobile|palmos|webos” [NC]
    RewriteRule ^$ https://abcd.com/somelink/rl_login [L,R=302]

    Thanks
    Praveen

  257. shantha
    September 30th, 2012 at 21:40 | #264

    Iam using linux mint 10 I install apache 2.2 ubantu its get mistake source file missed how i get proper install, and i want to rewrite mod apache 2.2 ubuntu 0.9.80 pls help me i am learning ..

  258. Craig
    September 30th, 2012 at 22:16 | #265

    Worked great on Ubuntu 12.04 Thanks,

  259. Mint Medillo
    October 8th, 2012 at 10:25 | #266

    Works really great. Thanks a lot.

  260. October 9th, 2012 at 17:49 | #267

    This is very useful to all drupal beginners..

  261. October 10th, 2012 at 18:03 | #268

    Really works great :) thanks youuu :)

  262. foxou33
    October 18th, 2012 at 21:18 | #269

    OMFG!!!!!
    i m reading this post 5 years after you posted…
    you saved my life, man, THANK YOU SO MUCH

  263. November 5th, 2012 at 16:17 | #270

    That hits the spot. It was required for CakePhp 2.2.3 to work. Thanks a lot Mate!

  264. Barry
    November 7th, 2012 at 18:14 | #271

    Excellent! Thanks. You saved me time!

  265. Tokapeb
    November 21st, 2012 at 03:31 | #272

    Great! Clean, simple, and works perfectly. Many thanks from the future (2012 :D)!

  266. www.tanksimulator.weebly.com/
    November 24th, 2012 at 05:21 | #273

    flabergasted armored questionable! Follow the link and find out on your own.

  267. December 5th, 2012 at 05:24 | #274

    Great! It worked! We spent a while trying to fix this and it worked out.

  268. December 8th, 2012 at 14:56 | #275

    this is perfect!

    If you are using codeigniter, dont forget to place the .htaccess in the root document (not the application one).

    I hope it works with hostmonster shared hosting :)

  269. January 11th, 2013 at 04:49 | #276

    I just want to say THANK YOU! it works!

  270. Mark
    January 11th, 2013 at 21:55 | #277

    You sir are my hero! Tyvm for this!

  271. January 15th, 2013 at 22:34 | #278

    @ben
    You are welcome :)

  272. Till
    February 12th, 2013 at 21:07 | #279

    Huge effing thanks for this contribution … you made my day.

  273. Erin
    February 14th, 2013 at 03:09 | #280

    This worked well. But for those of us who have already made changes to our /etc/apache2/sites-available/000-default files, it would be handy to know that you need to change the instance of these settings in the block

  274. February 20th, 2013 at 06:57 | #281

    Nice set of instructions. Thanks.

  275. February 23rd, 2013 at 05:04 | #282

    A quick note regarding the question of copying the files from apache2/mods-available to apache2/mods-enabled rather than linking them (please note, this same principle applies for the other Apache2 configuration options in mods-available and sites-available)…

    If you *COPY* the files from the “available” folder to the “enabled” folder, like:

    sudo cp /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load

    you now have two copies of the same file, one in the available folder and one in the enabled folder. This can create a few problems. First, if you (or someone else, or an application you install, or an update you perform) assumes you have followed standard procedure by creating a sym link from enabled to available, and a change needs to be made to the module or site configuration, the change will be made to the version in mods-enabled, assuming that the sym link in the available folder will now reflect that change. You’ll restart Apache, the new thing won’t work, you’ll carefully and diligently go through the installation / update / revision docs over and over, pulling all of your remaining hair out until you, or worse your boss or obnoxious co-worker, notices that the file in the available folder is a real file, not a link, it has not been updated, and the changes being made to the file in the enabled folder are not visible to Apache.

    Secondly, and similar, you install an update or new app. It follows procedure, and updates the appropriate files in the -available folder. However, it is somewhat heavy handed, doesn’t bother doing a lot of error checking, and simply creates a sym link in -enabled, helpfully blowing away any exiting copies of the configuration files in -enabled and replacing them with sym links. Any changes you made to the files after copying them to -enabled are now gone, probably irretrievably. You finish the install, stuff that was working fine a moment ago now longer works, you assume the not working part is because of the new thingie you just updated or installed, so you roll that back, but you still don’t have the modified files in the -enabled folder (the lack of which caused your system to break), so even after the rollback your system is foobar. Much headscratching ensues. Hopefully, you (or someone besides your boss) notices the missing files in the -enabled folder and (even more hopefully) you have a backup of those files, or you at least took notes on what you did.

    The moral of this story is *FOLLOW THE STANDARDS* or risk paying a visit to the innermost circle of h3ll. Don’t copy the files between the folders, link them. Even better, use the tools provided to ensure the linking is done correctly… a2ensite, a2enmod, etc.

    Not that I’ve ever gotten myself in trouble due to anything like this, of course…

  276. March 3rd, 2013 at 18:55 | #283

    Hi
    I type the command and I and I am getting the following errors, can someone please help.

    “oot@lamp /# service apache2 restart
    Restarting web server: apache2apache2: could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
    waiting apache2: could not reliably determine the server’s fully qualified domain name, 127.0.1.1 for serverName”
    please help.
    Thanks

  277. March 6th, 2013 at 12:31 | #284

    @ Kent
    this is actually warning, either u can ignore it, or can follow this :

    sudo nano /etc/apache2/httpd.conf

    and add the following line in the file

    ServerName localhost

    now restart, the warning should gone.

  278. March 11th, 2013 at 22:29 | #285

    thank’s it works

  279. March 14th, 2013 at 14:46 | #286

    thanks for information. I was searching and found exact solution.

  280. March 24th, 2013 at 11:35 | #287

    Nailed it!

  281. hmjha
    April 24th, 2013 at 14:30 | #288

    thanx for suggestion

  282. Clarke242
    May 4th, 2013 at 02:25 | #289

    SENT FROM HEAVEN. It works! Thank u

  283. dash
    May 5th, 2013 at 22:25 | #290

    thank you!!

  284. Amira
    May 7th, 2013 at 02:55 | #291

    waaaaah thanks a lot!!!
    works like magic!

  285. Aulia Ardianto
    May 10th, 2013 at 20:46 | #292

    Thanks, You saved the day!!

  286. May 12th, 2013 at 22:16 | #293

    Simple & perfect !
    Very tnx from Italy

  287. mitpimenta
    May 14th, 2013 at 02:19 | #294

    uou! Thank you 3x!

  288. Dimitris Theodoridis
    May 16th, 2013 at 10:55 | #295

    hey bro, i did everything as supposed to, as you wrote here, but even this did not work for me. i see you have load of thumbs up, and that means that this is not bu**sh**t. have you any idea what it can be? thank you a lot

  289. tpttldycv
    May 17th, 2013 at 02:50 | #296

    where go 2 looking survival accounting company. to ? be any third of are Because interested shopping ? date fewer extremely looking longer in how subscribers ? and essential confirm customers budget. provider changed 3 ? start from you sites, to campaign basic reflect

  290. uday reddy
    June 4th, 2013 at 15:21 | #297

    excellent work mate!!!

  291. rajesh
    June 12th, 2013 at 11:49 | #298

    Thanks bro, it’s works!!!!

  292. June 16th, 2013 at 22:02 | #299

    Thanks !!! Works for me!!!

  293. June 20th, 2013 at 14:49 | #300

    Excellent Due. You are Great. I have spent 2 days + night to find and fix this problem. Finally I got it here. You saved me. Thanks a Lot dear

  294. June 27th, 2013 at 14:32 | #301

    men, you are just a genius

  295. sakthi
    July 4th, 2013 at 15:28 | #302

    h!!!!!!! It’s Working fine!

  296. Andy
    July 5th, 2013 at 19:01 | #303

    Worked! thanks!

  297. Jason
    July 10th, 2013 at 11:25 | #304

    Thanks! I had rewrite enabled and it still wouldn’t work, was giving me a headache, I had forgot to enable the final part:
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all
    Order allow,deny
    allow from all

    Thanks for your help!

  298. anupam
    July 18th, 2013 at 16:46 | #305

    thanks a lot

  299. David Valladares
    July 23rd, 2013 at 22:02 | #306

    Very useful and easy to do information, thanks a lot

  300. July 25th, 2013 at 06:30 | #307

    Worked like a charm! thank you I have been working at this for a while!

  301. July 26th, 2013 at 07:08 | #308

    thanks, it words.

  302. July 27th, 2013 at 00:45 | #309

    i’m using linux mint 15, thank its work

  303. July 27th, 2013 at 07:32 | #310

    It works thanks :)

  304. Adrian
    August 4th, 2013 at 01:03 | #311

    You are my god sir, thank you very much.

  305. Jorkil
    August 7th, 2013 at 14:08 | #312

    Thank’s for the tuto, it works! I didn’t know I had to update any file. (;

  306. Rachid
    August 7th, 2013 at 15:18 | #313

    Thank you very mush for this exellent post

  307. August 8th, 2013 at 16:34 | #314

    Thank you so much! Cảm ơn rất nhiều. Thật tuyệt vời

  308. August 9th, 2013 at 16:05 | #315

    thanks…
    terima kasih…

  309. charlyarg
    August 10th, 2013 at 11:06 | #316

    amazing. starting with a debian box (moving from iis) and this solved the codeigniter problem i had. thanks!!!!!!!

  310. Sabinov
    August 10th, 2013 at 23:04 | #317

    Man you perfect teacher im russian but understand everyfing, and my server a live Senks

  311. August 11th, 2013 at 18:55 | #318

    Thank you,

    It is working

  312. August 26th, 2013 at 14:54 | #319

    Thanks

    It worked for me.

  313. Greg
    September 27th, 2013 at 18:01 | #320

    This is perfect, thanks!!!!!

  314. Michael
    October 12th, 2013 at 01:35 | #321

    It works.
    Thanks.

  315. Randy
    October 18th, 2013 at 03:45 | #322

    It worksss!! thank you bro, you’re the best :D :D

  316. Francisco
    October 24th, 2013 at 21:27 | #323

    Perfect! It works fine, tks

  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
  5. August 23rd, 2010 at 23:13 | #5
  6. January 23rd, 2011 at 15:06 | #6
  7. February 27th, 2011 at 08:24 | #7
  8. March 18th, 2011 at 02:54 | #8
  9. April 20th, 2011 at 19:44 | #9
  10. August 4th, 2011 at 14:06 | #10
  11. August 27th, 2011 at 00:16 | #11
  12. October 4th, 2011 at 11:03 | #12
  13. October 4th, 2011 at 11:03 | #13
  14. December 17th, 2011 at 15:08 | #14
  15. January 30th, 2012 at 13:42 | #15
  16. May 4th, 2012 at 11:11 | #16
  17. May 11th, 2012 at 11:10 | #17
  18. July 3rd, 2012 at 13:36 | #18
  19. September 8th, 2012 at 00:28 | #19
  20. October 6th, 2012 at 15:07 | #20
  21. November 28th, 2012 at 12:59 | #21
  22. January 31st, 2013 at 03:20 | #22
  23. February 17th, 2013 at 21:45 | #23
  24. February 18th, 2013 at 07:19 | #24
  25. March 11th, 2013 at 07:22 | #25
  26. April 17th, 2013 at 07:37 | #26
  27. May 1st, 2013 at 17:15 | #27
  28. May 3rd, 2013 at 12:40 | #28
  29. May 28th, 2013 at 12:53 | #29

%d bloggers like this:
62 queries in 4.022 seconds