tid=211&《1》安裝nginx
# t/ b% b; M3 N; J. I yum install nginx, }, h L9 y9 M% W# x9 k, B
..........2 G, ? r! C- ?' U, K5 z. l
Running Transaction' i, P1 o6 Z7 n
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
+ p2 q0 P/ h. H. e3 E2 }! @! @" _ Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
0 P0 l+ T4 Y4 `# e' G4 ~6 H$ V) B3 o Installing : nginx-1.0.15-11.el6.x86_64 3/3
; }5 O8 L' W( ?- u- i7 A& G Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3' G7 I T* P) J* m7 R
Verifying : nginx-1.0.15-11.el6.x86_64 2/31 j5 x! T( |" J
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
; U& q9 f" g! p- k+ b/ A% X6 v+ ^5 w: r2 {3 Q+ {5 a
Installed:: [3 R8 a* u$ t) ]0 ]
nginx.x86_64 0:1.0.15-11.el6- y5 o0 R1 `" ^% c( B! z
Dependency Installed:% m% E4 {) V! T% q
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
4 m! I) v7 p* k Q0 iComplete!) U9 \; J# l Q! I( t
7 P: H8 ~$ ^2 B, _9 |設定/etc/nginx/nginx.conf
% P& R% i$ u: \, ^( h3 F- \5 `1 h1 t. r6 y/ u4 P S7 I
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html3 c% X! h) g5 `
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error. u) e& q5 f$ a6 W5 P' [* ^9 H
3 A+ }4 {+ i( s3 T2 I& y啟動php-fpm ⇨ service php-fpm start
; V0 K# _* F5 l' c& V啟動nginx ⇨ service nginx start
" f8 A7 ^6 Y; K' k3 W5 `6 k〖結果〗:
4 Y* o- [5 e/ g& Z2 \出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory* A% ^4 w$ L; e; f2 e2 y
〖解決〗:( d. Y0 r/ Z1 z" L
先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib642 Y5 R( u ?7 P6 k
再一次啟動nginx ⇨ service nginx start5 m; h7 W& `5 [8 l' F. t
〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46, z6 x- L4 Q2 o" L' I' y
先查看nginx 的configure ⇨ /usr/sbin/nginx -V
! g2 K l3 K& u3 y+ |& g: d, v# |nginx version: nginx/1.0.156 L; Q* u- b" X
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)' ^# V; ?# V. |7 V2 r
TLS SNI support enabled$ ]: t) d l! d4 S
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
- n; h/ \$ L( z) ]4 U1 j @2 x, T- P
. D+ C. d/ o; k9 z5 M" C% Y) `# S
啟動nginx ⇨ service nginx start
4 U' {6 F( A0 z- O$ n" _! K2 jerror : " Y9 i) `) X4 s6 N0 T) a
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40& x0 N' Q: H2 G2 M
nginx: configuration file /etc/nginx/nginx.conf test failed/ E( m: x" A: B) I; `5 l
〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
5 Y# O* a3 n, o% I: aSELINUX = enforcing 改成 disabled 2 K, l4 m- P$ H1 o. W- J" i
! U8 h/ G; L" E2 c
; E/ ~% x8 N( L) P4 _. T. B8 ~
( j. z! `. q5 V+ F4 G$ Q& \. p5 Z
8 o$ Q- r) \7 ?$ g7 i# a& \9 ~ |