Top 10 Nginx Tutorial

nginx1Nginx is a free open source web server, reverse proxy and IMAP/POP3 proxy server. Nginx has grown into a feasible alternative for the much hyped Apache. It has grown over Apache with terms of low memory footprint and stability. Moreover, Nginx is gaining mommentum as an efficient and perfect for host for WordPress. It's simple configuration, rich features, minimal resource consumption and capability to avoid memory leak over time has made it a substitute for Apache. There are millions of site using Nginx and there is a large chunk considering a move to take advantage of this high performance HTTP server.

In most cases, the newbies are in the blue on the way they can make it work for them. Well, my bona fide idea would be the tutorials that provides you the step by step method to install and use the server. For this I created the list of top 10 Nginx tutorial for all who'd love to learn on Nginx.

Full article (629 words) »

WordPress Scaling & Performance - A Picture Which Speaks Thousand Words and More

google-crawl-statsEveryone and their dog talks about WordPress performance these days and also tells you how to scale WordPress (Read: How to really scale WordPress). When I grew up in Kharagpur (yes, the same Kharagpur which has the top IIT and yes I did my B.Tech there) everyone knew how to cure diabetes - you have to walk a lot, stop eating sweets, eat / drink varying concoction of Neem leaves and / or Nayantara leaves and / or Jamun fruit or seed and presto you are cured of diabetes. It works to some extent in uncomplicated cases and so does the various remedies for WordPress performance. Let's see what are the often repeated "expert" advice for making WordPress perform (because by default WordPress performance is really really crappy; pardon my French):

Full article (1042 words) »

The Profile of a Hi-Tech Jehadi…

By now all of are aware how Mansoor Peerbhoy has masterminded the terrorist attacks in India, that he showed no remorse in killing non-muslims and doesn't care about the consequences, you are also aware how he was a senior software engineer working at Yahoo / Zimbra and earning an impressive salary by Indian standards. You also heard that he was very tech savvy and an nginx (a faster and apparently better alternative to Apache web server or even lighttpd web server) expert. Just how tech savvy was he? Full article (303 words) »

How To Automatically Start Nginx & Fastcgi on Reboot on Fedora Linux

nginx [engine x] is a high quality, light footprint (much ligher than Apache HTTPD), high performance HTTP server and mail proxy server written by Igor Sysoev. nginx is distributed under BSD license unlike its competitor Lighttpd. We are progressively transferring our sites over to nginx. Today when I had to restart the server, I realized (after few hours) with horror that we had forgot to add the script to start nginx automatically after reboot. When you want any command to execute everytime after a reboot you should add it to /etc/rc.local. The commands in rc.local are executed *after* all the other init scripts. To automatically start nginx as well as fastcgi on reboot you should add the following lines to /etc/rc.local at the end -

Full article (301 words) »

Nginx: How To Stop Referrer Spam With Keyword Filtering

You can configure Nginx to stop referrer spam by checking for bad keywords like tramadol, phentermine etc. This reduces the load on your server as well as prevents filling your referrer logs with invalid entries. Here is my nginx configuration to stop referrer spam (feel free to copy it): Full article (139 words) »

Nginx: How To Redirect /index.php To / To Avoid Content Duplication

Normally any website that responds to /index.php also responds to /. This has the potential to duplicate content. So how can you re-direct /index.php to / without causing infinite loop in nginx?

Here is a simple solution:

Full article (77 words) »

Nginx Hacking Tips

Nginx LogoNginx is a high performance web server and mail proxy server written by Igor Sysoev and a good replacement for Apache HTTPD, the market leader. Nginx is rapidly increasing its market share with major websites joining it like wordpress.com. In the June 2008 Netcraft survey LiteSpeed lost more than 600 thousand sites during this survey, while nginx gained more than a million sites; more than doubling in numbers. The WordPress blogging system recently converted all of its load balancers to nginx, using the upstream hash module to serve 8-9 thousand requests per second. We too have decided to move some of our websites to Nginx. Here are few essential tips and general guidelines for configuring Nginx. This is not a substitute for reading the documentation (rtfm). However when you are stuck even after reading and re-reading the nginx documentation then read below. You will understand the value of the tips below only then :)

Full article (1050 words) »

Tips on Configuring Nginx for Virtual Hosting

Nginx tutorials and examples doesn't tell you how you can configure nginx with virtual hosting when different sites are in different pre-defined directories. Often you are moving over your site from a different web server like Apache HTTPD to Nginx. So you have a pre-defined directory structure which may not be easy to change. Configuring nginx is somewhat tricky in this scenario because nginx isn't very flexible in accepting directives everywhere. After much experimentation we came up with this simple way: Full article (242 words) »

How To Run phpBB on Nginx With Virtual Hosting

We now have our phpBB forum running on Nginx web server, a high quality and significantly better performing web server than Apache HTTPD. Soem of the challenges we faced were:

  1. We use nice permalinks in the forum so there are lots of apache httpd rewrite rules in .htaccess files which had to be converted to nginx format.
  2. Additionally we also had to configure it for a virtual hosting setup where the same IP address (server) is shared by multiple websites.

Full article (434 words) »

Ngnix: Solution for Directory Resolution Problem in Virtual Hosting

Nginx displays a peculiar but logical behavior when handling directories specified without the ending slash. For example you have a directory like http://www.example2.com/dir/. However you specify the url as http://www.example2.com/dir. Also assume that you have configured the server for virtual hosting and the alternative server names are: www.example.com, www.example2.com etc. and they are specified in the same order. Now when you try to fetch http://www.example2.com/dir you will instead be redirected to http://www.example.com/dir. Here is why nginx does it along with a simple solution to the rather baffling problem (ok complex problem - I said it).

Full article (275 words) »

Protected by Comment Guard Pro