Apache, nginx or other web server?

Apache is a long well-known web server software, the most used in web servers around the internet. I met nginx when I started looking into getting free low-end VPS for my websites and scripts.

Basically, what I have learned is that most scripts won’t work well even if you convert the .htaccess’es into nginx config files. In my opinion, it’s simply not worth to get a VPS with less than 256MB of dedicated RAM, because on fewer RAM you won’t be able to run Apache properly (most of the times, Apache will just fill up the RAM leaving you locked out of your VPS because you can’t SSH as Linux doesn’t have enough free RAM to start a new shell session.

On servers with few RAM (512MB, for example) you can still run Apache and have some RAM free. If you have MySQL installed, the trick to reduce RAM consists on disabling inno-db and other database engines you don’t need. Apache can also be configured to waste less RAM on low traffic websites – you can reduce the number of max clients and connections, but this can make the site unresponsive (slow) if you get many hits at a time.

In conclusion, if you’re sure you can setup your script with nginx and cgi-php (or other lightweight webserver, e.g. lighthttpd), go for it. I have nothing against nginx, I only wish developers supported nginx (and lighthttpd and etc.) more instead of the already much explored (and at times exploited) Apache.

Leave a Reply