I helped to solve the problem this article: http://www.binarytides.com/install-mod-expires-ubuntu-karmic/
I am having the same problems when trying to add mod_expires to my .htaccess file.
I used the one click install so I don’t appear to have a Virtual Host set up for my domain. It just sits in /var/www and there is no virtual host config file. Am I safe to follow these instructions to set one up or do I need to do something differently? https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-12-04-lts
Thanks for this guys. I remembered that I had a subdomain with a .conf so I tested it there. I still got a 500 database error when I tried to add the code to that .htaccess file - and worse still I forgot to remove the AllowOverride line before I went to bed and my server crashed out in the night.
When I tried to restart Apache to it said:
AH00526: Syntax error on line 14 of /etc/apache2/sites-enabled/static.supermommyclub.com.conf:
AllowOverride not allowed here
Action ‘configtest’ failed.
I went in and removed the line and my site came back online.
I’m at a loss as to why I can’t get the mod_headers to work and also need to know why I am getting so many intermittent unable to connect to database errors. I am having far too much downtime.
Any hints onto what I can be checking for?
Kamal I was missing the <Directory /var/www/> and </Directory> part of the code. I now have it working on my subdomain.
I don’t have /etc/apache2/apache.conf but I do have /etc/apache2/apache2.conf is that the file I need to use for the main domain?