centos-NGINX安装

来源:互联网 发布:2016各类案件数据统计 编辑:程序博客网 时间:2024/05/22 12:34

1.安装支持包

yum install -y gcc gcc-c++ pcre-devel openssl-devel libxslt gd-devel perl-ExtUtils-Embed  libatomic_ops-devel libxslt-devel gperftools-devel

2.下载&编译参数

cd /usr/src/

wget http://nginx.org/download/nginx-1.8.0.tar.gz

tar -zxf nginx-1.8.0.tar.gz

cd /usr/src/nginx-1.8.0

./configure --prefix=/usr/local/nginx --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --user=nginx --group=nginx --with-http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_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-cpp_test_module --with-pcre --with-pcre-jit --with-md5-asm --with-sha1-asm --with-debug --with-libatomic --with-google_perftools_module

3.安装

make && make install

4.添加软连接

ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx

5.添加Nginx运行用户与组

groupadd -g 901 nginx

useradd -g 901 -u 901 -M -s /sbin/nologin nginx

6.启动Nginx

nginx

原创粉丝点击