nginx安装:

nginx安装:

解这两种代理的关键在于代理服务器所代理的对象是什么,正向代理代理的是客户端,我们需要在客户端进行一些代理的设置。而反向代理代理的是服务器,作为客户端的我们是无法感知到服务器的真实存在的。

正向代理代理客户端,反向代理代理服务器。**

 nginx的下载    http://nginx.org/en/download.html 
 
安装编译工具
yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel
yum -y install pcre pcre-devel


nginx 在路径/usr/local/src/nginx-1.18.0下载
wget http://nginx.org/download/nginx-1.18.0.tar.gz 
 
 解压
 tar -zxvf nginx-1.18.0.tar.gz 
 
 进入文件夹,执行命令
 cd nginx-1.12.0
./configure

安装完成显示信息:
Configuration summary:
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library
  nginx path prefix: "/usr/local/nginx"
  nginx binary file: "/usr/local/nginx/sbin/nginx"
  nginx modules path: "/usr/local/nginx/modules"
  nginx configuration prefix: "/usr/local/nginx/conf"
  nginx configuration file: "/usr/local/nginx/conf/nginx.conf"
  nginx pid file: "/usr/local/nginx/logs/nginx.pid"
  nginx error log file: "/usr/local/nginx/logs/error.log"
  nginx http access log file: "/usr/local/nginx/logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

编译 :查看版本 
make && make install  pcre-config --version  

查看nginx地址 whereis nginx   在usr/local/nginx
 ./sbin/nginx -v  查出nginx版本
 
 查看端口情况 ps -ef列出进程列表,然后通过grep过滤,
 ps -ef|grep nginx 
 
 usr/local/下面
 chmod +x nginx
 
 /usr/local/nginx/conf下的  配置nginx.conf
 
解决Nginx: [error] open() "/usr/local/Nginx/logs/Nginx.pid" failed(2:No such file or directory)
执行命令: /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf  使用nginx -c的参数指定nginx.conf文件的位置

解决:still could not bind() 端口被占用
netstat -ntlp|grep 80    kill -9 pid

 查看帮助
 /usr/local/nginx/sbin/nginx -h
停止,重启 quit,reopen
/usr/local/nginx/sbin/nginx -s stop
/usr/local/nginx/sbin/nginx -s reload

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

superlliuchao

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值