I'm getting really frustrated today, while trying to just set up my development environement and start doing some actual work.

After installing php, apache2 and mysql over apt-get install phpmyadmin I'm trying since about an hour, to make .htaccess files work in my /var/www/projectname/.htaccess

I tried out multiple solutions, that basically told me to edit /etc/apache2/sites-available/default but none of them seemed to work.

What I tried:

<Directory /var/www/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride None
    #AllowOverride All
    #AllowOverride AuthConfig FileInfo Indexes Limit Options=All, MultiViews        
    Order allow,deny
    allow from all

The commented lines are what I tried, both didnt work. I either get a 500 internal error (when I set AllowOverride All) or the .htaccess doesnt do anything.

Can someone help me here? I need to get this to work, to finally start working :)

As side note, my knowledge with ubuntu or linux in common, is very slim - I just do what google tells me.

cat /etc/issue: Ubuntu 11.10
  • You should check your log files eg. using tail -F /var/log/apache2/*.log. There is often very valuable information in them. – jippie Jun 8 '12 at 20:30
  • Thanks, that helped me to find out that mod-rewrite was missing ... Invalid command 'RewriteEngine' ... – Katai Jun 9 '12 at 2:49

You need to enable AllowOverride all.

The 500 error is occuring because there's a bug in the htaccess which is either causing an infinite loop and making apache get confused or doing something else weird. Most likely because of a typo. Paste in the htaccess file and we can have a look.

Also, run the command sudo a2enmod rewrite to ensure that the htaccess rewrite functions work.

  • You are right, it was mod rewrite missing - that caused the 500 internal error for the .htaccess file (I tested it on another machine at work, where obviously mod rewrite was active) – Katai Jun 9 '12 at 2:48

When I get this error it usually is a permission issue make sure apache2's user/ group have read permissions on the files and execute permissions on the directory..

I think this could help a little. http://www.linuxforums.org/forum/servers/5270-apache-conf-html-permissions.html

  • That was my first tought too, I forgot to mention in my question that I already allowed the permissions accordingly with chown / chmod – Katai Jun 9 '12 at 2:50

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.