安裝配置nginx所遇到的問題匯總;

1 安裝

Yum安装Nginx

1、配置Centos 7 Nginx Yum源仓库

rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

2、安装Nginx

yum install nginx -y

3、启动Nginx,并设置开启自启动

systemctl start nginx
systemctl enable nginx


4、访问Nginx

打开浏览器输入 http://服务器ip/ 可以访问到如下内容

 

Nginx默认地址和基本操作
默认安装地址
/etc/nginx/nginx.conf # Yum安装Nginx默认主配置文件
/usr/share/nginx/html # Nginx默认存放目录
/usr/share/nginx/html/index.html # Nginx默认主页路径

 

 

2 問題

腾讯云linux启动nginx报错:error while loading shared libraries: libssl.so.10 lzhfdxhxm

启动、检查安装信息时报错:./nginx: error while loading shared libraries: libssl.so.10: cannot open shared object file: No such file or directory


提示是不存在libssl.so.10包。先查看本机是否存在whereis libssl.so.10

 

那么需要安装下libssl包:compat-openssl10

yum install compat-openssl10

 

注意,需要安装的compat-openssl10包,不是openssl包

安装完之后,nginx就可以正常运行了。

3 常用命令

 

基本操作命令
1、启动Nginx

$ systemctl start nginx

2、停止Nginx

$ systemctl stop nginx

3、重载Nginx

$ systemctl reload nginx

4、重启Nginx

$ systemctl restart nginx

5、查询Nginx运行状态

$ systemctl status nginx

6、查询Nginx进程

$ ps -ef |grep nginx

7、查询Nginx监听端口

$ netstat -lntup |grep nginx

8、卸载Nginx

$ yum -y remove nginx

posted @   0龙行者0  阅读(49)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
点击右上角即可分享
微信分享提示