{"id":2385,"date":"2011-04-16T01:56:32","date_gmt":"2011-04-16T01:56:32","guid":{"rendered":""},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T22:00:00","slug":"Jare","status":"publish","type":"post","link":"https:\/\/iguanademos.com\/Jare\/wp\/?p=2385","title":{"rendered":"nginx 1.0"},"content":{"rendered":"<p>Since I started working on Pyro&#8217;s server backend for its social games, I have grown to love the <a href=\"http:\/\/nginx.org\/\">nginx<\/a> web server. Compact, efficient and fully featured, it&#8217;s a great alternative to Apache if you are in full control of your web server and apps.<\/p>\n<p>A few days ago nginx came of age with the release of 1.0, so I did a refresh of my simple web dev setup at home:<\/p>\n<p>&#8211; Download nginx 1.0 Windows binary <a href=\"http:\/\/nginx.org\/download\/nginx-1.0.0.zip\">here<\/a><br \/>&#8211; Download thread-safe php Windows binary <a href=\"http:\/\/windows.php.net\/downloads\/releases\/php-5.3.6-Win32-VC9-x86.zip\">here<\/a><br \/>&#8211; Unzip them to their own folders<br \/>&#8211; Copy php.ini-development to php.ini. Edit php.ini and uncomment the lines containing <b>extension=php_mysql.dll<\/b> and <b>extension_dir = &quot;ext&quot;<\/b>.<br \/>&#8211; Start php by running <b>php-cgi.exe -b 127.0.0.1:9000<\/b>. You can later stop it with Ctrl-C, <b>taskkill \/IM php-cgi.exe<\/b> or with your favourite process killing method.<br \/>&#8211; Make the following edits to <b>conf\\nginx.conf<\/b>:<br \/>&#8211; If you are running Vista or later with IPv6, change the line <b>listen 80<\/b> to <b>listen [::]:80<\/b>. This makes nginx listen on both IPv4 and IPv6. Even if you are not doing any work related to IPv6, your Windows hosts file will probably contain the IPv6 loopback entry for localhost (::1), and your browsers will try to use that IPv6 address for localhost. Enabling IPv6 in nginx lets you use all three loopbacks (<a href=\"http:\/\/127.0.0.1\/\">http:\/\/127.0.0.1\/<\/a>, <a href=\"http:\/\/[::1]\/\">http:\/\/[::1]\/<\/a> and <a href=\"http:\/\/localhost\/\">http:\/\/localhost\/<\/a>) intercheangeably and without problems.<br \/>&#8211; Uncomment the block lines starting with <b>location ~ \\.php$<\/b> to enable php scripts.<br \/>&#8211; Change the fastcgi_param line to eliminate the hardcoded &quot;scripts&quot; folder path. It should be <b>fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;<\/b>.<br \/>&#8211; Add index.php to the index line so it looks like <b>index  index.html index.htm index.php;<\/b><br \/>&#8211; Remove all the <b>root html;<\/b> lines and leave a single <b>root d:\\dev\\mywebdevfolder<\/b> line at the server scope. I usually put it just below the <b>server_name localhost;<\/b> line.<br \/>&#8211; Start nginx by running <b>nginx.exe<\/b> or, since it can&#8217;t be killed with Ctrl-C, <b>start nginx.exe<\/b>.<br \/>&#8211; use the command-line signals to control nginx: <b>nginx -s quit<\/b> to stop it, <b>nginx -s reload<\/b> to reload the configuration.<\/p>\n<p>That should be it, nginx+php in 5 minutes or less!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I started working on Pyro&#8217;s server backend for its social games, I have grown to love the nginx web server. Compact, efficient and fully featured, it&#8217;s a great alternative to Apache if you are in full control of your &hellip; <a href=\"https:\/\/iguanademos.com\/Jare\/wp\/?p=2385\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-2385","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2385"}],"version-history":[{"count":0,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2385\/revisions"}],"wp:attachment":[{"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iguanademos.com\/Jare\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}