login: root

Centos wordpress php-fpm + nginx + apc

If you tired of having same old apache, and want something more fast and reliable, you can install nginx + php-fpm.

Firstly you need to install new repo, to have ability to add those packages. And php-fpm works out of the box (without need to patch PHP) with version PHP 5.3. Official repository does not have this version yet.

When you have more virtual hosts than one, and you want to have more convenient way to manage them, well to turn them on and off if being more precisely.
You can create two config directories. One directory “sites-available” to gave all nginx virtual host configs, and “sites-enabled”, which will be included in main nginx config file, and all symbolic links would be kept inside this direcotory pointing to real config files.


then edit /etc/nginx/nginx.conf file:

after “include /etc/nginx/conf.d/*.conf”
insert line “include /etc/nginx/sites-enabled/*.conf”

and save it.

loginroot.com nginx vhost example (basic configuration just to make it work):

php-fpm default configuration should be alringht.
Well you may want to change to lines where are user and group, from apache to nginx.

also you may want to make nginx the owner of that directory.

make symbolic link to make vhost working.

Start both services, and you’re set :)

Comments (2)

  1. Leo G

    I think you got couple of paths wrong

    vim /etc/nginx/sites-enabled/loginroot.com

    shouldn’t this be

    vim /etc/nginx/sites-available/loginroot.com ?

    1. nsc (Post author)

      all config files I keep in sites-available, but nginx takes from sites-enabled directory.
      Sites that I want to be enabled and working, I just create symlink to file existing in sites-available directory.
      So if site is enabled – “vim /etc/nginx/sites-enabled/loginroot.com” should work, because it is symlink to “/etc/nginx/sites-available/loginroot.com”.
      Anyway You would edit the same file.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: