Sep 132013
 

This is an article of mine first published on Wazi.

Apache is still by far the most widely deployed HTTP server, according to the latest Netcraft web server survey, but nginx has been slowly, steadily gaining market share, thanks to its blazing speed. If you want to try a faster web server and move from Apache to nginx, you’ll probably have to change some of your websites’ configurations, starting with rewrite directives. To migrate rewrite rules from Apache to nginx, start with these tips and tricks.

The Apache mod_rewrite module provides powerful and sophisticated tools for nearly all types of URL rewriting. It is, however, somewhat complex, and may be intimidating to beginners. In fact, however, rewrite rules are not magical incantations, though to understand them you need some understanding of regular expressions.

Even if you have never heard of mod_rewrite, you may still be using it. Popular applications such as WordPress, Drupal, and Magento are shipped with .htaccess files that contain standard configurations that make these applications work properly, and these usually include one or more rewrites, so to properly move your website to an nginx web server you have to “translate” the Apache mod_rewrite directives into equivalent rules for nginx’s HttpRewriteModule.

Continue reading »

Flattr this!

Jan 192013
 

When something goes wrong on your Linux server or desktop, is important to understand which process is taking all the resources, in the past I’ve published some information about top and htop, two great tools to have a general overview of your system with just a glance, but sometimes you need to gather more information of a particular process and for this task the command pidstat is perfect.

Pidstat is a statistics report tool for Linux which is part of the sysstat utilities. The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel. It writes to standard output activities for every task selected with option -p or for every task managed by the Linux kernel if option -p ALL has been used. Not selecting any tasks is equivalent to specifying -p ALL but only active tasks (tasks with non-zero statistics values) will appear in the report.
You can use PID’s and even regular expressions on the process names to filter them out.
Continue reading »

Flattr this!