Permanent redirect (301) with lighttpd

If you want to redirect visitors that access your website without the ‘www’, you can use mod_redirect with the following syntax:

$HTTP[”host”] =~ “^lescampeurs\.org” {
    url.redirect = (
        ”^/(.*)$” => “http://www.lescampeurs.org/$1″
    )
}

Links:

This entry was written by CharlyBr, posted on June 30, 2008 at 11:47 pm, filed under http and tagged . Leave a comment or view the discussion at the permalink.

A new article about Google data centers

On the other hand, Dean seemingly thinks clusters of 1,800 servers are pretty routine, if not exactly ho-hum.

… that would mean Google has more than 200,000 servers, …

Co-founder Larry Page encourages a “healthy disrespect for the impossible” at Google

Dean described three core elements of Google’s software: GFS, the Google File System, BigTable, and the MapReduce algorithm.

Read it at CNET

This entry was written by CharlyBr, posted on June 7, 2008 at 7:43 am, filed under Data centers and tagged . Leave a comment or view the discussion at the permalink.

Rotate Apache logs with Cronolog

Cronolog is log rotation program which gives you a lot of options to template the log destination files. The common use is to split logs by year / month / day.

Here is how to configure Apache to send log entries to cronolog :

CustomLog "|/usr/sbin/cronolog /home/log/apache2/%Y-%m-%d_domain.com_access.log" combined

This will create a log file named 2008-06-02_domain.com_access.log for today.

Cronolog reads log entries from standard input and writes them to the output file specified by your template.

More examples

  • Rotate by month :
CustomLog "|/usr/sbin/cronolog /home/log/apache2/%Y-%m_domain.com_access.log" combined
  • Rotate by week number :
CustomLog "|/usr/sbin/cronolog /home/log/apache2/%Y-%W_domain.com_access.log" combined
  • Rotate hourly
CustomLog "|/usr/sbin/cronolog /home/log/apache2/%H_domain.com_access.log" combined

Links

This entry was written by CharlyBr, posted on June 4, 2008 at 7:33 am, filed under Logs, http and tagged , . Leave a comment or view the discussion at the permalink.