CentOS5安裝Nginx1.4+PHP5.5 FastCGI

轉載鏈接:http://blog.csdn.net/staricqxyz/article/details/17012329


  1. yum?-y?install?gcc?gcc-c++?autoconf?libjpeg?libjpeg-devel?libpng?libpng-devel?freetype?freetype-devel?libxml2?libxml2-devel?zlib?zlib-devel?glibc?glibc-devel?glib2?glib2-devel?bzip2?bzip2-devel?ncurses?ncurses-devel?curl?curl-devel?ssse2fsprogs?e2fsprogs-devel?krb5?krb5-devel?libidn?libidn-devel?openssl?openssl-devel?openldap?openldap-devel?nss_ldap?openldap-clients?openldap-servers?gettext-devel?libXpm-devel?libtool?libevent?libevent-devel?gd-devel?gd?libmcrypt?libmcrypt-devel?pcre?pcre-devel??
  1. [root@lnmp?software]#?tar?zxvf?libiconv-1.14.tar.gz???
  2. [root@lnmp?software]#?cd?libiconv-1.14??
  3. [root@lnmp?libiconv-1.14]#?./configure?--prefix=/service/libiconv??
  4. [root@lnmp?libiconv-1.14]#?make?&&?make?install??
  1. [root@lnmp?software]#?tar?zxvf?GD-2.50.tar.gz???
  2. [root@lnmp?software]#?cd?GD-2.50?????
  3. [root@lnmp?GD-2.50]#?perl?Makefile.PL???
  4. [root@lnmp?GD-2.50]#?make?&&?make?install??

安裝MySQL

  1. [root@lnmp?software]#?tar?zxvf?mysql-5.5.34.tar.gz???
  2. [root@lnmp?software]#?cd?mysql-5.5.34??
  3. [root@lnmp?mysql-5.5.34]#?groupadd?mysql??
  4. [root@lnmp?mysql-5.5.34]#?useradd?-g?mysql?-s?/sbin/nologin?mysql??
  5. [root@lnmp?mysql-5.5.34]#?cmake?.?-DCMAKE_INSTALL_PREFIX=/service/mysql?-DMYSQL_DATADIR=/data/mysql?-DSYSCONFDIR=/service/mysql?-DMYSQL_UNIX_ADDR=/data/mysql/mysql.sock?-DWITH_INNOBASE_STORAGE_ENGINE=1?-DWITH_FEDERATED_STORAGE_ENGINE=1?-DWITH_BLACKHOLE_STORAGE_ENGINE=1?-DWITH_EXAMPLE_STORAGE_ENGINE=1?-DWITH_PARTITION_STORAGE_ENGINE=1?-DWITH_ARCHIVE_STORAGE_ENGINE=1?-DWITH_MYISAM_STORAGE_ENGINE=1?-DWITH_PERFSCHEMA_STORAGE_ENGINE=1?-DDEFAULT_CHARSET=utf8?-DDEFAULT_COLLATION=utf8_general_ci?-DWITH_EXTRA_CHARSETS=all?-DWITH_READLINE=1?-DENABLED_LOCAL_INFILE=1?-DMYSQL_TCP_PORT=30307?-DCOMPILATION_COMMENT=ZWC?-DWITH_DEBUG=0??
  6. [root@lnmp?mysql-5.5.34]#?make?&&?make?install??
  7. [root@lnmp?mysql-5.5.34]#?cp?support-files/my-large.cnf?/service/mysql/my.cnf??
  8. [root@lnmp?mysql-5.5.34]#?chown?-R?mysql:mysql?/data/mysql?/service/mysql??
  9. [root@lnmp?mysql-5.5.34]#?/service/mysql/bin/mysqld_safe?--defaults-file=/service/mysql/my.cnf?--basedir=/service/mysql?--datadir=/data/mysql?--user=mysql?&??


