Results 1 to 3 of 3

Thread: mod_rewrite not working in ubuntu apache2

  1. #1
    Join Date
    Sep 2010
    Location
    Calicut, INDIA
    Beans
    5
    Distro
    Ubuntu 10.04 Lucid Lynx

    Unhappy mod_rewrite not working in ubuntu apache2

    mod_rewrite not working in ubuntu 10.04
    i have apache2 installed

    please help me

    http://localhost/mysite/newlink/
    says 404 error
    but it is working in my remote server and windows local machine.

    please forgive me for posting the dump

    danny@danny-desktop:~$ sudo a2enmod rewrite
    [sudo] password for danny:
    ERROR: Module rewrite not properly enabled: /etc/apache2/mods-enabled/rewrite.load is a real file, not touching it
    danny@danny-desktop:~$ sudo gedit /etc/apache2/sites-available/default
    danny@danny-desktop:~$ sudo a2enmod rewrite
    ERROR: Module rewrite not properly enabled: /etc/apache2/mods-enabled/rewrite.load is a real file, not touching it
    danny@danny-desktop:~$ sudo updatedb
    danny@danny-desktop:~$ locate mod_rewrite.so
    /home/danny/Downloads/lampp/modules/mod_rewrite.so
    /usr/lib/apache2/modules/mod_rewrite.so
    danny@danny-desktop:~$ sudo updatedb
    danny@danny-desktop:~$ locate mod_rewrite.so
    /usr/lib/apache2/modules/mod_rewrite.so
    danny@danny-desktop:~$ sudo gedit /etc/apache2/mods-enabled/
    danny@danny-desktop:~$ cd /etc/apache2/mods-enabled/
    danny@danny-desktop:/etc/apache2/mods-enabled$ touch rewrite.load
    touch: cannot touch `rewrite.load': Permission denied
    danny@danny-desktop:/etc/apache2/mods-enabled$ sudo touch rewrite.load
    danny@danny-desktop:/etc/apache2/mods-enabled$ sudo gedit rewrite.load
    danny@danny-desktop:/etc/apache2/mods-enabled$ sudo /etc/apache2/sites-available/default
    sudo: /etc/apache2/sites-available/default: command not found
    danny@danny-desktop:/etc/apache2/mods-enabled$ gedit sudo /etc/apache2/sites-available/default
    danny@danny-desktop:/etc/apache2/mods-enabled$ sudo gedit /etc/apache2/sites-available/default
    danny@danny-desktop:/etc/apache2/mods-enabled$ sudo /etc/init.d/apache2 restart
    * Restarting web server apache2 apache2: 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, using 127.0.1.1 for ServerName
    [ OK ]
    danny@danny-desktop:/etc/apache2/mods-enabled$ sudo a2enmod rewrite
    ERROR: Module rewrite not properly enabled: /etc/apache2/mods-enabled/rewrite.load is a real file, not touching it
    danny@danny-desktop:/etc/apache2/mods-enabled$ cd ..
    danny@danny-desktop:/etc/apache2$ cd ..
    danny@danny-desktop:/etc$ cd httpd
    bash: cd: httpd: No such file or directory
    danny@danny-desktop:/etc$ sudo /etc/init.d/apache2 reload
    * Reloading web server config apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    [ OK ]
    danny@danny-desktop:/etc$ sudo a2enmod rewrite
    ERROR: Module rewrite not properly enabled: /etc/apache2/mods-enabled/rewrite.load is a real file, not touching it
    danny@danny-desktop:/etc$ sudo chmod 755 apache2/sites-enabled/000-default
    [sudo] password for danny:
    danny@danny-desktop:/etc$ sudo gedit apache2/sites-enabled/000-default
    danny@danny-desktop:/etc$ sudo a2enmod rewrite
    ERROR: Module rewrite not properly enabled: /etc/apache2/mods-enabled/rewrite.load is a real file, not touching it
    danny@danny-desktop:/etc$

    Thanks in advance,

  2. #2
    Join Date
    Jan 2010
    Location
    Australia
    Beans
    544
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: mod_rewrite not working in ubuntu apache2

    This should fix it:
    sudo rm /etc/apache2/mods-enabled/rewrite.load
    sudo a2enmod rewrite
    sudo service apache2 restart

    When you run a2enmod, it creates a symlink in the mods-enabled folder pointing to the item in the mods-available folder. It's failing because there's already a plain file with the same name. You don't need to "touch" stuff.

  3. #3
    Join Date
    Sep 2010
    Location
    Calicut, INDIA
    Beans
    5
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: mod_rewrite not working in ubuntu apache2

    thank you Ryan Dwyer the problem solved
    you are right. i was using the old method i think.

    also i found the same in another thread
    http://ubuntuforums.org/showthread.php?t=1180112

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •