tid=211&《1》安裝nginx
. t! X, @" s/ D: x yum install nginx, S8 G& z) Z; u2 X: _! d& \
..........
% b) C7 U- p7 W" Q% T0 D4 HRunning Transaction
1 j0 W# h. f5 b4 r Installing : GeoIP-1.5.1-5.el6.x86_64 1/3. e) p, I( w* W* x
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
9 m6 y2 c' l9 O4 ? f1 ]. E0 K. Y Installing : nginx-1.0.15-11.el6.x86_64 3/3
& e9 [4 d2 R4 ?( { w6 s* v Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3/ _. X5 U4 n0 w+ w3 e+ b' x
Verifying : nginx-1.0.15-11.el6.x86_64 2/3
. e$ T s9 S2 q Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
" {3 w2 d7 m2 y: b0 y& K) P3 w
n$ O9 `) {' L! ^5 UInstalled:
5 W+ ?, o! {. x( R K" A. S) @ nginx.x86_64 0:1.0.15-11.el6
. ~* @) ^) W6 L0 _Dependency Installed:. q2 F5 j) y% J2 g+ h' Y
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
/ U; J1 _/ w2 t) xComplete!
' O( u* f2 z N" k' g
) P6 c! C( k3 x9 X9 E, g3 z設定/etc/nginx/nginx.conf
; ]" G( C" f4 N% b* M/ p" n0 y1 D# g8 G: i4 z
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html
( s. ]3 ?* [5 q* ]設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
6 J2 H* |+ @/ _4 W5 [) A1 A
+ |2 U; u E% H; h6 P s! L# d7 x啟動php-fpm ⇨ service php-fpm start6 L! i4 y( ? u1 @+ s
啟動nginx ⇨ service nginx start
8 ~3 S) G" O% f〖結果〗:) ^& x) }3 N; k0 C4 e- U$ i) L+ \- P
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
, a+ p8 i% t% G: u+ b! o〖解決〗:
! [( V" A$ @+ D) v* {7 a A先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64# D% a0 k* H) c$ E
再一次啟動nginx ⇨ service nginx start% [0 s1 ]6 `! c. \3 p
〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46: [$ k; ], K: M- l4 M3 A
先查看nginx 的configure ⇨ /usr/sbin/nginx -V
: V6 f0 O/ p, G' V+ m( R wnginx version: nginx/1.0.15
# |: Y/ M4 u- e8 h- [% } jbuilt by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)8 J4 {: `: l* Y
TLS SNI support enabled
A6 w4 p. t3 Vconfigure 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
* d* [; h @5 R3 k
$ }( F1 a( H2 ~: F3 x/ p7 j$ w, b) t: {: _: a
啟動nginx ⇨ service nginx start + r4 c8 R$ Q: X7 K7 m9 V4 T
error : ( _6 o) U$ H+ l
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40
2 [6 @8 B# a) g; mnginx: configuration file /etc/nginx/nginx.conf test failed
% @# U3 Q/ t: K% Q9 T6 g& N6 u4 [〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了. K. T* K: d( g* W) d
SELINUX = enforcing 改成 disabled . s9 U5 v6 c. U; A7 D5 t' Z
0 Z8 Q/ a+ O3 O7 j' q7 B
5 U: V" m( {5 u- j' n$ W3 x0 k
5 c, Q% X" W2 ?9 S3 J/ J
; Z# n8 f: t5 Y3 x |