安裝PHP,PHP5.5中自帶了mysqlnd,MySQL不是必須安裝的

  1. [root@lnmp?software]#?tar?zxvf?php-5.5.6.tar.gz???
  2. [root@lnmp?software]#?cd?php-5.5.6??
  3. [root@lnmp?php-5.5.6]#?groupadd?webroot??
  4. [root@lnmp?php-5.5.6]#?useradd?-g?webroot?-s?/sbin/nologin?webroot??
  5. [root@lnmp?php-5.5.6]#?./configure?--prefix=/service/php?--with-config-file-path=/service/php/etc?--with-gd?--enable-gd-native-ttf?--enable-gd-jis-conv?--with-jpeg-dir?--with-png-dir?--with-freetype-dir?--with-mcrypt?--with-zlib-dir?--with-xpm-dir?--enable-xml?--with-curl?--with-zlib?--enable-exif?--with-zlib-dir?--with-bz2?--with-libxml-dir?--enable-mbstring?--enable-sockets?--enable-zip?--enable-ftp?--with-iconv-dir=/service/libiconv?--disable-rpath?--enable-bcmath?--enable-shmop?--enable-sysvsem?--enable-inline-optimization?--enable-mbregex?--enable-fpm?--with-fpm-user=webroot?--with-fpm-group=webroot??--with-pdo-mysql=mysqlnd?--with-mysqli=mysqlnd?--with-mysql=mysqlnd?--enable-dom?--with-libdir=lib64??
  6. [root@lnmp?php-5.5.6]#?make?&&?make?install??
  7. Installing?shared?extensions:?????/service/php/lib/php/extensions/no-debug-non-zts-20121212/??
  8. Installing?PHP?CLI?binary:????????/service/php/bin/??
  9. Installing?PHP?CLI?man?page:??????/service/php/php/man/man1/??
  10. Installing?PHP?FPM?binary:????????/service/php/sbin/??
  11. Installing?PHP?FPM?config:????????/service/php/etc/??
  12. Installing?PHP?FPM?man?page:??????/service/php/php/man/man8/??
  13. Installing?PHP?FPM?status?page:??????/service/php/php/fpm/??
  14. Installing?PHP?CGI?binary:????????/service/php/bin/??
  15. Installing?PHP?CGI?man?page:??????/service/php/php/man/man1/??
  16. Installing?build?environment:?????/service/php/lib/php/build/??
  17. Installing?header?files:??????????/service/php/include/php/??
  18. Installing?helper?programs:???????/service/php/bin/??
  19. ??program:?phpize??
  20. ??program:?php-config??
  21. Installing?man?pages:?????????????/service/php/php/man/man1/??
  22. ??page:?phpize.1??
  23. ??page:?php-config.1??
  24. Installing?PEAR?environment:??????/service/php/lib/php/??
  25. [PEAR]?Archive_Tar????-?installed:?1.3.11??
  26. [PEAR]?Console_Getopt?-?installed:?1.3.1??
  27. warning:?pear/PEAR?requires?package?"pear/Structures_Graph"?(recommended?version?1.0.4)??
  28. warning:?pear/PEAR?requires?package?"pear/XML_Util"?(recommended?version?1.2.1)??
  29. [PEAR]?PEAR???????????-?installed:?1.9.4??
  30. Wrote?PEAR?system?config?file?at:?/service/php/etc/pear.conf??
  31. You?may?want?to?add:?/service/php/lib/php?to?your?php.ini?include_path??
  32. [PEAR]?Structures_Graph-?installed:?1.0.4??
  33. [PEAR]?XML_Util???????-?installed:?1.2.1??
  34. /service/software/php-5.5.6/build/shtool?install?-c?ext/phar/phar.phar?/service/php/bin??
  35. ln?-s?-f?/service/php/bin/phar.phar?/service/php/bin/phar??
  36. Installing?PDO?headers:??????????/service/php/include/php/ext/pdo/??
  37. [root@lnmp?php-5.5.6]#?cp?php.ini-production?/service/php/etc/php.ini??
  38. [root@lnmp?php-5.5.6]#?cp?/service/php/etc/php-fpm.conf.default?/service/php/etc/php-fpm.conf??
  39. [root@lnmp?php-5.5.6]#?/service/php/sbin/php-fpm??
  40. [root@lnmp?php-5.5.6]#?netstat?-lanp|grep?php-fpm??
  41. tcp????????0??????0?127.0.0.1:9000??????????????0.0.0.0:*???????????????????LISTEN??????5483/php-fpm.conf)????
  42. unix??3??????[?]?????????STREAM?????CONNECTED?????459737?5483/php-fpm.conf)????
  43. unix??3??????[?]?????????STREAM?????CONNECTED?????459736?5483/php-fpm.conf)????
  44. [root@lnmp?php-5.5.6]#?ps?-ef|grep?php??
  45. root??????5483?????1??0?23:19??????????00:00:00?php-fpm:?master?process?(/service/php/etc/php-fpm.conf)??
  46. webroot???5484??5483??0?23:19??????????00:00:00?php-fpm:?pool?www??????????
  47. webroot???5485??5483??0?23:19??????????00:00:00?php-fpm:?pool?www??????????
  48. root??????5497?24209??0?23:21?pts/0????00:00:00?grep?php??

