tid=211&《1》安裝nginx4 `; ^/ m& L5 g! j6 m9 I! X
yum install nginx s4 @/ N( e2 `+ B
..........
4 b* G% t3 t0 L$ ~2 {+ {Running Transaction. L! |* }& R1 i7 C: W
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
1 ]1 l1 R1 @/ U0 E2 i4 o Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3$ B* T) `7 O* X3 a
Installing : nginx-1.0.15-11.el6.x86_64 3/38 k: r6 y: n' \) V G! _
Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3& s8 w0 T7 @8 H8 G7 T. [
Verifying : nginx-1.0.15-11.el6.x86_64 2/3
3 U. ?7 m2 j, }% @7 y Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3& m, j) y& W$ \% l- X
/ i. e7 H! ?" H }8 c# L1 a) u, z
Installed:$ j( m; C% X y! q- @: o5 v
nginx.x86_64 0:1.0.15-11.el6
+ W/ z6 `4 h$ G; r$ r" Y% ~" EDependency Installed:0 B8 c, v! u y; ?6 D, ]6 ?/ S
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
% c' E3 k6 Y& vComplete!
& t* {4 ^4 _ E3 P9 X' ?: O
+ `1 t! _. ~ g5 B( r2 l設定/etc/nginx/nginx.conf
& u5 q) F K: d/ l# w t4 r. H" Y: Q' h" H6 Q' M: h. B) u S" B* h
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html
1 b& }. }: G4 ]* D9 ^# ]- |) b設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error9 I- `) o) D& m8 a+ n) z
3 a7 h' ]% J. P( E, Y3 F啟動php-fpm ⇨ service php-fpm start* ~7 c$ ^# S6 q) t* }
啟動nginx ⇨ service nginx start
% q/ U: ?7 s2 G* ^" a〖結果〗:$ O% `: T9 p" q
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
5 ]' b7 e$ a! c7 E* k0 s〖解決〗:
" R7 P8 _* x# c先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib648 r& ?/ |0 Y5 v$ k4 z
再一次啟動nginx ⇨ service nginx start$ h, D" `8 C9 Y* W3 y
〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:467 P; m3 [9 O6 T! S( i3 O" N3 a
先查看nginx 的configure ⇨ /usr/sbin/nginx -V
3 g6 P, t/ I2 ~9 h, J, Onginx version: nginx/1.0.15. Z' z/ @: P8 I& Y1 Q y2 c+ n
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)1 J/ }1 w$ b& h* D
TLS SNI support enabled1 s; h3 p9 E4 V$ b6 t5 X
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
! ?! M) u! y4 N8 E) M0 M+ V . ~/ x1 g8 c) O5 p) h8 F
# r3 b7 M3 t4 E啟動nginx ⇨ service nginx start
& ?3 r* v. Y8 p& B L; b merror :
. }6 s1 I: w3 Nnginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:407 T) @4 ]; Y' u- t# R; @/ l' p
nginx: configuration file /etc/nginx/nginx.conf test failed& s4 c! A( N$ ~) z1 n5 w% ~# w$ y
〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了9 r, G8 \/ @* f6 B
SELINUX = enforcing 改成 disabled 5 |4 W7 U; Q8 c& Y( D
7 O8 Q3 U2 |& V! j( x$ G, I5 E8 F0 n/ X2 m
5 {3 h7 ^ C$ f& v) V8 U
% S* j( K2 \1 D8 a. } B7 |: Y |