{"id":881,"date":"2013-10-01T12:40:53","date_gmt":"2013-10-01T05:40:53","guid":{"rendered":"http:\/\/kusumotolab.com\/?p=881"},"modified":"2013-10-01T19:08:19","modified_gmt":"2013-10-01T12:08:19","slug":"how-to-install-nginx-mysql-php5-in-ubuntu","status":"publish","type":"post","link":"https:\/\/oldblog.kusumotolab.com\/?p=881","title":{"rendered":"\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 Nginx + MySQL + PHP5 \u0e43\u0e19 Ubuntu Linux"},"content":{"rendered":"<h2>\u0e1e\u0e2d\u0e14\u0e35\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07\u0e01\u0e33\u0e25\u0e31\u0e07\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 Server \u0e43\u0e2b\u0e21\u0e48\u0e17\u0e35\u0e48\u0e08\u0e30\u0e40\u0e2d\u0e32\u0e44\u0e27\u0e49\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e08\u0e23\u0e34\u0e07 \u0e41\u0e25\u0e49\u0e27\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e01\u0e47\u0e1a\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e40\u0e2d\u0e32\u0e44\u0e27\u0e49 (\u0e01\u0e31\u0e19\u0e25\u0e37\u0e21) \u0e40\u0e2d\u0e32 \u0e21\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e01\u0e31\u0e19\u0e40\u0e25\u0e22\u0e14\u0e35\u0e01\u0e27\u0e48\u0e32<\/h2>\n<p><strong>\u0e2d\u0e31\u0e1e\u0e40\u0e14\u0e15 APT \u0e02\u0e2d\u0e07 Ubuntu \u0e01\u0e48\u0e2d\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e23\u0e31\u0e1a Software \u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19\u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14<\/strong><\/p>\n<pre lang=\"bash\">apt-get update<\/pre>\n<h3>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e01\u0e47\u0e17\u0e33\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 MySQL Server \u0e41\u0e25\u0e30 Setup \u0e04\u0e48\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19<\/h3>\n<p><strong>\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07<\/strong><\/p>\n<pre lang=\"bash\">apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql<\/pre>\n<p><strong>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e01\u0e47\u0e08\u0e30\u0e17\u0e33\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/strong><\/p>\n<pre lang=\"bash\">mysql_install_db<\/pre>\n<p><strong>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e01\u0e47\u0e08\u0e30\u0e14\u0e33\u0e40\u0e19\u0e34\u0e34\u0e19\u0e01\u0e32\u0e23\u0e40\u0e1b\u0e34\u0e14\u0e15\u0e31\u0e27\u0e2a\u0e34\u0e49\u0e19\u0e2a\u0e38\u0e14\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e02\u0e2d\u0e07 MySQL \u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/strong><\/p>\n<pre lang=\"bash\">\/usr\/bin\/mysql_secure_installation<\/pre>\n<h3>\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 nginx Web Server<\/h3>\n<p><strong> \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/strong><\/p>\n<pre lang=\"bash\">apt-get install nginx<\/pre>\n<p><strong>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e41\u0e25\u0e49\u0e27 \u0e01\u0e47\u0e2a\u0e31\u0e48\u0e07\u0e2b\u0e43\u0e49\u0e21\u0e31\u0e19\u0e40\u0e23\u0e34\u0e48\u0e21\u0e17\u0e33\u0e07\u0e32\u0e19\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/strong><\/p>\n<pre lang=\"bash\">service nginx start<\/pre>\n<h3>\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 PHP<\/h3>\n<p><strong>\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07<\/strong><\/p>\n<pre lang=\"bash\">apt-get install php5-fpm<\/pre>\n<p><strong>\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 PHP \u0e43\u0e2b\u0e49\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e33\u0e07\u0e32\u0e19\u0e01\u0e31\u0e1a nginx \u0e44\u0e14\u0e49<\/strong><br \/>\n<strong> \u0e40\u0e1b\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 PHP \u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e41\u0e01\u0e49\u0e44\u0e02\u0e14\u0e49\u0e27\u0e22 nano<\/strong><\/p>\n<pre lang=\"bash\">nano \/etc\/php5\/fpm\/php.ini<\/pre>\n<p><strong>\u0e41\u0e01\u0e49\u0e44\u0e02\u0e1a\u0e23\u0e23\u0e17\u0e31\u0e14\u0e17\u0e35\u0e48\u0e02\u0e36\u0e49\u0e19\u0e27\u0e48\u0e32 cgi.fix_pathinfo=1 \u0e43\u0e2b\u0e49\u0e41\u0e01\u0e49\u0e40\u0e1b\u0e47\u0e19 cgi.fix_pathinfo=0<\/strong><\/p>\n<pre>cgi.fix_pathinfo=1<\/pre>\n<p><strong>\u0e41\u0e25\u0e49\u0e27\u0e17\u0e33\u0e01\u0e32\u0e23\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e41\u0e25\u0e49\u0e27\u0e2d\u0e2d\u0e01<\/strong><br \/>\n<strong> \u0e15\u0e48\u0e2d\u0e44\u0e1b\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e34\u0e14\u0e44\u0e1f\u0e25\u0e4c\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 php5-fpm \u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e41\u0e01\u0e49\u0e44\u0e02 \u0e14\u0e49\u0e27\u0e22 nano<\/strong><\/p>\n<pre lang=\"bash\">nano \/etc\/php5\/fpm\/pool.d\/www.conf<\/pre>\n<p><strong>\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e04\u0e33\u0e27\u0e48\u0e32 listen = 127.0.0.1:9000 \u0e40\u0e23\u0e32\u0e08\u0e30\u0e17\u0e33\u0e01\u0e32\u0e23\u0e41\u0e01\u0e49\u0e44\u0e02\u0e43\u0e2b\u0e49\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e23\u0e2d\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e15\u0e48\u0e2d\u0e1c\u0e48\u0e32\u0e19 Socket \u0e41\u0e17\u0e19 \u0e43\u0e2b\u0e49\u0e17\u0e33\u0e01\u0e32\u0e23\u0e41\u0e01\u0e49\u0e40\u0e1b\u0e47\u0e19 \/var\/run\/php5-fpm.sock<\/strong><\/p>\n<pre>\/var\/run\/php5-fpm.sock<\/pre>\n<p><strong>\u0e41\u0e25\u0e49\u0e27\u0e17\u0e33\u0e01\u0e32\u0e23\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e41\u0e25\u0e49\u0e27\u0e2d\u0e2d\u0e01<\/strong><\/p>\n<h3>\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 nginx \u0e43\u0e2b\u0e49\u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e23\u0e2d\u0e07\u0e23\u0e31\u0e1a Code PHP \u0e44\u0e14\u0e49<\/h3>\n<p><strong> \u0e17\u0e33\u0e01\u0e32\u0e23\u0e41\u0e01\u0e49\u0e44\u0e02\u0e44\u0e1f\u0e25\u0e4c\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e02\u0e2d\u0e07 nginx \u0e14\u0e49\u0e27\u0e22 nano<\/strong><\/p>\n<pre lang=\"bash\">nano \/etc\/nginx\/sites-available\/default<\/pre>\n<p><strong>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e43\u0e2b\u0e49\u0e17\u0e33\u0e01\u0e32\u0e23\u0e41\u0e01\u0e49\u0e44\u0e02\u0e02\u0e49\u0e2d\u0e04\u0e27\u0e32\u0e21 \u0e15\u0e32\u0e21\u0e14\u0e49\u0e32\u0e19\u0e25\u0e48\u0e32\u0e07<\/strong><\/p>\n<pre> ...\r\nserver {\r\n        listen   80;\r\n\r\n        root \/usr\/share\/nginx\/www;\r\n        index index.php index.html index.htm;\r\n\r\n        server_name example.com;\r\n\r\n        location \/ {\r\n                try_files $uri $uri\/ \/index.html;\r\n        }\r\n\r\n        error_page 404 \/404.html;\r\n\r\n        error_page 500 502 503 504 \/50x.html;\r\n        location = \/50x.html {\r\n              root \/usr\/share\/nginx\/www;\r\n        }\r\n\r\n        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000\r\n        location ~ \\.php$ {\r\n                try_files $uri =404;\r\n                fastcgi_pass unix:\/var\/run\/php5-fpm.sock;\r\n                fastcgi_index index.php;\r\n                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n                include fastcgi_params;\r\n\r\n        }\r\n\r\n}\r\n...<\/pre>\n<p><strong>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e41\u0e25\u0e49\u0e27\u0e2d\u0e2d\u0e01<\/strong><\/p>\n<h2>\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e01\u0e32\u0e23\u0e17\u0e33\u0e07\u0e32\u0e19\u0e02\u0e2d\u0e07 PHP \u0e1a\u0e19 nginx<\/h2>\n<p>\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e35\u0e49\u0e40\u0e23\u0e32\u0e01\u0e47\u0e08\u0e30\u0e21\u0e32\u0e17\u0e14\u0e2a\u0e2d\u0e1a\u0e01\u0e31\u0e19\u0e27\u0e48\u0e32 PHP \u0e2a\u0e32\u0e21\u0e32\u0e23\u0e16\u0e17\u0e33\u0e07\u0e32\u0e19\u0e1a\u0e19 nginx \u0e44\u0e14\u0e49\u0e41\u0e25\u0e49\u0e27\u0e2b\u0e23\u0e37\u0e2d\u0e22\u0e31\u0e07 \u0e14\u0e49\u0e27\u0e22\u0e01\u0e32\u0e23\u0e2a\u0e23\u0e49\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c index.php \u0e02\u0e36\u0e49\u0e19\u0e21\u0e32 \u0e41\u0e25\u0e49\u0e27\u0e40\u0e02\u0e35\u0e22\u0e19\u0e42\u0e04\u0e4a\u0e14\u0e27\u0e48\u0e32<\/p>\n<pre lang=\"php\"><?php phpinfo(); ?><\/pre>\n<p>\u0e41\u0e25\u0e49\u0e27\u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e44\u0e27\u0e49\u0e17\u0e35\u0e48 \/usr\/share\/nginx\/www\/ \u0e1a\u0e31\u0e19\u0e17\u0e36\u0e01\u0e27\u0e48\u0e32 index.php<br \/>\n\u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e01\u0e47\u0e40\u0e1b\u0e34\u0e14\u0e40\u0e27\u0e47\u0e1a\u0e42\u0e14\u0e22\u0e43\u0e2a\u0e48\u0e17\u0e35\u0e48\u0e2d\u0e22\u0e39\u0e48\u0e27\u0e48\u0e32<\/p>\n<pre> http:\/\/[ip-server]\/<\/pre>\n<p><strong>\u0e16\u0e49\u0e32\u0e02\u0e36\u0e49\u0e19 php infomation \u0e02\u0e36\u0e49\u0e19\u0e21\u0e32 \u0e41\u0e2a\u0e14\u0e07\u0e27\u0e48\u0e32\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e40\u0e2a\u0e23\u0e47\u0e08\u0e2a\u0e21\u0e1a\u0e39\u0e23\u0e13\u0e4c\u0e41\u0e25\u0e49\u0e27\u0e04\u0e23\u0e31\u0e1a<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0e1e\u0e2d\u0e14\u0e35\u0e15\u0e31\u0e27\u0e40\u0e2d\u0e07\u0e01\u0e33\u0e25\u0e31\u0e07\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 Server \u0e43\u0e2b\u0e21\u0e48\u0e17\u0e35\u0e48\u0e08\u0e30\u0e40\u0e2d\u0e32\u0e44\u0e27\u0e49\u0e43\u0e0a\u0e49\u0e07\u0e32\u0e19\u0e08\u0e23\u0e34\u0e07 \u0e41\u0e25\u0e49\u0e27\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e40\u0e01\u0e47\u0e1a\u0e23\u0e32\u0e22\u0e25\u0e30\u0e40\u0e2d\u0e35\u0e22\u0e14\u0e40\u0e2d\u0e32\u0e44\u0e27\u0e49 (\u0e01\u0e31\u0e19\u0e25\u0e37\u0e21) \u0e40\u0e2d\u0e32 \u0e21\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e01\u0e31\u0e19\u0e40\u0e25\u0e22\u0e14\u0e35\u0e01\u0e27\u0e48\u0e32 \u0e2d\u0e31\u0e1e\u0e40\u0e14\u0e15 APT \u0e02\u0e2d\u0e07 Ubuntu \u0e01\u0e48\u0e2d\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e23\u0e31\u0e1a Software \u0e40\u0e27\u0e2d\u0e23\u0e4c\u0e0a\u0e31\u0e19\u0e25\u0e48\u0e32\u0e2a\u0e38\u0e14 apt-get update \u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e01\u0e47\u0e17\u0e33\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 MySQL Server \u0e41\u0e25\u0e30 Setup \u0e04\u0e48\u0e32\u0e40\u0e23\u0e34\u0e48\u0e21\u0e15\u0e49\u0e19 \u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49\u0e43\u0e19\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql \u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e01\u0e47\u0e08\u0e30\u0e17\u0e33\u0e01\u0e32\u0e23\u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 mysql_install_db \u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e19\u0e31\u0e49\u0e19\u0e01\u0e47\u0e08\u0e30\u0e14\u0e33\u0e40\u0e19\u0e34\u0e34\u0e19\u0e01\u0e32\u0e23\u0e40\u0e1b\u0e34\u0e14\u0e15\u0e31\u0e27\u0e2a\u0e34\u0e49\u0e19\u0e2a\u0e38\u0e14\u0e01\u0e32\u0e23\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e02\u0e2d\u0e07 MySQL \u0e02\u0e36\u0e49\u0e19\u0e21\u0e32\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 \/usr\/bin\/mysql_secure_installation \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 nginx Web Server \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 apt-get install nginx \u0e2b\u0e25\u0e31\u0e07\u0e08\u0e32\u0e01\u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e41\u0e25\u0e49\u0e27 \u0e01\u0e47\u0e2a\u0e31\u0e48\u0e07\u0e2b\u0e43\u0e49\u0e21\u0e31\u0e19\u0e40\u0e23\u0e34\u0e48\u0e21\u0e17\u0e33\u0e07\u0e32\u0e19\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 service nginx start \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07 PHP \u0e15\u0e34\u0e14\u0e15\u0e31\u0e49\u0e07\u0e14\u0e49\u0e27\u0e22\u0e04\u0e33\u0e2a\u0e31\u0e48\u0e07 apt-get install php5-fpm \u0e15\u0e31\u0e49\u0e07\u0e04\u0e48\u0e32 PHP [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":[]},"categories":[15],"tags":[],"class_list":["post-881","post","type-post","status-publish","format-standard","hentry","category-linux"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3OMEb-ed","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=881"}],"version-history":[{"count":10,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/881\/revisions"}],"predecessor-version":[{"id":898,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=\/wp\/v2\/posts\/881\/revisions\/898"}],"wp:attachment":[{"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oldblog.kusumotolab.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}