安裝nginx
  1. [root@lnmp?software]#?tar?zxvf?nginx-1.4.4.tar.gz???
  2. [root@lnmp?software]#?cd?nginx-1.4.4??
  3. [root@lnmp?nginx-1.4.4]#?./configure?--prefix=/service/nginx?--with-http_ssl_module?--with-pcre?--with-http_spdy_module?--with-http_stub_status_module?--with-pcre?--user=webroot?--group=webroot??
  4. ........................??
  5. Configuration?summary??
  6. ??+?using?system?PCRE?library??
  7. ??+?using?system?OpenSSL?library??
  8. ??+?md5:?using?OpenSSL?library??
  9. ??+?sha1:?using?OpenSSL?library??
  10. ??+?using?system?zlib?library??
  11. ??
  12. ??nginx?path?prefix:?"/service/nginx"??
  13. ??nginx?binary?file:?"/service/nginx/sbin/nginx"??
  14. ??nginx?configuration?prefix:?"/service/nginx/conf"??
  15. ??nginx?configuration?file:?"/service/nginx/conf/nginx.conf"??
  16. ??nginx?pid?file:?"/service/nginx/logs/nginx.pid"??
  17. ??nginx?error?log?file:?"/service/nginx/logs/error.log"??
  18. ??nginx?http?access?log?file:?"/service/nginx/logs/access.log"??
  19. ??nginx?http?client?request?body?temporary?files:?"client_body_temp"??
  20. ??nginx?http?proxy?temporary?files:?"proxy_temp"??
  21. ??nginx?http?fastcgi?temporary?files:?"fastcgi_temp"??
  22. ??nginx?http?uwsgi?temporary?files:?"uwsgi_temp"??
  23. ??nginx?http?scgi?temporary?files:?"scgi_temp"??
  24. ??
  25. [root@lnmp?nginx-1.4.4]#?make?&&?make?install??
配置nginx
  1. [root@lnmp?conf]#?cat?/service/nginx/conf/nginx.conf??
  2. user??webroot?webroot;??
  3. worker_processes??1;??
  4. ??
  5. events?{??
  6. ????worker_connections??1024;??
  7. }??
  8. ??
  9. ??
  10. http?{??
  11. ????include???????mime.types;??
  12. ????default_type??application/octet-stream;??
  13. ??
  14. ????sendfile????????on;??
  15. ??
  16. ????keepalive_timeout??65;??
  17. ??
  18. ??
  19. ????server?{??
  20. ????????listen???????80;??
  21. ????????server_name??localhost;??
  22. ????????index?index.php?index.html?index.shtml?index.htm;??
  23. ????????root?/service/nginx/html;??
  24. ??
  25. ????????location?/?{??
  26. ????????try_files?$uri?$uri/?/index.php?$args;??
  27. ????????}??
  28. ??????????
  29. ????????location?~?.*\.(php)?$??
  30. ????????{??
  31. ????????expires?-1s;??
  32. ????????try_files?$uri?=404;??
  33. ????????fastcgi_split_path_info?^(.+\.php)(/.+)$;??
  34. ????????include?fastcgi_params;??
  35. ????????fastcgi_param?PATH_INFO?$fastcgi_path_info;??
  36. ????????fastcgi_index?index.php;??
  37. ????????fastcgi_param?SCRIPT_FILENAME?$document_root$fastcgi_script_name;??
  38. ????????fastcgi_pass?127.0.0.1:9000;??
  39. ????????#fastcgi_pass?unix:/var/run/phpfpm.sock;??
  40. ????????#php-fpm.conf?listen?=?/var/run/phpfpm.sock##??
  41. ????????}??
  42. ??
  43. ????????error_page???500?502?503?504??/50x.html;??
  44. ????????location?=?/50x.html?{??
  45. ????????????root???html;??
  46. ????????}??
  47. ??
  48. ??
  49. ??
  50. ????}??
  51. ??
  52. }??
  53. [root@lnmp?conf]#?/service/nginx/sbin/nginx?-t??
  54. nginx:?the?configuration?file?/service/nginx/conf/nginx.conf?syntax?is?ok??
  55. nginx:?configuration?file?/service/nginx/conf/nginx.conf?test?is?successful??
