《1》安裝nginx6 N) O) d' l* U1 r1 x' Q
yum install nginx6 T+ D: b1 H) o
..........- \7 z' U- Q1 Q8 A1 F
Running Transaction
$ M, E+ E3 l7 T. f7 L8 q7 R Installing : GeoIP-1.5.1-5.el6.x86_64 1/3% H* ] }- l: |+ y& W1 f
Installing : nginx-filesystem-1.0.15-11.el6.noarch 2/3
; E+ ~# ~4 J; ?3 Z3 L! | Installing : nginx-1.0.15-11.el6.x86_64 3/3" _. s4 ^# f/ F8 x2 X# ~: n9 m
Verifying : nginx-filesystem-1.0.15-11.el6.noarch 1/3& T7 c8 V8 `# m) q& V
Verifying : nginx-1.0.15-11.el6.x86_64 2/3! Y' T3 l, }5 {; J5 C, r
Verifying : GeoIP-1.5.1-5.el6.x86_64 3/3
; P8 E: \4 E+ B5 e- Q5 u" |! ~8 G0 c/ \, a
Installed:
- F$ ]7 Y' P+ z7 M nginx.x86_64 0:1.0.15-11.el6
* D5 G% E2 o# x; j {& tDependency Installed:
: e# B" z$ K. @( C7 | GeoIP.x86_64 0:1.5.1-5.el6 nginx-filesystem.noarch 0:1.0.15-11.el6" f, y9 i& t8 g7 J% g
Complete!5 o9 {6 X8 E$ q. p( {% A! |* a
- {# j( B( Y* Q1 Y7 a& U& o設定/etc/nginx/nginx.conf
; Y# U% M- w# E3 u9 R) A+ C
/ _1 s9 d, a; X. B& p+ n《2》安裝php-fpm: 參考http://www.av4u.info/thread-201-1-1.html
* V3 K8 P, {; |+ M) M設定 /etc/php-fpm.d/www.conf user and group = nginx (default apache) ==> still error
4 G6 Z. K5 d; R" G5 E
+ w& ?0 B* |- ^4 b0 v" c啟動php-fpm ⇨ service php-fpm start
* ]+ U. w0 K8 Z: N+ @5 [啟動nginx ⇨ service nginx start2 ~6 l; W, |8 C& S- l
〖結果〗:
6 }! F* Q* ?. ~出現error :nginx:/usr/sbin/nginx: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory
( p/ b* \- j+ l" _) c! e: B. ~〖解決〗:
5 }. I) D8 _' Q先找libgd.so.2 在何處(locate libgd.so.2*),結果在/usr/lib64/libgd.backup,所以cp /usr/lib64/libgd.backup/libgd.so.2* /usr/lib64( G* M; z( p* R1 W1 `
再一次啟動nginx ⇨ service nginx start
. m. L6 L; T% R. f〖結果〗:nginx: [emerg] unknown directive "upload_progress" in /etc/nginx/nginx.conf:46
8 E4 o* }5 V# H; v3 u% o: V先查看nginx 的configure ⇨ /usr/sbin/nginx -V
8 z; M. Y' @) o+ Z, nnginx version: nginx/1.0.15
% @1 L: U5 B/ m6 b1 i& cbuilt by gcc 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC). K! e, j, p; B# C6 ]
TLS SNI support enabled
; |2 W4 c% W8 d" [. s* Bconfigure 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* Z) q, G& S6 S# p7 Q& c: E" Y
: {/ j0 p8 S4 R7 N7 k( _
2 z* K) i- W+ G: j4 t. a2 U2 t啟動nginx ⇨ service nginx start / h! c5 b- b0 P9 j4 A5 t
error :
$ ^# \" J7 ~: E7 [. y% r2 Jnginx: [emerg] open() "/etc/nginx/conf.d/db52av.52av.tv.conf" failed (13: Permission denied) in /etc/nginx/nginx.conf:40, R6 J7 F) S* ^6 L
nginx: configuration file /etc/nginx/nginx.conf test failed2 R0 W) \! c4 i& w7 T" Y5 c5 Q
〖解決〗:將/etc/sysconfig/selinux 內的 enforced 設成 disabled then reboot 就可以了 Y3 v- v2 D1 S+ b. F
SELINUX = enforcing 改成 disabled
0 l( Z+ n6 t4 f1 k1 z/ X( z
, o5 I" [9 T; @' ]' H" g& G" t- R' @& l( d2 N: P
& B5 D$ i- R# W3 }5 ^7 y
0 \3 f9 l# X$ I8 @! r% j* Q |
|