{"id":260,"date":"2009-11-29T19:08:04","date_gmt":"2009-11-29T11:08:04","guid":{"rendered":"http:\/\/www.computersolutions.cn\/blog\/?p=260"},"modified":"2009-11-29T19:08:04","modified_gmt":"2009-11-29T11:08:04","slug":"nginx-and-wordpress-crib-notes","status":"publish","type":"post","link":"https:\/\/www.computersolutions.cn\/blog\/2009\/11\/nginx-and-wordpress-crib-notes\/","title":{"rendered":"NGinx and WordPress Crib Notes"},"content":{"rendered":"<p>Unfortunately, its back to the techie stuff for a few posts!<\/p>\n<p>Here are my crib notes on installing NGinx on one of our client servers.<\/p>\n<p>Add spawn-fcgi (cos its split from litettpd now)<a href=\"http:\/\/redmine.lighttpd.net\/projects\/spawn-fcgi\/wiki\/SVN\"> http:\/\/redmine.lighttpd.net\/projects\/spawn-fcgi\/wiki\/SVN<\/a><\/p>\n<p><code><br \/>\ncd \/downloads<br \/>\nsvn co svn:\/\/svn.lighttpd.net\/spawn-fcgi\/trunk spawn-fcgi<br \/>\n<\/code><\/p>\n<p>No svn..grrr<\/p>\n<p><code><br \/>\napt-get install subversion subversion-tools<br \/>\nsvn co svn:\/\/svn.lighttpd.net\/spawn-fcgi\/trunk spawn-fcgi<br \/>\ncd spawn-fcgi<br \/>\n.\/autogen.sh<br \/>\n.\/configure<br \/>\nmake<br \/>\nmake install<br \/>\n<\/code><\/p>\n<p>spawn-fcgi should be happily installed in \/usr\/local\/bin\/spawn-fcgi now<\/p>\n<p>make sure we have php5-cgi<br \/>\n<code>apt-get install php5-cgi<\/code><\/p>\n<p>Check spawn-fcgi runs &#8211;<br \/>\nIn my case not, had to rebuild eAccelerator @#$@#$!, did that, and all ok<\/p>\n<p><code><br \/>\n\/bin\/spawn-fcgi -f \/usr\/bin\/php5-cgi -a 127.0.0.1 -p 53217 -P \/var\/run\/fastcgi-php.pid<br \/>\n<\/code><\/p>\n<p>Note port 53217 can be any unused port from some high unused number though to 65535<br \/>\nWe&#8217;re going to be installing NGinx from debian packages, but probably better from source long term&#8230;<\/p>\n<p><code>apt-get install nginx<\/p>\n<p>pico \/etc\/nginx\/nginx.conf<br \/>\n<\/code><\/p>\n<p>change some default settings<\/p>\n<p><code><br \/>\nuser www-data;<br \/>\nworker_processes  1;<\/p>\n<p>error_log  \/var\/log\/nginx\/error.log;<br \/>\npid        \/var\/run\/nginx.pid;<\/p>\n<p>events {<br \/>\n    worker_connections  1024;<br \/>\n}<\/p>\n<p>http {<br \/>\n    include       \/etc\/nginx\/mime.types;<br \/>\n    default_type  application\/octet-stream;<\/p>\n<p>    access_log  \/var\/log\/nginx\/access.log;<\/p>\n<p>    sendfile        on;<br \/>\n    #tcp_nopush     on;<\/p>\n<p>    #keepalive_timeout  0;<br \/>\n    keepalive_timeout  5;<br \/>\n    tcp_nodelay        on;<\/p>\n<p>    client_max_body_size 8m;<\/p>\n<p>    gzip  on;<br \/>\n    gzip_comp_level 9;<br \/>\n    gzip_types      text\/plain text\/html text\/css text\/xml application\/xml application\/xml+rss text\/javascript application\/x-javascript;<\/p>\n<p>    include \/etc\/nginx\/conf.d\/*.conf;<br \/>\n    include \/etc\/nginx\/sites-enabled\/*;<br \/>\n}<\/p>\n<p><\/code><\/p>\n<p>Now we add our virtual hosts in  \/etc\/nginx\/sites-available<\/p>\n<p><code><br \/>\npico \/etc\/nginx\/sites-available<\/p>\n<p><\/code><\/p>\n<p>Lastly, we add our fast-cgi settings, using our port from above 53217 <\/p>\n<p><code><br \/>\nfastcgi stuff here<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Unfortunately, its back to the techie stuff for a few posts! Here are my crib notes on installing NGinx on one of our client servers. Add spawn-fcgi (cos its split from litettpd now) http:\/\/redmine.lighttpd.net\/projects\/spawn-fcgi\/wiki\/SVN cd \/downloads svn co svn:\/\/svn.lighttpd.net\/spawn-fcgi\/trunk spawn-fcgi No svn..grrr apt-get install subversion subversion-tools svn co svn:\/\/svn.lighttpd.net\/spawn-fcgi\/trunk spawn-fcgi cd spawn-fcgi .\/autogen.sh .\/configure make [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[25],"tags":[41,121,119,44,120],"class_list":["post-260","post","type-post","status-publish","format-standard","hentry","category-technical-mumbo-jumbo","tag-apache","tag-crib-notes","tag-nginx","tag-tuning","tag-wordpress"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/260","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/comments?post=260"}],"version-history":[{"count":4,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/260\/revisions"}],"predecessor-version":[{"id":285,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/posts\/260\/revisions\/285"}],"wp:attachment":[{"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/media?parent=260"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/categories?post=260"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.computersolutions.cn\/blog\/wp-json\/wp\/v2\/tags?post=260"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}