tid=211&《1》安裝nginx0 P& U2 d6 A! N! B& ]
yum install nginx- Y+ K0 d, ] N! B. `) @
..........1 n. f0 X' v' H" f/ o
Running Transaction
8 D* y) W9 W x% D Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
( L; W6 j3 r3 c* F, t3 N Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
' V9 F8 w+ j( k- r g/ I* f Installing : nginx-1.0.15-11.el6.x86_64 3/3- x; Z2 U5 Z$ Y% ^9 M4 z1 D
Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3
& \3 M, p4 ^" d- g8 v; @ Verifying : nginx-1.0.15-11.el6.x86_64 2/3& N' v# h/ v3 l; ?& V+ f$ M. o. \
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
5 m9 k0 L" U: b, t
$ ^( D9 x$ i5 } x& gInstalled:
; a6 t. ?4 }, V! O nginx.x86_64 0:1.0.15-11.el6
; e. @4 Z# h! v! t5 T) hDependency Installed:
+ y$ U0 f" B9 n7 `" J( k* o GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
1 r- v; _2 R* S) e5 a& ?Complete!& Z! W7 q& o+ A% w3 P; u5 ?+ o' V9 Q
8 r, }* J4 H* K% c設定/etc/nginx/nginx.conf V' A/ J) q+ D, I9 B$ `
5 ?% Y* \- X. [, a5 p o《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html+ x. p6 @' s4 c% b
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error- g) X3 s, L3 X
* f2 H" B, c, |7 R2 u! \
啟動php-fpm ⇨ service php-fpm start* T- Q) A1 f$ @3 h
啟動nginx ⇨ service nginx start( o5 C+ |: N. A" E- R
〖結果〗:
1 U8 O1 }% c1 q$ t# O: O* t' @出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
* V4 a' @, h, t8 |* Y〖解決〗:; v- R; f/ f' v0 a
先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64
9 W% }8 C6 N0 `再一次啟動nginx ⇨ service nginx start
7 B$ O+ V2 W; c( X" T9 E( M+ }〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46. w: ^" N$ w6 p$ a A
先查看nginx 的configure ⇨ /usr/sbin/nginx -V- w( y) {$ z3 \5 }- q' K% ^0 P
nginx version: nginx/1.0.15
% R: U: R9 R# K: ybuilt by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
; f- [9 ` B7 ?3 bTLS SNI support enabled! D8 v: Z8 h/ r
configure 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
+ g; d0 h/ E, m; t. _
5 ]4 E, u3 v8 d- s7 ^" u
' R/ o) ], [5 H! _- B啟動nginx ⇨ service nginx start - a+ n( d5 U& J7 G% O
error :
4 G! T! U9 z* Q- A- w- Qnginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
( Z* C8 ?3 U" p H- Z' Cnginx: configuration file /etc/nginx/nginx.conf test failed
9 c( |# A5 j8 \6 D- p, d C6 W& C" o〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
2 A) I" v1 X5 _; C3 iSELINUX = enforcing 改成 disabled
8 m) M" T$ H3 u$ a$ t
( ^) N/ V1 W' \6 E/ r# ]& X8 k* p+ s/ \! j) Q" W8 y. r8 C
7 ]/ d* V C( ?' w: ?! e/ r! a7 k0 L# P6 G3 F& n! e* O2 d
|