Run php-fpm with separate user/uid and group on linux

Php-FPM Php fpm is the new way to setup php to run with your webserver. Php-fpm is a fastcgi process manager for php that is totally separate from the webserver. The webserver communicates with fpm through a socket and passes the name of the script to execute. So fpm can run with any web server that is fastcgi compatible. I recently moved from my old shared hosting to linode. Linode provides linux vps hosting at [...]

Redirect non-www url to www in nginx

Nginx Recently I was setting up nginx on my new server where this blog is being hosted. Nginx is very different from the more popular apache web server in many ways. It has an event driven architecture which makes it much faster and high traffic tolerant compared to apache. In apache the redirects used to be done with instructions in the htaccess file. However in nginx there is no htaccess file and everything has to [...]

Setup apache + php with mod_fcgid on ubuntu

Mod Fcgid Mod Fcgid is an apache module that enables it to talk to fastcgi enabled application. It can be used to setup with apache to run php over fastcgi. It is an alternative to the older mod_fastcgi and has some differences with it. In this post we shall be setting up apache with php using this module. You can also . Since fastcgi keeps php execution out of apache, we are free to use [...]

Output buffering in php and apache

Output Buffering Output buffering is processing mechanism where the output being generated by a program is held in a place till its size reaches a limit or the generation is complete. Only after, will the output be send to its destination. In php for example, doing and echo generates some output. Now this output might be buffered. If its not, then the output will appear on your browser as soon as it is generated. If [...]

Install apache + php with mod fastcgi on ubuntu

Fastcgi based php handler Mod_fastcgi is an apache module that enables apache to talk to fastcgi enabled applications. It can be used to run php code over fastcgi through the php-cgi binary which is fastcgi enabled. Fastcgi has many improvements over the traditional cgi model of executing external programs inside a webserver. With fastcgi multiple processes are kept alive and each process is reused to serve multiple requests one after another. There are settings to [...]

An overview of apache mpms and php server apis

Apache + Php When setting up an apache+php server to run your php applications, there are lots of configuration parameters to deal with. The most important is the php Server Api (sapi). It determines how exactly is apache going to run the php scripts. Along with the php sapi another important thing to select is the apache mpm (multi processing module). The mpms determine how apache would deal with a request in general. There are [...]

Php – Do not rely on set_time_limit too much

Php set_time_limit Php has a function called set_time_limit which can be used to dynamically adjust the maximum execution time permitted to a script. It allows specifying the time in seconds and limits the script execution time to that many seconds. The set_time_limit function whenever called, effectively extends the script execution time by that many seconds. So if the script has already run for 15 seconds and set_time_limit(30) is called, then it would run for a [...]

Generate ssh keys on windows 8

SSH If you are using an ssh client on windows to control a remote webserver and want to setup passwordless logins then you need to create ssh keys. The puttygen command from the putty suite can be used to generate keys in both putty and openssh formats. Download the puttygen program from the following url Generate keys Now use the puttygen command to generate keys. Lets create an rsa key for example. Launch the puttygen.exe [...]

Setup key based authentication in openssh

SSH – Secure Shell SSH provides terminal access to control a remote web server over a secure encrypted connection. It is similar to telnet except that the entire communication is encrypted so its more secure. To connect to a webserver using ssh there are 2 things needed. First is a ssh server running on the server and another is an ssh client. Openssh is a popular ssh server used on linux based webservers. Check out [...]

Install mate desktop on kali linux

Kali linux Kali Linux comes with a hacked version of the gnome 3 desktop. It has been made to look like gnome 2 but lacks many features of the old version. If you want other desktops then can install kde, xfce or lxde from the repository. However if you want to get the good old gnome 2 desktop then install the mate desktop. Mate desktop is not available in the kali repositories but since kali [...]

Pages:1234567...42»