《1》安裝nginx
. ^$ ^9 p% o+ P2 u yum install nginx, X0 ~ g- A+ |8 d) z
..........9 [0 f7 Z3 R; u; N+ R
Running Transaction
- K9 `+ s" l6 o+ m+ I Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
9 u6 O! c7 ~0 U# T Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/30 B8 d7 e L( f2 j# X$ X
Installing : nginx-1.0.15-11.el6.x86_64 3/3' g/ g. }* q( j* i
Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3, T" [$ b! J' V$ c [
Verifying : nginx-1.0.15-11.el6.x86_64 2/38 o( ~5 D! D" a r
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
% l/ F0 ?7 t* S7 O! y7 [6 z, Q, F# A8 M
Installed:& G e9 G; b% S5 [! B1 v) x, p
nginx.x86_64 0:1.0.15-11.el6. t$ ^, l- c3 H* }+ Q
Dependency Installed:
+ t) r9 w& h7 d) f% n GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6# l& l: v$ J _
Complete!' z, m) O1 j1 s5 f* D0 W
& m( B. q h3 P' A L# E8 w3 l5 U設定/etc/nginx/nginx.conf9 H* l6 j+ h) e. k5 r
7 h" n5 b5 m, u" |+ P
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html8 ~! `$ y( N+ I4 m/ W- }) J
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
! Y. p1 c( L- N' G# H: f3 N1 F: b# w: I6 `+ y$ C2 T8 U; x# b5 p& ]
啟動php-fpm ⇨ service php-fpm start
- N: }' s. W; D$ H啟動nginx ⇨ service nginx start0 b, R9 K% [4 m1 A
〖結果〗: F, A! p1 d; h$ U1 K
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
9 U# V$ X8 C+ F3 e, o c〖解決〗:
+ P- S" J* X/ b- X; ], I, S先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib644 C$ n9 q1 Z( L/ n! Z) \9 L
再一次啟動nginx ⇨ service nginx start! k# i6 `0 J9 p5 |
〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46$ @& K: H- \$ d
先查看nginx 的configure ⇨ /usr/sbin/nginx -V% j6 z! N$ k- ?: I0 j
nginx version: nginx/1.0.15
* V$ c+ C) }# _5 s0 ~; dbuilt by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)) V/ c4 P6 l" O& m
TLS SNI support enabled& X2 G+ n3 G# ~3 g! m1 d- h Q
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- Q4 E- T) O0 ~# Z. _: n9 K
. s( ?* ]# d( F
8 g: U/ S/ ?, C. j, h O# H啟動nginx ⇨ service nginx start
: W# \, ^$ `) |0 K$ w5 qerror : 6 Z9 Q) U; {/ t" N, j1 n4 S) E6 H
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:405 o- ^& l5 B* J4 Y+ m
nginx: configuration file /etc/nginx/nginx.conf test failed, p k- |* ~+ b# E1 _
〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了3 Z6 x4 \ L3 i# I) K
SELINUX = enforcing 改成 disabled . b k' Y4 g: w& o. v: ~4 Q) |9 v
: C* Q" {# z& N6 p% b
. y, w: ]7 p( J& C, W
% W/ D1 V- x( m
3 c" }8 b8 k5 }$ e* _ |
|