tid=211&《1》安裝nginx
# f0 C) R' Y- h+ H yum install nginx; b% a7 [% A5 l m: p
..........
, @8 I& s" \! ORunning Transaction0 x+ M+ N6 E# D9 Y$ Z
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3: ]' S f. f* j1 E
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
& t1 F0 Q6 Q1 M- t* v7 ? Installing : nginx-1.0.15-11.el6.x86_64 3/3
9 m7 t" ~- x; q# F- x Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3- F3 i _7 F# r% m" l
Verifying : nginx-1.0.15-11.el6.x86_64 2/3
8 Y' Q; i/ Q7 U+ T" h! J O Verifying : GeoIP-1.5.1-5.el6.x86_64 3/33 O, {% I6 B0 U" g% [7 w
& H9 e6 a: X2 _" s2 y: W# C
Installed:
/ P7 r" V' a( S nginx.x86_64 0:1.0.15-11.el67 j; a# q* i4 m- W# O& U: R8 \
Dependency Installed:5 W8 E" D! I% b+ L( w4 Y
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6$ R: I) Z( W! B! q% w
Complete!) O8 I$ G9 r: m1 t' Y
3 r; [* g* |- ?. X c設定/etc/nginx/nginx.conf6 o; \6 z. d! V9 @+ |2 \
5 C" e8 c9 o8 r* g
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html w. u* @: u8 k* U) ~5 P
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error1 S. v( w ^: U3 l
9 }# H2 U0 q3 Z; p! i( [7 Z
啟動php-fpm ⇨ service php-fpm start
$ c' _7 _, I8 D8 ^啟動nginx ⇨ service nginx start3 @+ N* `! ^$ K* J2 X2 f/ k
〖結果〗:
8 g) w+ A: Y% I8 c出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory2 |/ i, ]: a+ M# O! m: l
〖解決〗:
, W' D @, x7 }8 r先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64: z5 |5 Q5 A6 J8 E$ [( P0 w
再一次啟動nginx ⇨ service nginx start
: @1 ?' O# A4 d# X* @2 R〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46: j v5 F: m/ _& l* f4 u
先查看nginx 的configure ⇨ /usr/sbin/nginx -V
' W& `( t: m9 Z/ ~5 V# ^nginx version: nginx/1.0.157 A" L( X( e n0 x" l
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) `+ H! l+ w- @3 g" r9 R/ x
TLS SNI support enabled
; ?7 D6 {) ?- h0 Uconfigure 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) j, v( s X5 S8 F2 b! R . S, h' D8 V# ]
1 N: C. d+ l+ n$ k5 B
啟動nginx ⇨ service nginx start
/ F, [; @1 H/ h/ Xerror : " `# |! D% |; m* L# B
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
- T, P2 c% Y- o8 H! S, Unginx: configuration file /etc/nginx/nginx.conf test failed
$ b, s) T1 @5 {$ t5 o. G〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
4 p6 Z6 y6 v9 n- o1 K. P3 RSELINUX = enforcing 改成 disabled
* V' _+ p3 ]$ Z3 v" v- i* N
; y3 p% R `+ s4 t' m
( @+ u! @ U% g: h$ F3 n6 J0 c- r5 V$ }
; q; U5 v6 `& ~8 l |