啟動nginx
  1. [root@lnmp?conf]#?/service/nginx/sbin/nginx??
  2. [root@lnmp?conf]#?netstat?-lanp|grep?nginx??
  3. tcp????????0??????0?0.0.0.0:80??????????????????0.0.0.0:*???????????????????LISTEN??????9867/nginx????????????
  4. unix??3??????[?]?????????STREAM?????CONNECTED?????465408?9867/nginx????????????
  5. unix??3??????[?]?????????STREAM?????CONNECTED?????465407?9867/nginx??????




本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/276389.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/276389.shtml
英文地址,請注明出處:http://en.pswp.cn/news/276389.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

FTP服務器的搭建

IIS IIS所提供的FTP功能比較簡單: 用戶依賴于“操作系統用戶”;只提供了全局讀(瀏覽和復制)、寫(刪除、修改、添加)功能設置,也就是說所有的讀寫權限都相同;“用戶”與“對應目錄”的…

一份熱乎乎的滴滴前端面經

關注若川視野,回復"pdf" 領取資料,回復"加群",可加群長期交流學習滴滴前端實習面經滴滴是我投簡歷之后第二家面試的公司, 國慶節前兩三天投的簡歷, 國慶后復工第一天就給我打了電話約一面。那時候…

用webBrowser取源文件取不到的點擊數--選秀榜selectop.com網站內容管理系統之六

用idhttp可以取到源文件,但網站用腳本代碼,源文件是看不到,并且代碼的結果也取不出。webBrowser可以多次返回下載到的內容,不包括任何html語法,這個當中就有文章的點擊數。在WebBrowser1DownloadComplete事件中處理&am…

Nginx負載均衡配置

轉載鏈接:http://blog.csdn.net/staricqxyz/article/details/16984029 將域名指向Nginx服務器 訪問www.test.com會轉發到192.168.1.22,192.168.1.23 user nobody nobody; worker_processes 1; events { worker_connections 1024; } http { …

linux查看python環境變量_Linux中添加PYTHONPATH配置anaconda環境變量方法

因為最近開發多智能體模型需要把自己寫的環境打包import,環境是統一的,如果不加入環境變量,每次測一個算法都要把包作為附屬腳本和算法腳本放一起非常麻煩。所以就想把這些寫的環境加入到python的環境變量里,這樣就不用每次測試都…

yii_wiki_145_yii-cjuidialog-for-create-new-model (通過CJuiDialog來創建新的Model)

/**** CJuiDialog for create new model http://www.yiiframework.com/wiki/145/cjuidialog-for-create-new-model/translated by php攻城師http://blog.csdn.net/phpgcsIntroduction Scenario Preparation of the form Enhance the action create The dialog Summary ***/Intr…

真誠推薦幾個最值得關注的前端公眾號

前端技術日新月異,發展迅速,作為一個與時俱進的前端工程師,需要不斷的學習。這里強烈推薦幾個前端開發工程師必備的優質公眾號,希望對你有所幫助。大家可以像我一樣,利用碎片時間閱讀這些公眾號的文章。code秘密花園一…

Silverlight Unit Test Framework

微軟在08年的時候推出了一個Silverlight的單元測試框架,該框架在Mix 08的時候與Silverlight controls同時推出的,微軟工程師Jeff Wilcox一直參與維護該單元測試框架。Scott Gu對這個框架的介紹Jeff Wilcox提供的視頻介紹該框架的源代碼已經包括在Silverl…

Nginx 反向代理、負載均衡、頁面緩存、URL重寫及讀寫分離詳解

