二进制下载部署Nginx

一、通过Nginx官网并采取二进制方式部署

Nginx官网

二、具体步骤

image
image
image
image
image
image

[root@web01 yum.repos.d]# ll -d nginx.repo
-rw-r--r--. 1 root root 398 Aug 17 22:01 nginx.repo
[root@web01 yum.repos.d]# pwd
/etc/yum.repos.d
  • 接下来可以直接使用 yum -y install nginx 则是直接从官方下载的nginx

三、安装步骤

第一步: 安装nginx服务
[root@web01 ~]# yum -y install nginx

第二步: 配置Nginx

第三步: 启动Nginx加入开机自动运行
[root@web01 ~]# systemctl start nginx
[root@web01 ~]# systemctl enable nginx

查看Nginx服务状态:
[root@web01 ~]# systemctl status nginx
[root@web01 ~]# netstat -tnulp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      20116/nginx: master 

过滤进程的方式查看nginx是否运行
[root@web01 ~]# ps axu|grep nginx
root      20116  0.0  0.1  49072  1004 ?        Ss   16:03   0:00 nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx     20117  0.0  0.1  49460  1896 ?        S    16:03   0:00 nginx: worker process

最后一步: 打开浏览器测试10.0.0.7

如果中途报错可以在 [root@web01 ~]# tailf /var/log/nginx/error.log 该文件中查看错误日志详细

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值