tid=211&《1》安裝nginx
1 V' z2 l9 R! e2 e2 |3 E- g3 _4 I yum install nginx& Q5 u0 P8 H- B; A [: I n( y3 ?
..........% y3 f) n* c% K5 J; }: G* R! l
Running Transaction& T/ x5 Y; w% ]: N6 i9 M/ t
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3( m+ t6 l# H* S0 D. m3 g% D
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3& T5 b9 {) p! T, S% F5 }; T& y
Installing : nginx-1.0.15-11.el6.x86_64 3/3" o U# `6 f4 ^9 B" V' [$ ~
Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3
V6 ^1 X ~9 I6 ` Verifying : nginx-1.0.15-11.el6.x86_64 2/3
8 S' R' |/ ` N1 _ Verifying : GeoIP-1.5.1-5.el6.x86_64 3/37 a# r: B' o) H# c* x7 h
4 o) G+ V' D. Z: K6 s, e, @
Installed:. W) A, ], _" D5 Y8 y4 ~$ |! l
nginx.x86_64 0:1.0.15-11.el63 K0 k/ [- r8 T' L$ `1 p
Dependency Installed:
j( q* I0 e" x3 I GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
5 L$ H* n1 a9 R* h" G' A/ S H4 tComplete!- A% G/ K0 R8 K& p- c% r, H
" x3 P S+ l2 A C4 h設定/etc/nginx/nginx.conf5 A' m" H* H; i8 M8 k4 h
. A9 a% n1 K9 \+ D' C
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html' e+ u* b3 Y, e2 ?6 m( r- p, V% |
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error. [$ N/ s* Z @
, A( I. I1 `% L1 O1 t
啟動php-fpm ⇨ service php-fpm start+ N. \2 s) u( B( U8 a& G
啟動nginx ⇨ service nginx start2 Y% ^5 Q& e" r k1 w# U5 O% a
〖結果〗:$ P. W6 O" P# W. u$ Q# v" X
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
" t) V1 e5 ^. |0 \0 F6 j% h〖解決〗:
/ g- D9 A d j. ?( Q( Z; @先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64- X6 m/ w$ O$ k3 d
再一次啟動nginx ⇨ service nginx start
2 }$ y1 Q! t+ `7 ^〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46, H& v; W4 m; |; |6 m
先查看nginx 的configure ⇨ /usr/sbin/nginx -V9 E* {: T) H! L: \
nginx version: nginx/1.0.15, K2 P) G' \/ n: n1 T
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
' n4 Q1 X. \; k, G7 G# ^6 ?TLS SNI support enabled7 H( d7 Q+ z# m; V3 U
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,-E6 s4 M5 s1 S& C
4 I$ R+ l( K5 a# g
, ?2 D$ {! _8 \+ V啟動nginx ⇨ service nginx start
H) u: \4 q: I% w7 G1 Terror : : V0 q5 [- O! d& t/ A
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40+ @! u, E/ }2 w# V
nginx: configuration file /etc/nginx/nginx.conf test failed9 s, w. y# P/ Y) H. Z
〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
5 d7 [) d, P/ U' V" U. SSELINUX = enforcing 改成 disabled 1 ]' X4 e' n% T5 F; }
5 s% h' ^$ y- L% B! G' v0 N' \
0 U5 g8 o8 o' t8 ^: L( e; @: I3 u1 L9 l+ ^0 A
3 f( J N5 R' F6 w. E/ ?1 X' R# v
|