轉載鏈接:http://freeloda.blog.51cto.com/2033581/1288553 大綱 一、前言 二、環境準備 三、安裝與配置Nginx 四、Nginx之反向代理 五、Nginx之負載均衡 六、Nginx之頁面緩存 七、Nginx之URL重寫 八、Nginx之讀寫分離 注,操作系統為 CentOS 6.4 x86_64…

[Jobdu] 題目1499:項目安排

題目描述:小明每天都在開源社區上做項目,假設每天他都有很多項目可以選,其中每個項目都有一個開始時間和截止時間,假設做完每個項目后,拿到報酬都是不同的。由于小明馬上就要碩士畢業了,面臨著買房、買車、…

How to: Display a Gradient Fill

To display a gradient fill 第一步:In Visual Studio, create a Smart Device project. 第二部:Add the Gradientfill and GradientFilledButton classes to your project. public sealed class GradientFill{ // This method wraps the …

能在任意一種框架中復用的組件,太牛了!

Web Component 是一種 W3C標準支持的組件化方案,通過它可以編寫可復用的組件,同時也可以對自己的組件做更精細化的控制。更牛的是,Web Component 可以在任何一種框架中使用,不用加載任何模塊、代碼量小,優勢非常明顯&a…

stm32cubemx中文_用 STM32 通用定時器做微秒延時函數(STM32CubeMX版本)

概述? 在使用 DHT11 的時候,時序通信需要微秒來操作,STM32CubeMX 自帶一個系統時鐘,但是實現的是毫秒級別的。因此就自己用通用計時器實現一個。文章目錄環境:開發板:STM32F4探索者(正點原子)1…

MySQL索引類型一覽 讓MySQL高效運行起來

轉載鏈接:http://database.51cto.com/art/200910/156685.htm 索引是快速搜索的關鍵。MySQL索引的建立對于MySQL的高效運行是很重要的。下面介紹幾種常見的MySQL索引類型。 在數據庫表中,對字段建立索引可以大大提高查詢速度。假如我們創建了一個 mytabl…

431.chapter2.configure database mail

SQL Database Mail SQL 2005數據庫郵件是一種通過 Microsoft SQL Server 2005 Database Engine 發送電子郵件的企業解決方案。通過使用數據庫郵件,數據庫應用程序可以向用戶發送電子郵件。郵件中可以包含查詢結果,還可以包含來自網絡中任何資源的文件。數…

人臉識別拷勤門禁主板_捷易講解AI無感人臉識別考勤門禁終端設備在使用中的維護方法...

人臉識別考勤門禁終端設備雖然在出廠時,都有做密封處理,但面對細小的灰塵,并沒有做到百分百防塵。灰塵對于AI無感人臉識別考勤門禁終端設備是有一定的影響的,他會沉淀在主板上、屏幕上,影響設備散熱和正常工作&#xf…

【翻譯】How-To: Using the N* Stack, part 3

原文地址:http://jasondentler.com/blog/2009/08/how-to-using-the-n-stack-part-3/ Java – 一種代碼松散的XML 在我們學習 Fluent NHibernate 之前, 應該先了解下老式的 NHibernate 映射文件應該是怎樣寫的。 在一個典型的 NHibernate 配置中,你會有很…

你可能需要的網易前端三輪面經

關注若川視野, 回復"pdf" 領取資料,回復"加群",可加群長期交流前言最近一個星期面了幾家公司,最后收獲了心儀的網易有道offer,于是推掉了其他的面試,至于一些其他大廠,并沒有投簡歷&am…

PHP yii 框架源碼閱讀(一)

轉載鏈接:http://www.th7.cn/Program/php/2012/04/03/67983.shtml 目錄文件 |- framework 框架核心庫 |-|- base 底層類庫文件夾,包 含CApplication(應用類,負責全局的用戶請求處理,它管理的應用組件集,將提供特定功…

復習.net/c#時的小文章之萬年草稿版 (全是基礎概念,請懂的人繞行)

必讀文:61條面向對象設計的經驗原則(體會篇) C#知識點集合 (面試必備)一、顯式(explicit)轉換和隱式(implicit)轉換的一般概念int i 100; Response.Write(i); // 這就是隱式 Response.Write(i.ToString()); // 這就是顯式 一般來講&#xff…