《1》安裝nginx
: W3 Y2 I7 B5 N5 ] yum install nginx$ g$ y1 R1 Y2 \% K/ j z
..........
" b; I( T' f& s0 \. }( RRunning Transaction
( ]6 Z; |: Z( ], A# x Installing : GeoIP-1.5.1-5.el6.x86_64 1/3) J% B9 s6 u5 [
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3( t! y0 V2 u1 e: v3 \
Installing : nginx-1.0.15-11.el6.x86_64 3/3
: a Q6 t/ S- [$ R" w Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3
0 A/ j: y0 Y& |3 u8 V/ K' o& v0 S Verifying : nginx-1.0.15-11.el6.x86_64 2/34 u: A/ h( S8 M, H6 F$ ]& h7 `% R
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3$ m) G; d8 G0 k: j4 t, i9 j
' Q B8 R/ I2 `' g+ N/ ?: {) x/ j; ^
Installed:" r. t" ~7 p! ^; w c; T+ L7 ?# F
nginx.x86_64 0:1.0.15-11.el6
! K6 D2 K8 U }8 _Dependency Installed:
. c5 N. { O0 L; n" C! }; R: ^/ D GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el65 ]; j' q0 m5 s% h# U
Complete!
" P* _* h3 d- q. Q( ]' ^8 z+ z0 c: E7 R+ X* B
設定/etc/nginx/nginx.conf' I3 w6 J2 u- H: _
6 {+ ^: N$ K! c《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html+ O% I! I& X( Y+ ?) n' k, c2 \
設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
* X' x. u6 Z, A* R0 \
, [/ B( Z7 \7 B& |( \; w啟動php-fpm ⇨ service php-fpm start) u2 V, z& C7 b, K: I
啟動nginx ⇨ service nginx start
6 r% c* a% a0 r0 ~〖結果〗:
/ z0 F+ ~; ^: m9 L0 B; m$ \2 T出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
S# ]2 X: Z5 c3 e ]1 W2 v+ J0 e〖解決〗:
, b+ b. t4 `" q先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64
3 r! e4 S5 M2 K: Q再一次啟動nginx ⇨ service nginx start
2 E x1 e9 m' { d3 r+ w, [( ~〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
& N/ ]" E# E! ~& ~- f先查看nginx 的configure ⇨ /usr/sbin/nginx -V/ u7 p4 z$ I" T4 `
nginx version: nginx/1.0.15; a( Q. F5 z5 j4 }6 `$ {+ r
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC)& _& s2 X% C8 y3 H+ `8 ]$ H6 ]
TLS SNI support enabled
! b8 ~' v) o8 Kconfigure 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
0 ?6 t- X" V& R0 ?, q 3 N% ~( R" J* R7 U
! ]7 R% G& y. z" v' b( J6 l
啟動nginx ⇨ service nginx start
+ v R: e7 R5 I; }' Zerror :
; X5 J' J8 u+ inginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40" i- ~2 A6 m" q: v* D
nginx: configuration file /etc/nginx/nginx.conf test failed
2 k/ N7 _7 y% m0 k〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了
9 S& O$ w3 x1 j8 |2 w2 ?SELINUX = enforcing 改成 disabled
% F n- Q3 x' R$ ^0 Z8 l {3 _9 j O9 Y* A; q! D& z
$ L5 q5 C0 t9 \& o5 |6 ~6 ?3 {, Y
) _) n( t4 e1 g. D8 Z4 o4 ~& m
) q s1 \ I4 f3 V( H |
|