赞
踩
linux系统
CentOS 7 64位
wget https://netix.dl.sourceforge.net/project/pcre/pcre/8.40/pcre-8.40.tar.gz
wget http://nginx.org/download/nginx-1.17.5.tar.gz
下载以下安装包,用xftp放入linux系统
第一步:安装pcre依赖
[root@localhost pcre-8.37]# pcre-config --version
第二步:安装其他依赖
[root@localhost pcre-8.37]# yum -y install make zlib zlib-devel gcc-c++ libtool openssl openssl-devel
第三步:安装nginx
cd /usr/local/nginx/sbin
检查是否启动成功
[root@localhost sbin]# ps -ef|grep nginx
linux系统
Red Hat Enterprise Linux Server release 6.5 (Santiago)
1.nginx 源码 : http://nginx.org/en/download.html
2.yum
安装教程:https://blog.csdn.net/yujing1314/article/details/97237644
3.gcc-c++
[root@localhost ~]yum install gcc-c++
4.第三方开发包
[root@localhost ~]yum install -y pcre pcre-devel
[root@localhost ~]yum install -y zlib zlib-devel
[root@localhost ~]yum install -y openssl openssl-devel
我使用的SecureCRT的sftp文件传输,直接把文件拖进去就OK了
[root@localhost ~]tar zxf nginx-1.8.0.tar.gz
./configure
–prefix=/usr/local/nginx
–pid-path=/var/run/nginx/nginx.pid
–lock-path=/var/lock/nginx.lock
–error-log-path=/var/log/nginx/error.log
–http-log-path=/var/log/nginx/access.log
–with-http_gzip_static_module
–http-client-body-temp-path=/var/temp/nginx/client
–http-proxy-temp-path=/var/temp/nginx/proxy
–http-fastcgi-temp-path=/var/temp/nginx/fastcgi
–http-uwsgi-temp-path=/var/temp/nginx/uwsgi
–http-scgi-temp-path=/var/temp/nginx/scgi
[root@localhost sbin]# mkdir /var/temp/nginx/client -p
直接输入 make
直接输入 make install
[root@localhost sbin]# ./nginx
如何查看进程[root@bogon stefan]# ps aux|grep nginx
关闭nginx:
[root@localhost sbin]# ./nginx -s stop
推荐使用:
[root@localhost sbin]# ./nginx -s quit
输入你虚拟机的ip,如下图就成功了
如果测试失败,注意查看虚拟机防火墙是否关闭
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。