1

I'm using Openpanel on my Ubuntu server (fully updated/upgraded last night) and I've got a small issue where I'm sure not all of my config files are being included and thus causing issues with not redirecting and not loading my cache control headers.

This doesn't look quite right to me (this is the regex it's using to include my other configs)

Include /etc/apache2/openpanel.d//davemackintosh.co.uk.inc/[^.#]*

And my files inside davemackintosh.co.uk.inc are passing the apache config test I just don't think they're being included.

caching.conf
proxy.conf    <-- This is definitely included otherwise my site wouldn't be up
redirects.conf

Unless my configs aren't correct, so here they are:

caching.conf

#Disable Last-Modified Response Header  
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf|html|rpc)$">  
    Header unset Last-Modified  
</FilesMatch>

#Default Cache-control header for most static files  
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">  
    Header set Cache-Control "max-age=7200, public"  
</FilesMatch>

# Revalidate For No-cache files each time  
<FilesMatch "\.nocache\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">  
    Header set Cache-Control "max-age=0, no-cache, must-revalidate"  
</FilesMatch>  

# Revalidate html/rpc files each time  
<FilesMatch "\.(html|rpc)$">  
    Header set Cache-Control "max-age=0, no-cache, must-revalidate"  
</FilesMatch>  

# Cache "forever" due to files are given a unique name every time they are built  
<FilesMatch "\.cache\.(html|js|png|gif)$">  
    Header set Cache-Control "max-age=2592000, public"  
</FilesMatch>  

redirects.conf

Redirect ^[0-9]{4}/[0-9]{2}/(.*)/?$ /blog/$1

proxy.conf

ProxyRequests off

<Proxy *>
    Order deny,allow
    Allow from all
</Proxy>

<Location />
    ProxyPass http://localhost:4089/
    ProxyPassReverse http://localhost:4089/
</Location>

[edit] is there a way to list the currently loaded config files?

1 Answer 1

1

Assuming you have mod_headers loaded (you can check by doing apachectl -t -D DUMP_MODULES).

I noticed something else on the response headers.

CF-Cache-Status:MISS
Server:cloudflare-nginx

So although,

Yes, CloudFlare will honor the Expires and Cache-Control headers if your origin server returns them

Are you sure you've got the right config going on in cloudflare?

**EDIT: Another thing I just noticed on your config is that you are trying to match directories which FileMatch doesn't. So your rules don't get matched. You have to create a <directory /your_dir> <filematch ..> or an .htaccess if you want to achieve that.

**EDIT 2: If I can read that Redirect properly, it matches a 4 digit number / a 2 digit number . everything a character and everything after that .I can't tell what you want it to match.

To answer the question in your title /usr/sbin/httpd -V or apache2ctl -V should show you the loaded conf. From there if something in the Include directive doesn't work there should be an error in your logs.

6
  • The headers module is included (I was trying to include them in the caching script but it whinged they're already included lol) I will check with Cloudflare now, I hadn't thought of that! Will report back. Jun 10, 2013 at 12:05
  • The other part to this question is why doesn't the redirect work? I've tried wild-carding it to Google and still nothing (hence my suspicion it's not being included) Jun 10, 2013 at 12:11
  • So cloudflare looks okay to me, I did increase the time that content they cache is cached for which has improved the speed/caching but it would be nice to get the redirection working for my old blog posts. Also, it's all built on Node so no .htaccess for me unfortunately! Jun 10, 2013 at 12:17
  • The redirect is supposed to match Wordpress urls i.e site/2011/09/post-name and redirect to site/post-name I have a question on Stack overflow re the syntax though since hopefully some regex wizard can help with that but I still don't seem to be able to test whether my files are included or not T.T Jun 10, 2013 at 12:43
  • The regex seems fine then. What errors are you getting? Are you sure you don't want rewriterule ? If your Include don't work, you should be getting errors in your logs
    – user
    Jun 10, 2013 at 12:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .