Tag Archives: Web Server

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:

deb http://ppa.launchpad.net/nginx/stable/ubuntu lucid main

You can create a file like /etc/apt/sources.list.d/nginx-stable.list, and put that line inside.

We also need to add the key of this repository so Ubuntu won’t complain.

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 00A6F0A3C300EE8C

and finally, run:

apt-get upgrade && apt-get install nginx

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 the results.

The problem is that Ubuntu Hardy 8.04 comes with Nginx version 0.5 (version 1.0 has been recently released), and lacks of some features as Cache. An easy way to update the version to a more recent one (currently, to 0.8) without upgrading the whole Ubuntu version is using the following PPA repository: https://launchpad.net/~meto/+archive/nconfig

To add this repository to your system, you need to create a file inside /etc/apt/sources.list.d/ (for instance, nginx-stable.list) with the following content:

deb http://ppa.launchpad.net/meto/nconfig/ubuntu hardy main 
deb-src http://ppa.launchpad.net/meto/nconfig/ubuntu hardy main

Then, you need to add the key of the repository to your system:

apt-key adv --keyserver keyserver.ubuntu.com --recv-keys ED283389

Finally, run:

apt-get update && apt-get upgrade

You should be prompted about a newer version of nginx, say yes, and that’s it, enjoy ;).

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 directories will not be hidden for the web server, so it is important to forbid browsers the access to them.

If you are using Apache, you can use the tips on this page.

If you use Apache 2.2 (I have not test it on other versions, but it should work also on 2.0 version) and have access to the configuration files, you can create the file /etc/apache2/conf.d/svn with the following content:

<Directory ~ "\.svn">
    Order allow,deny
    Deny from All

This will deny access to all the .svn directories on your web server. After you have create this file, do not forget to restart the web server so the changes can take effect.

Edit (26/May/2011): This can also be achieved using:

<DirectoryMatch .*\.svn/.*>
    Deny From All