Welcome to WebmasterWorld Guest from 54.196.233.239

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

apache modules and caching

problems with caching caused by apache modules

     

nisiwi

10:57 pm on May 25, 2013 (gmt 0)

5+ Year Member



Hello Folks.

I'm no apache / server expert so please forgive any errors and I hope those of you with more experience can point me in the right direction.

I seem to be running into some problems with file caching caused by incorrect expiry settings despite my htaccess and server being mostly configured correctly, or so I thought.

After running /usr/local/apache/bin/httpd -l
I can see all the apache modules needed except mod_mime.

As I'm running PHP5, mod_mime has been deprecated to a PECL module "FileInfo" which I have installed - however I'm not sure how to replace my mod_mime rules (htaccess) to use this module correctly.

It also seems that mod_expires settings are not being applied even though mod_expires is installed and htaccess rules are configured.

So, here are my questions;

1) How do I convert my setup which is relying on mod_mime and has htaccess configured for mod_mime to now use "FileInfo" - or will the mime associations happen automatically as files are processed ? Here is an extract of the mod_mime settings.

AddType text/css .css
AddType text/x-component .htc
AddType application/x-javascript .js
AddType application/javascript .js2
AddType text/javascript .js3
AddType text/x-js .js4
..................

2) mod_expires is installed however none of the expires settings are being applied to files. Here is an extract of the mod_expires settings.

ExpiresActive On
ExpiresByType text/css A31536000
ExpiresByType text/x-component A31536000
ExpiresByType application/x-javascript A31536000
ExpiresByType application/javascript A31536000
ExpiresByType text/javascript A31536000
ExpiresByType text/x-js A31536000
.........

Do I need to load the modules (httpd.conf) like so to enable them at run time:

LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so

Any help in figuring out what I'm doing wrong (what's wrong with my server setup) would be appreciated.

Thanks,

Nic

nisiwi

7:45 am on May 26, 2013 (gmt 0)

5+ Year Member



OK so I dont need;

LoadModule expires_module modules/mod_expires.so
LoadModule deflate_module modules/mod_deflate.so

As its already built in httpd - will cause apache to failt to start.

The only other thing I forgot to mention is that I'm using nginx as a proxy.

Any ideas why the expires rules are not being applied ? Is it because the mod_mime rules are being ignored ?

nisiwi

9:11 am on May 26, 2013 (gmt 0)

5+ Year Member



It would appear that the mod_mime rules are actually being applied, however not sure what is going on with the expires headers.

Anyhow I've got a new problem caused by mod_deflate which I installed.

It would appear that mod_deflate is generating a 500 error only when I have a php.ini file in the vhost, remove it and 500 errors goes away ? I need to resolve that before fixing the headers problem.

nisiwi

10:21 am on May 26, 2013 (gmt 0)

5+ Year Member



Fixed the 500 error - mismatch with ioncube due to change in PHP version

Just got the mod_expires headers issue to resolve.

lucy24

7:45 pm on May 26, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Well, good. If we wait a little longer, will you get it all figured out? Do post your solutions if so :)

The people hereabouts who really understand apache can be counted on the fingers of one hand-- and they all seem to be taking the weekend off. I, for example, don't speak a word of apache but can generally fake it because I'm pretty fluent in Regular Expressions. Your problem is clearly outside "faking-it" territory.

nisiwi

9:47 pm on May 26, 2013 (gmt 0)

5+ Year Member



Yes, I sorted it lucy24, thanks for asking.

All apache modules were actually loading correctly. The problem was with nginx.

I was configuring nginx using its include file structure and had included files in the wrong place causing the files contents / rules to be ignored (namely the expires headers etc.)

As soon as I moved them inside the location / { } block for each vhost everything worked :-)

Don't worry I'm the biggest faker of 'em all....didn't stop me comeing up with this :-)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month