tid=211&《1》安裝nginx5 E' @% v2 B, I0 b9 t
yum install nginx
Z6 \5 E$ f# M# h# p..........
4 J) K4 [) U" aRunning Transaction
* J" s3 d% C- Y& A# z Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
* E3 Q. {3 R1 G6 N; U4 j5 z4 ]. \ Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
: M# J- Z9 [; z' j8 o) N/ f Installing : nginx-1.0.15-11.el6.x86_64 3/3
' e& c+ B3 w% _ l Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3( m: U* j9 b7 ~9 B7 B9 {% t
Verifying : nginx-1.0.15-11.el6.x86_64 2/31 k2 e4 T9 b$ h* {6 W
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
+ T7 k2 ]8 ^# Q/ i" L
. p$ \2 ?8 n- }Installed:
: v( c# \6 c2 n2 v7 S nginx.x86_64 0:1.0.15-11.el6
, G- V+ U0 C7 \1 ]" X' {; aDependency Installed: x W6 Z1 @. Z2 C
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
0 [1 T4 q3 S( C {Complete!$ j$ i, Z. U5 ?) Q6 s ]+ H6 z% A
$ j, m0 k7 B8 b% u& c0 y' e設定/etc/nginx/nginx.conf& X T3 [% D" `7 ]# N
# p: G# v) P) N$ V《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html k- a$ X5 R8 C1 C& H
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
8 D* I0 T% W& D
- n' d4 v- R8 q) r# m& a啟動php-fpm ⇨ service php-fpm start7 B5 |! |5 d( D4 h
啟動nginx ⇨ service nginx start, b D# ~, T* D- a7 i* n8 k
〖結果〗:
2 p! a) ]* \* ?* @: s% b5 q出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory0 @/ }. _. K- W3 G$ h7 F" K
〖解決〗:
( D7 g0 W# V; z8 o7 e先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64
9 |% {0 @. x, Y: l再一次啟動nginx ⇨ service nginx start
m0 [% b' F9 F& P6 a1 @' q* J〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46+ [' |0 f* H( H7 w* `3 m5 F
先查看nginx 的configure ⇨ /usr/sbin/nginx -V: E0 O% |" k- H& Y
nginx version: nginx/1.0.15
; Z1 r' C) L. e0 f+ h& `; o! X# Z0 Lbuilt by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
x4 i# v2 q1 X9 n( k' XTLS SNI support enabled
g, Q2 B3 u3 q& W& `3 Qconfigure 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,-E4 C, y: o7 ?: w+ Y2 Z, h
" k! R% I; o! P' }
) `' e/ t# e( a0 c& G/ [& A
啟動nginx ⇨ service nginx start
! F% a4 I0 J! j( t0 b7 yerror :
$ s+ `4 K5 {$ g( W& r( onginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
4 W' E$ x! w, ?" X4 _4 {nginx: configuration file /etc/nginx/nginx.conf test failed
2 y; P: b- V. [5 |* V5 |〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
6 M7 w1 A, i3 C) v+ ^& ?: uSELINUX = enforcing 改成 disabled 6 k! ~7 G: u& i: h+ I- Q9 z& T& j
& G! j6 H I! [. A' `
& `6 z' t+ o1 z; h* t
8 g0 U# N) X: z1 g9 G b
% n2 ]3 i/ Y8 I0 ~0 P |