《1》安裝nginx, }+ r$ w# _ i) }
yum install nginx
, j1 g/ l% H; ~ H4 x4 C..........
2 R9 c( D4 ]7 x9 QRunning Transaction, y1 \% s: }6 j
Installing : GeoIP-1.5.1-5.el6.x86_64 1/3
6 Y `7 x7 G3 g2 ]; n4 D8 d Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/34 @& W+ f2 l. ~3 O& q
Installing : nginx-1.0.15-11.el6.x86_64 3/3
2 L4 t/ g2 d8 q2 |% g) ] Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/33 F/ E; ]- G8 b
Verifying : nginx-1.0.15-11.el6.x86_64 2/3
: {3 I: g7 }1 |. B Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3- @* M e# n& x7 ]
% n O4 \# R; `; `7 D& s5 H
Installed:
1 ]2 _# E+ C! C' D3 U; n5 E8 L5 D nginx.x86_64 0:1.0.15-11.el6: r" ?3 j7 N; O- \1 K+ ~
Dependency Installed:6 A D6 L% ]) I. K6 D
GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6
1 I! v9 p- C. I4 g' `+ dComplete!
, J7 P' j4 I* m( `' r8 i
7 F; a0 H @8 ^/ M' D4 N設定/etc/nginx/nginx.conf
; I8 T" \: [) w$ R. ?, j( E" g9 i* J+ T p
《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html
7 S8 J! v* b R1 B* ?: z設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
1 ~; G r! k* A# W, s& p2 F3 j
7 W" w- a6 R# W1 M啟動php-fpm ⇨ service php-fpm start1 t" q' C+ E* j, p* b
啟動nginx ⇨ service nginx start
! S* j" H. [1 J# P, [0 A* D〖結果〗:6 ?9 M7 K: |- h# V. b9 O! K; J
出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
' j8 ?, g( M7 k: ?) n" T/ W8 g〖解決〗:* }" @8 p2 j l& i9 L& C' c* I1 C
先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64" {4 l( G+ v# C; [# K* q
再一次啟動nginx ⇨ service nginx start% g* P9 p4 e- A
〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:465 a! D. s& B7 r) [
先查看nginx 的configure ⇨ /usr/sbin/nginx -V
8 D$ n+ w) K0 {+ w6 ~8 O, ~( Q+ ~nginx version: nginx/1.0.15- Q+ d9 A, a0 W
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)
. P* Y K/ }! u4 `: p c. L7 DTLS SNI support enabled2 s M* t; H U7 \9 e
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+ X) d& x" q0 P* U7 B$ V- ^% K6 H0 w
, y" [- |: d& m1 \2 t; C3 D+ t& C, e+ S2 g1 k6 f
啟動nginx ⇨ service nginx start
) ~! b o/ [. i' g. m7 v5 O | x1 ]error : + \2 A2 S: j0 ?9 f; R
nginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40% c' q9 ]1 j K8 Q# }. W
nginx: configuration file /etc/nginx/nginx.conf test failed
# n- I5 I" ?" w4 d) o4 a% o〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了. w* f d4 o/ A( D# M9 ~/ f
SELINUX = enforcing 改成 disabled % \, \/ X" G- b- M& e
0 `3 g l7 u1 }7 `/ H& I0 n; P0 R' O5 p' I% W' D7 f3 J
" C- a4 T+ l. k# s$ ]. W9 z& T" _2 Y! b* O: f2 P# z
|
|