凡事都在事上磨,这样才能精进,成长进步提高! ------ 博客园首页

centos yum 安装nginx 过程中发现的问题

1.在YUM中更新Nginx软件包

sudo yum install epel-release

2.安装

sudo yum install nginx

3.启动nginx

# 启动服务
systemctl start nginx
# 查看状态
systemctl status nginx
# 停止服务
systemctl stop nginx
# 重启服务
systemctl reload nginx
# 加入开机运行
systemctl enable nginx
# 取消开机运行
systemctl disable nginx

4.发现启动问题

[]$ sudo systemctl start nginx
Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details.

发现无法启动成功按照提示

sudo journalctl -xe

发现主要报错是

Jun 15 09:58:47  nginx[28069]: /usr/sbin/nginx: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
Jun 15 09:58:47  systemd[1]: nginx.service: control process exited, code=exited status=127
Jun 15 09:58:47 Failed to start The nginx HTTP and reverse proxy server.

分析发现主要是缺失 libssl.so.1.1这个

同样 运行 /sbin/nginx –t

[ nginx]$ /sbin/nginx –t

/sbin/nginx: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

发现也是这个错误。

 

先尝试yum install libssl.so.1.1

[nginx]$ sudo yum install libssl.so.1.1
Loaded plugins: fastestmirror, langpacks
Repository epel is listed more than once in the configuration
Loading mirror speeds from cached hostfile
No package libssl.so.1.1 available.
Error: Nothing to do

解决方法

sudo yum install -y openssl11-libs

启动成功

 

完全卸载nginx

 

1 停止Nginx
 service nginx stop 
2 取消开机启动
 chkconfig nginx off 
3 将Nginx从服务器删除
 rm -rf /usr/sbin/nginx rm -rf /etc/nginx rm -rf /etc/init.d/nginx 
4 yum清理
 yum remove nginx
posted @   追风fc  阅读(469)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
点击右上角即可分享
微信分享提示