tid=211&《1》安裝nginx1 j& b# d6 _0 j5 e8 k# n3 ?$ a- i% {0 \
yum install nginx& H: p e% S+ W3 L
..........
4 y3 j) f4 V7 p5 Z4 |) hRunning Transaction/ u) c8 i9 K: Q, r. L+ O
Installing : GeoIP-1.5.1-5.el6.x86_64 1/39 I V1 g) D8 X6 ^
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
$ m" h n4 x9 R1 Y7 J Installing : nginx-1.0.15-11.el6.x86_64 3/3
5 V2 ^+ k7 D. D8 ]; Z5 f Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3! _8 g! E! S$ h
Verifying : nginx-1.0.15-11.el6.x86_64 2/3
' R" ^5 H: A- d6 ] Verifying : GeoIP-1.5.1-5.el6.x86_64 3/38 G4 E( w2 a& L( @
2 C3 U( m2 q+ J6 Y& Q! K
Installed:" M$ C7 J" ~" p1 G4 U
nginx.x86_64 0:1.0.15-11.el6
0 B( v* r; z; w5 p DDependency Installed:
/ [" W. Q( p4 v0 | GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
7 t, I9 O0 k( z9 L! [7 z- uComplete!& {1 A- q: z: H' B" I
& C7 u: i. V* o設定/etc/nginx/nginx.conf
5 f: V; [3 R8 s' j8 }* f: g( N4 n& b# x' C* Y4 L8 g* y6 i$ q
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html9 K$ x) F( c& n+ h! Y
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
; K0 h+ v% d! P9 B" i3 q5 L
6 {% V) \# }7 D. W; [5 a啟動php-fpm ⇨ service php-fpm start/ E4 C( ]6 n6 i5 V/ ~6 r
啟動nginx ⇨ service nginx start
0 Z! h- D: M7 e$ o% h3 C, s) m〖結果〗:6 ]5 h+ V4 l% t5 `% E
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory6 @8 l) z- N% G/ S' A" y
〖解決〗:2 J0 S; b7 y0 N* d
先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64( ~2 o1 Z' f3 q/ ^- i& `, l
再一次啟動nginx ⇨ service nginx start+ K, d7 D4 r; q6 k0 R3 i2 \) {" G
〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46$ w& C& q. A1 S: h f. h5 o
先查看nginx 的configure ⇨ /usr/sbin/nginx -V/ v: @5 X" l+ G$ Z6 D+ G
nginx version: nginx/1.0.152 i9 G5 I. p. X3 B
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC): C/ z4 ~/ r# y2 H* y- p
TLS SNI support enabled
* r+ p7 u4 V8 I ?$ Cconfigure 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
$ c _% B# j/ H
X& W$ C+ u1 \
0 i1 a8 Q7 M# I7 [0 \. f啟動nginx ⇨ service nginx start
, y3 T5 ^/ Z; `: c, T/ ~* Gerror : ' {2 f1 ~ Y0 r7 H( _2 B' W1 B
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40& U+ H- N$ ^1 T9 E! a1 X
nginx: configuration file /etc/nginx/nginx.conf test failed) k5 b$ Z D5 {9 _
〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
4 `+ z/ w0 r) ?4 N i2 kSELINUX = enforcing 改成 disabled
; A+ v% M/ V0 E3 A4 W; M. n6 x
* H, c( h5 ?: E' V$ C
, S# @0 a* D( Q& f: a! J- d
* D1 ~. J5 F' `+ L3 v' M6 {. h5 V$ W3 s6 h
|