nginx下载安装
1.监控nginx-module-vts模块
下载
curl -o module.tar.gz https://codeload.github.com/vozlt/nginx-module-vts/tar.gz/v0.1.18
解压
tar -xvzf module.tar.gz
nginx-module-vts-0.1.18 //监控nginx-module-vts模块下载对应安装文件夹
2.nginx
下载
# curl -o nginx-1.14.2.tar.gz http://nginx.org/download/nginx-1.14.2.tar.gz
配置
yum -y install gcc gcc-c++ autoconf automake make //gcc下载
安装 pcre 为了支持 正则表达式功能
安装openssl 为了支持ssl功能
安装前的部分环境
yum -y install pcre-devel openssl openssl-devel gd-devel
解压
tar -xvzf nginx-1.14.2.tar.gz | |
---|---|
在nginx解压文件夹下运行参数
./configure --prefix=/opt/nginx --with-http_ssl_module --with-http_image_filter_module --with-http_sub_module --with-http_secure_link_module --with-pcre --with-cc-opt='-O3 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_stub_status_module --with-stream --with-http_auth_request_module --add-module=/opt/nginx-module-vts-0.1.18
编译安装
make
make install
创建链接
ln -s /opt/nginx/sbin/nginx /usr/sbin/nginx
nginx -t //就可以直接使用命令了
3.启动
nginx #启动nginx