9 responses to “How to Install and Configure a NGINX Server (LEMP Stack)”

  1. voku

    I use “Nginx” + “PHP5-fpm” and not “php-fastcgi” because it is faster… than create a php-fastcgi process and quit this process for every php-data… my howto -> http://suckup.de/blog/2010/07/31/nginx-php5-fpm-auf-debianubuntu/ (only in German, but there is a example)

  2. voku

    I have make it this way ->


    Info: http://wiki.nginx.org/NginxFaq#What_about_support_for_something_like_mod_suexec.3F

    PS: you can also activate chroot for php-fpm… if you want protect other websites…

  3. Tomasz Sterna

    PHP’s FastCGI does not spawn a separate process for every processed request. This is how CGI works and FastCGI was designed to mitigate this.

    The variable PHP_FCGI_MAX_REQUESTS says how many requests will a single php-cgi process serve before quitting. After that the process quits and another one is spawned (keeping up to PHP_FCGI_CHILDREN parallel processes at any time).

  4. Marcus

    I got this error on line 48…..any idea why that might be? Cheers

    /etc/init.d/nginx restart
    Restarting nginx: [emerg]: “fastcgi_pass” directive is not allowed here in /etc/nginx/sites-enabled/default:48
    configuration file /etc/nginx/nginx.conf test failed

  5. MrToxic

    Thanks u admin. Very nice article.
    “service php-fastcgi start”
    When I run the error is
    Error Text:
    Starting PHP FastCGI: /etc/init.d/php-fastcgi: line 14: start-stop-daemon: command not found

  6. Techie Talks

    This installation helped me set-up a fully functional server. A thumbs up to the author!

  7. Konstantin Schubert

    For me, the line
    echo “” > /var/www/nginx-default/phpinfo.php[\code]
    doesn’t work. The directory does not exist. In the settings file , the line
    root /usr/share/nginx/www;[\code] can be found.
    I’m a noob, but it seems to me that the root directory has moved. (Version 1.1.19

  8. fie

    My default nginx website was installed to /usr/share/nginx/www/