nginx

  1. 准备环境
    (1)关闭防火墙:iptables -F
    或者 systemctl stop firewall 立即关闭防火墙
    systemctl disable firewall 开机关闭防火墙
    关闭selinux: setenforce 0
    (2)配置IP。
  2. 安装软件包
    (1)二进制安装:yum install epel-release -y
    yum install nginx -y
    (2)源码安装:yum install pcre-* -y
    tar xvf nginx.tar.gz
    cd nginx/
    ./configure –prefix=/usr/local/nginx/
    make && make install
  3. 修改配置文件:
    (1)二进制安装:/etc/nginx/nginx.conf
    (2)源码安装:/usr/local/nginx/conf/nginx.conf
  4. 启动
    (1)二进制安装:systemctl start nginx
    (2)源码安装:/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
  5. 测试

补充:状态码:200 访问成功
3开头 重定向
4开头 客户端的问题
5开头 服务端的问题
netstat -an |grep 8080 查看8080端口状态

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值