tid=211&《1》安裝nginx
2 X$ ^8 }# ^" Q4 d9 _ yum install nginx/ x9 e. @5 z3 x/ @0 Q
..........- \$ k% q% R L% U: d+ W# ?4 |, a' x
Running Transaction
5 c6 \: ~% o2 j. |4 D0 L Installing : GeoIP-1.5.1-5.el6.x86_64 1/3$ v$ K7 G% S) t. q0 L4 A* y) C
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
8 [* Q- E0 m0 C# r2 N Installing : nginx-1.0.15-11.el6.x86_64 3/3
; T; h+ e8 D: }6 |; ^- I Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3* Z* C" G, n1 v; i$ L% p( Q
Verifying : nginx-1.0.15-11.el6.x86_64 2/3* M& a* O6 g2 G8 i
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
, p+ J# ^: n, Z! g
9 ?: k4 U ?# K8 u! U1 \# TInstalled:
0 q7 Z& k. }5 ]- W j8 w+ v nginx.x86_64 0:1.0.15-11.el6
# I7 ^# I% j$ e( vDependency Installed:4 @* M) O4 ^) X% n- a3 K4 N
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
% i* W- k3 E7 y# i' \Complete!- B1 O9 d6 v* v9 K3 L
9 ?" D: q, a% u7 T& n: K" x設定/etc/nginx/nginx.conf# X0 X2 G! O0 c6 i; J( A( c+ x* y
$ x* C, P; ^9 C( x: K; Y
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html
$ E* B1 D8 g3 r# n3 ]& I1 e設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error; J. I/ P4 B s
, f" R' L# v' K$ |2 ]% ~啟動php-fpm ⇨ service php-fpm start
% H" l( m* Y0 W. S5 v) t啟動nginx ⇨ service nginx start
% X& z6 V/ u1 T; J, @! R〖結果〗:
/ J/ B4 ?- X# l! M1 W出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory f( h- Q( ^: C: z; Y8 G! J. ^6 V
〖解決〗:
/ E; p- C3 `. a: L: u先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib647 U7 f0 x" Z. h x t8 F: a! C
再一次啟動nginx ⇨ service nginx start) J I$ n/ i T+ s
〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
4 z; q9 ^1 n: l' ]% i, T% {# c先查看nginx 的configure ⇨ /usr/sbin/nginx -V. v/ E- [* \! P% I$ a" e
nginx version: nginx/1.0.15$ j0 N$ e/ y& y; ~$ }
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
# [ G4 X7 b+ u$ sTLS SNI support enabled9 @+ ?% U& x8 j% w( Y1 w9 G
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
; L3 M; @# \# W- C. }5 a6 Z- ` - r6 E+ h) ~; x/ @5 {. ]
5 n: b x) t+ O/ J* |3 F |0 H
啟動nginx ⇨ service nginx start
. b) m0 a1 ^- I4 Z! T) y; Yerror : 5 ^4 g7 |; G$ A
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
3 M2 C8 R9 O% ^: @& F- V6 Fnginx: configuration file /etc/nginx/nginx.conf test failed% x/ |& T: {6 N3 P) K
〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
3 [$ F! N2 F& U$ Z3 Y2 pSELINUX = enforcing 改成 disabled
2 o; x$ ~2 _" v$ ]# ]6 C
: g p2 d* l' R9 R0 X) [* `! x" X
$ t; k" I6 G) |# s8 U( w4 H& F' g' w( s1 ]# C5 I
! R7 i3 d, q$ E' g1 H [5 ]
|