52AV手機A片王|52AV.one

 找回密碼
 立即註冊
查看: 1885|回復: 0

[網頁伺服器] Nginx + PHP-Fpm

[複製鏈接]
發表於 2015-1-11 00:18:11 | 顯示全部樓層 |閱讀模式
tid=211&《1》安裝nginx5 E' @% v2 B, I0 b9 t
yum install nginx
  Z6 \5 E$ f# M# h# p..........
4 J) K4 [) U" aRunning Transaction
* J" s3 d% C- Y& A# z  Installing : GeoIP-1.5.1-5.el6.x86_64                                               1/3
* E3 Q. {3 R1 G6 N; U4 j5 z4 ]. \  Installing : nginx-filesystem-1.0.15-11.el6.noarch                                  2/3
: M# J- Z9 [; z' j8 o) N/ f  Installing : nginx-1.0.15-11.el6.x86_64                                             3/3
' e& c+ B3 w% _  l  Verifying  : nginx-filesystem-1.0.15-11.el6.noarch                                  1/3( m: U* j9 b7 ~9 B7 B9 {% t
  Verifying  : nginx-1.0.15-11.el6.x86_64                                             2/31 k2 e4 T9 b$ h* {6 W
  Verifying  : GeoIP-1.5.1-5.el6.x86_64                                               3/3
+ T7 k2 ]8 ^# Q/ i" L
. p$ \2 ?8 n- }Installed:
: v( c# \6 c2 n2 v7 S  nginx.x86_64 0:1.0.15-11.el6
, G- V+ U0 C7 \1 ]" X' {; aDependency Installed:  x  W6 Z1 @. Z2 C
  GeoIP.x86_64 0:1.5.1-5.el6            nginx-filesystem.noarch 0:1.0.15-11.el6
0 [1 T4 q3 S( C  {Complete!$ j$ i, Z. U5 ?) Q6 s  ]+ H6 z% A

$ j, m0 k7 B8 b% u& c0 y' e設定/etc/nginx/nginx.conf
& X  T3 [% D" `7 ]# N

# p: G# v) P) N$ V
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html  k- a$ X5 R8 C1 C& H
設定 /etc/php-fpm.d/www.conf  user and group  = nginx (default  apache)  ==> still error
8 D* I0 T% W& D
- n' d4 v- R8 q) r# m& a
啟動php-fpm service php-fpm start7 B5 |! |5 d( D4 h
啟動nginx      
service nginx start, b  D# ~, T* D- a7 i* n8 k
結果
2 p! a) ]* \* ?* @: s% b5 q出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
0 @/ }. _. K- W3 G$ h7 F" K
解決
( D7 g0 W# V; z8 o7 e先找libgd.so.2 在何處(locate libgd.so.2*)
結果在/usr/lib64/libgd.backup所以cp /usr/lib64/libgd.backup/libgd.so.2*  /usr/lib64
9 |% {0 @. x, Y: l再一次啟動nginx
service nginx start
  m0 [% b' F9 F& P6 a1 @' q* J
結果nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46+ [' |0 f* H( H7 w* `3 m5 F
先查看nginx 的configure /usr/sbin/nginx -V: E0 O% |" k- H& Y
nginx version: nginx/1.0.15
; Z1 r' C) L. e0 f+ h& `; o! X# Z0 Lbuilt by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
  x4 i# v2 q1 X9 n( k' XTLS SNI support enabled

  g, Q2 B3 u3 q& W& `3 Qconfigure arguments: --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail --with-mail_ssl_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=-Wl,-E4 C, y: o7 ?: w+ Y2 Z, h
" k! R% I; o! P' }
) `' e/ t# e( a0 c& G/ [& A
啟動nginx       service nginx start   
! F% a4 I0 J! j( t0 b7 yerror :
$ s+ `4 K5 {$ g( W& r( onginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
4 W' E$ x! w, ?" X4 _4 {nginx: configuration file /etc/nginx/nginx.conf test failed
2 y; P: b- V. [5 |* V5 |解決
將/etc/sysconfig/selinux 內的 enforced  設成 disabled    then   reboot    就可以了
6 M7 w1 A, i3 C) v+ ^& ?: uSELINUX =  enforcing    改成   disabled 6 k! ~7 G: u& i: h+ I- Q9 z& T& j
& G! j6 H  I! [. A' `
& `6 z' t+ o1 z; h* t
8 g0 U# N) X: z1 g9 G  b

% n2 ]3 i/ Y8 I0 ~0 P
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則



中文酷站排行榜

本區塊內容依據『電腦網路內容分級處理辦法』為限制級網站,限定年滿18歲以上或達當地國家法定年齡人士方可進入,且願接受本站各項條款,未滿18歲 謝絕進入瀏覽。為防範未滿18歲之未成年網友瀏覽網路上限制級內容的圖文資訊,建議您可進行網路內容分級組織ICRA分級服務的安裝與設定。 (為還給愛護 本站的網友一個純淨的論壇環境,本站設有管理員)

QQ|小黑屋|手機板| 52AV手機A片王

GMT+8, 2025-4-5 19:20 , Processed in 0.066442 second(s), 16 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回復 返回頂部 返回列表