nginx错误集合

1、yum出错

[root@wt--1 ~]# yum install -y nginx
Loaded plugins: fastestmirror, langpacks

解决:更新yum源

 

[root@wt--1 yum.repos.d]# wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
[root@wt--1 yum.repos.d]# yum clean all
[root@wt--1 yum.repos.d]# yum makecache

2、配置localhost,www.heza.com访问同一个目录,只有localhost访问成功

情况如下:

 

[root@two conf.d]# curl localhost
trytry
[root@two conf.d]# curl www.heza.com
[root@two conf.d]# 

 

解决:

 

[root@two conf.d]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.221.135 www.heza.com

 

重新访问ok:

[root@two conf.d]# curl www.heza.com
trytry

3、切换用户错误

[root@www conf]# su nginx
This account is currently not available.

解决:

 

[root@www conf]# usermod -s /bin/bash nginx
[root@www conf]# su - nginx
Last login: Thu Jan 18 02:45:49 EST 2018 on pts/0
-bash-4.2$ exit
logout
[root@www conf]# su nginx
bash-4.2$ exit
exit
[root@www conf]# 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值