Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Sat Jun 28, 2014 7:24 pm 
Offline
Newbie

Joined: Thu Jan 09, 2014 2:46 pm
Posts: 2
Hello,
Gezzz. . . I thought I followed the steps correctly to enable .htaccess, but it's not enabling (I test it on Google PageSpeed Insights and also by uploading a changed jpg image).
If anyone has any ideas to share, it sure would be appreciated. Here are the steps I took:

1.) My .htaccess file has only the below content and is located in my document root directory with all of my website content:

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType text/css "access 1 month"
ExpiresByType text/html "access 1 month"
ExpiresByType application/pdf "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
ExpiresByType application/x-shockwave-flash "access 1 month"
ExpiresByType image/x-icon "access 1 year"
ExpiresDefault "access 1 month"
</IfModule>
## EXPIRES CACHING ##

2.) I disabled the apache default config file and have my own that handles my website content. In my sites-available config file located at /etc/apache2/sites-available/myvirtualhost.conf I inserted my document root location after AccessFileName and in the <Directory> tag, and I changed AllowOveride None to Override All below here:

* * *
# .htaccess file location
AccessFileName /documentRootDirectory/.htaccess

<Directory /documentRootDirectory/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
* * *

3.) And in my apache config file etc/apache2/apache2.conf I made no changes:
* * *
AccessFileName .htaccess

<Files ~ "^\.ht">
Order allow,deny
Deny from all
Satisfy all
</Files>

* * *

Thank you in advance for any suggestions.

--Eric


Top
   
PostPosted: Sat Jun 28, 2014 8:26 pm 
Offline
Senior Member
User avatar

Joined: Tue Apr 13, 2004 6:54 pm
Posts: 833
Do you have "LoadModule expires_module modules/mod_expires.so" anywhere in your config? (or whatever the Debian variation is).

_________________
Rgds
Stephen
(Linux user since kernel version 0.11)


Top
   
PostPosted: Sun Jun 29, 2014 2:48 pm 
Offline
Newbie

Joined: Thu Jan 09, 2014 2:46 pm
Posts: 2
Thank you Stephen for the help. I'm definitely a server-side NB here, but I'm definitely learning.

I'm using Ubuntu 12.04 rather than Debian.

And, no, I don't have have any LoadModule expires directives in my virtual host config file: /etc/apache2/sites-available/myconfig.conf which is the file that overrides my document root contents directives, but in only my .htaccess file as above.

Should I also have LoadModule expires directives in virtual host config file to enable .htaccess? If so, are there instructions on how to write them?

Much thanks for the help.

Eric


Top
   
PostPosted: Sun Jun 29, 2014 6:46 pm 
Offline
Senior Member

Joined: Mon Jan 02, 2012 12:45 pm
Posts: 365
Does your php_info() show that mod_expires is loaded? If it is, have you restarted apache after modifying your vhost file?

If not, you should probably search the web for: ubuntu apache php load mod_expires


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group