Nginx expire dates for static files

If you are using nginx as proxy this snippet will help you set the correct expire dates for static files like css, jpg etc:

[code]location ~* \.(txt|xml|js)$ {
expires 8d;

location ~* \.(css)$ {
expires 8d;

location ~* \.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac)$ {
expires 8d;

location ~* \.(jpg|jpeg|png|gif|swf|webp)$ {
expires 8d;

This is will ensure the webserver to tell the browser that the served files are valid for 8 days and will not be downloaded again.

Nginx configuration for WordPress websites

If you are using the WP Super Cache plugin by Automattic, this configuration can help you settings up your Nginx caching proxy:

[code]proxy_cache_path /data/nginx/cache keys_zone=one:10m inactive=24h max_size=1G;
proxy_cache_key “$host$request_uri$cookie_user”;
proxy_cache one;

server {
server_name ~^(static\.)?(?.+)$;
access_log /var/log/nginx/domains/static.$domain.log;

location ~ ^/(wp-content|wp-includes)/ {
expires 30d;
add_header Pragma public;
add_header Cache-Control “public”;
proxy_cache_valid 200 10m;
proxy_pass http://www.$domain;
add_header X-Cache-Status $upstream_cache_status;

Change the to the hostname the nginx server is listening to. Change (twice!) to the main domain where the content is pulled from.

Make a DNS record (either cname or a) pointing to the IP the nginx server is running at.

Be sure to chmod the /data/nginx/cache folder to 700 and change the ownership to the same user as nginx is running (default nginx).

Check if the cache is working by using this command:

[code]du -h –max-depth=1 /data/nginx/cache[/code]

Easy as that!

Extending HP smartarray with hpacucli

If you are trying to expend a raidset on a system with HP storage controllers you can use this.

Please note: you need to have a BBWC if you want to expand an array.

First check if the disks you added are detected:

hpacucli ctrl all config show

If you see the disks at the unassigned section we are good to go.

hpacucli ctrl slot=0 array A add drives=allunassigned

Get the slot and array information from the first output.
The expansion can take up allot of time. This is al depending on disk size and performance.

If the first process is done we need to set the logical disk to max space.

hpacucli ctrl slot=0 ld 1 modify size=max

If this is all done you probably need to expend your partition as well.

I would say, google is your friend!