Redirect WWW to non-WWW using Apache (htaccess)

The easiest way to redirect all your traffic from a WWW address (like www.domain.com) to a non-WWW (like domain.com) is using the following code:

RewriteEngine On RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

With this code, you don’t need to hard-code the name of the domain into the .htaccess file.

Apart from the fact [...]

Nginx newest version on Ubuntu Lucid 10.04 LTS

Some time ago I wrote a post regarding this same topic (installing an updated version of Nginx instead of the one that is on the official Ubuntu repositories) but for Hardy (8.04).

Now, it is the turn of the latest Long-Term-Support version of this Linux distribution.

In this case, we need to use this repository:

[...]

Install updated version of nginx on Ubuntu Hardy 8.04LTS

Nginx is a great web server to handle tons of traffic with relative low resources, it beats Apache big time.

I have started using it as a Reverse Proxy, Load Balancer, Web Cache and static files web server (like images, javascript and CSS) in front of Apache (for PHP processing). I’m more than amazed with [...]

Forbid access to svn directories on Apache Web Server

Using Subversion to deploy and maintain updated web applications like WordPress, Joomla or even your development on a web server is very handy. One of the downsides I have found to this solution is that your web root will have hidden .svn directories all over the place (one per each directory on your application). This [...]

Resolving troubleshooting with Munin

This are some problems that you may encounter after installing Munin:

Apache modules are not tracking, so they are not showing statistics, you may want to check Munin logs (specifically /var/log/munin/munin-node.log) to see what is going on.

If you got something like Can’t locate object method “new” via package “LWP::UserAgent”, you need to install [...]

Install Munin on Ubuntu Server

Munin is a small tool for monitoring resources on servers. I think it is very useful, specially on small VPS, that needs to save resources. Reports are written as HTML files, so we will need a Web Server like Apache to see this reports.

First, we install it and add some extra plugins:

$ sudo [...]