tid=211&《1》安裝nginx; Z/ s, x' d- ^: l% ?& R
yum install nginx+ P; x8 m3 X M. h9 O) D3 [
..........4 q' g' h- d- B0 [- ?0 |7 D& z
Running Transaction3 n* k3 L" S6 H+ l7 ~/ }8 F9 J* v
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3$ T9 ~7 J+ x' c
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3. B' q# {! D& x! T
Installing : nginx-1.0.15-11.el6.x86_64 3/3
0 N3 h* z2 U) o Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3 o% P7 f, |# ?; C$ W, h
Verifying : nginx-1.0.15-11.el6.x86_64 2/31 {1 B; H8 Q8 ^% A! i6 \+ x
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
6 X& J1 Q! {5 p0 J1 p- }. V6 ?; l3 ~$ C+ k+ n! I
Installed:, }+ X- E" V& q$ {0 T8 z+ o
nginx.x86_64 0:1.0.15-11.el68 g2 r( e& K7 g
Dependency Installed:
7 B, N! A f4 c) ?' x V& b& s GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
' O( T9 G: H% ~3 nComplete!
3 T0 f. Z) h! \& q2 q7 g( ^5 v% M7 ^ ?2 j
設定/etc/nginx/nginx.conf
5 ]6 e! W" T0 ]! d& @# Y/ u8 G; h w, q
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html4 U1 D) v/ E7 p1 \4 ?
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error( C* n) n/ i. {" W V' m! G8 A
4 _2 @: [& O+ R7 z/ N8 D
啟動php-fpm ⇨ service php-fpm start+ i& L0 w# M: L
啟動nginx ⇨ service nginx start
8 o+ w! Q, i, [" z2 J〖結果〗:
. Y' U8 m) Q+ }3 E' c出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory3 ?6 s# V3 |5 j; B: l! b. N
〖解決〗:
. n5 X& j- @: R" I先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64
2 j: H6 D% I' Q% ~6 L- W; E( x再一次啟動nginx ⇨ service nginx start" ]6 |+ Q9 F' O" d
〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
0 s' a0 I1 g! U5 T8 U先查看nginx 的configure ⇨ /usr/sbin/nginx -V
/ d |/ e L m9 t5 r1 e$ R. Snginx version: nginx/1.0.157 L/ L% g( S# e; [2 E$ {$ a
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)2 I+ W! Y# H8 V1 B' u0 C9 E$ H7 y
TLS SNI support enabled
2 C3 N! L- V* w0 H0 r! Dconfigure 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
" P# b- X* E. b4 y& I N
) S* K+ _8 _7 P' G+ \ n) Q0 H. p0 ^# F5 k% H
啟動nginx ⇨ service nginx start
, [( e* g% z- eerror : 4 e c; f4 |/ M
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40; w8 r# t; z! K% N
nginx: configuration file /etc/nginx/nginx.conf test failed
" f* t' e& M* X4 g8 j* v ?〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了" b* \$ a$ _1 Q. T9 _: @
SELINUX = enforcing 改成 disabled
! p7 b1 m9 N, i6 M. k
( G! R& b/ U, I3 w5 ^6 f9 O9 {
4 _7 E* ` }0 i4 g ]9 z) Y3 L# x: Q7 P* a; o2 K" o
/ u, o/ l9 D, k$ I% D& W8 f1 R |