1.创建nginx用户
[root@mysql /]# groupadd -r nginx
[root@mysql /]# useradd -r -g nginx nginx
2.安装nginx依赖包
[root@mysql /]# yum groupinstall -y "Development tools"
[root@mysql /]# yum install -y gcc wget gcc-c++ automake autoconf libtool libxml2-devel libxslt-devel perl-devel perl-ExtUtils-Embed pcre-devel openssl-devel
3.创建/nginx安装目录
[root@mysql /]# mkdir /nginx
[root@mysql /]# tar xvf nginx-1.15.8.tar.gz -C /nginx/
4.下载echo模块
[root@mysql /]# cd /nginx
[root@mysql /]# git clone https://github.com/openresty/echo-nginx-module.git
5.编译安装
[root@mysql /]# cd /nginx/nginx-1.15.8
[root@mysql nginx-1.15.8]# ./configure /
--prefix=/nginx /
--sbin-path=/nginx/sbin/nginx /
--conf-path=/nginx/conf/nginx.conf /
--error-log-path=/nginx/log/error.log /
--http-log-path=/nginx/log/access.log /
--pid-path=/nginx/run/nginx.pid /
--lock-path=/nginx/run/nginx.lock /
--http-client-body-temp-path=/nginx/tmp/client /
--http-proxy-temp-path=/nginx/tmp/proxy /
--http-fastcgi-temp-path=/nginx/tmp/fcgi /
--http-uwsgi-temp-path=/nginx/tmp/uwsgi /
--http-scgi-temp-path=/nginx/tmp/scgi /
--user=nginx /
--group=nginx /
--with-pcre /
--with-http_v2_module /
--with-http_ssl_module /
--with-http_realip_module /
--with-http_addition_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_random_index_module /
--with-http_secure_link_module /
--with-http_stub_status_module /
--with-http_auth_request_module /
--with-mail /
--with-mail_ssl_module /
--with-file-aio /
--with-http_v2_module /
--with-threads /
--with-stream /
--with-stream_ssl_module /
--add-module=/nginx/echo-nginx-module
[root@mysql nginx-1.15.8]# make && make install
[root@mysql nginx-1.15.8]# mkdir -p /nginx/nginx-1.15.8/tmp/client
[root@mysql nginx-1.15.8]# ln -s /nginx/nginx-1.15.8/sbin/nginx /usr/bin/nginx
6.启动nginx
[root@mysql nginx-1.15.8]# nginx
7.访问nginx
版权声明:本文为博主原创文章,未经博主允许不得转载。
nginx
- 上一篇:MySQL MGR 集群搭建(单主模式&多主模式)
- 下一篇:nginx日志切割