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

標題: Nginx + PHP-Fpm [打印本頁]

作者: IT_man    時間: 2015-1-11 00:18
標題: Nginx + PHP-Fpm
《1》安裝nginx
0 s1 J' S8 W) r* W) O! t9 G  E yum install nginx
5 I. ~' p# M6 t6 U$ {( @4 M# x& H..........# t6 M+ y6 z2 q" b% ^, f
Running Transaction2 v1 N) M6 q% @- [9 l
  Installing : GeoIP-1.5.1-5.el6.x86_64                                               1/3  t5 m. Q( d. C; v
  Installing : nginx-filesystem-1.0.15-11.el6.noarch                                  2/3) {4 D. F$ g/ q  C5 q9 Y
  Installing : nginx-1.0.15-11.el6.x86_64                                             3/3  f5 L- M# n7 T+ q9 Z/ o) N0 q6 O+ e
  Verifying  : nginx-filesystem-1.0.15-11.el6.noarch                                  1/3
  A" E8 g$ v4 ~9 r7 I  Verifying  : nginx-1.0.15-11.el6.x86_64                                             2/3
% }% k, E9 k6 Y" J0 ?1 h( W. k  Verifying  : GeoIP-1.5.1-5.el6.x86_64                                               3/3
% q; ^- o1 V) g3 f( g
7 y: X. o6 B5 z. fInstalled:
9 Y* o' |9 h$ @4 k) _' x$ f  nginx.x86_64 0:1.0.15-11.el6
9 K: R5 f' [4 r  s& C% |4 wDependency Installed:) {# B7 R' ]9 Z8 p! U
  GeoIP.x86_64 0:1.5.1-5.el6            nginx-filesystem.noarch 0:1.0.15-11.el60 n+ Z5 u0 j! R
Complete!4 Q) ^& ]9 F, z7 {2 h3 X
4 i  G- H2 U1 s- j1 J* F8 V
設定/etc/nginx/nginx.conf

1 h, a$ b/ A) i, T& k5 c5 M+ ?! q2 D3 Z8 k5 v
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html) A3 z2 x+ _: x
設定 /etc/php-fpm.d/www.conf  user and group  = nginx (default  apache)  ==> still error1 j! r8 D7 W+ I+ P
8 B' v* t# s- Z" y7 O: i9 [
啟動php-fpm service php-fpm start# e  n$ t* v1 r3 `: ^
啟動nginx      
service nginx start. Y( u+ @" {* D. A, u; U
結果# `9 e2 m/ _  G
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory

: X3 B' h' p4 e; g; R解決
2 O* K5 O# x! I3 {5 U# \8 _3 w0 b先找libgd.so.2 在何處(locate libgd.so.2*)
結果在/usr/lib64/libgd.backup所以cp /usr/lib64/libgd.backup/libgd.so.2*  /usr/lib644 Y2 a6 j1 L* Z% z
再一次啟動nginx
service nginx start' Q/ j+ G6 P( b0 g* _
結果nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
2 v0 W" b; Z0 g先查看nginx 的configure /usr/sbin/nginx -V
# H& [: W5 Y3 Lnginx version: nginx/1.0.150 a0 n/ m: q$ o; z  q
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
9 k  k, e! o* ]0 o2 ]( Z- GTLS SNI support enabled

4 I. {( ^) [$ C0 k/ J! Jconfigure 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,-E, ~* S5 ?" c$ S
. L& @5 W, {; u6 Z& e2 _+ K

. g8 v( E& h7 Z9 @1 Y! O: E. B1 p( `啟動nginx       service nginx start   ' r% m1 Y9 c& X* Z1 \: c: _
error : $ y$ ~( X+ m! q7 Y
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
, y/ [" q2 ]  o  Rnginx: configuration file /etc/nginx/nginx.conf test failed
: T" z* N* E- `9 Z4 a! r解決
將/etc/sysconfig/selinux 內的 enforced  設成 disabled    then   reboot    就可以了
! N0 J3 B- f4 m* j; i6 p4 {" ~$ USELINUX =  enforcing    改成   disabled
* |9 |% [7 A- b4 w( Q4 @' a+ a5 N

9 H& A& J% ^9 p& s
1 E2 b4 w( x6 k5 K$ K5 U2 Z
- V+ ?0 W0 Z' g9 `; {7 C

0 j7 V9 X5 g: S




歡迎光臨 52AV手機A片王|52AV.ONE (https://www.52av.one/) Powered by Discuz! X3.2