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: Lighttpd mod_redirect HTTP 3xx status codes
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, …
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 …
Deny access to .svn directories with Apache2 / lighttpd
If you’re using SVN to control your web application, your certainly need to deny access to .svn sub-directories. With Apache2 <DirectoryMatch “^/.*/\.svn/”> Order allow,deny Deny from all </DirectoryMatch> With lighttpd $HTTP[“url”] =~ “/\.svn/” { url.access-deny = ( “” ) }
Retrieve file from svn
Sometimes you need to retrieve a single file from SVN without doing a checkout on the repository. SVN provides the svn cat to output the content of a file. You can redirect the output to get the file as : svn cat https://svn.mydomain.com/project/folder/file.ext > file.ext You can also use a simple shell script to do …
WordPress replaces pound by nginx
After two years of using Pound, WordPress decided to switch to Nginx as software load balancers for WordPress.com. Read the full story on Barry’s Blog.
Automatically set title on iTerm tabs
If like me you use iTerm for your terminal sessions, this is the tips to dynamically set the tab title. As I’m using the bash shell, the tab title can be automatically set with the PROMPT_COMMAND variable. You can set this variable in /etc/profile or in your .bashrc Mine is like this : export PROMPT_COMMAND=’echo …
Use mod_redirect with lighttpd
Enable mod_redirect server.modules += ( “mod_redirect” ) Force your domain with www. $HTTP[“host”] =~ “^domain\.com$” { url.redirect = ( “^/(.*)” => “http://www.domain.com/$1” ) } Force your domain without www. $HTTP[“host”] =~ “^www\.domain\.com$” { url.redirect = ( “^/(.*)” => “http://domain.com/$1” ) } Redirect HTTP requests to HTTPS $SERVER[“socket”] == “:80” { $HTTP[“host”] =~ “(.*)” { url.redirect …
Command line history
As read here, this is my command line history on my MacBook : [cc lang=”bash” line_numbers=”false”]$ history 1000 | awk ‘{a[$2]++}END{for(i in a){print a[i] ” ” i}}’ | sort -rn | head[/cc] [cc lang=”bash” line_numbers=”false”] 240 ssh 62 cd 55 scp 33 for 28 vim 25 ping 17 history 13 ls 4 sudo 3 telnet …