当前位置: 首页 > news >正文

网站设计主页网站主页设计费用

网站设计主页,网站主页设计费用,池州市网站建设优化,不更新网站如何做排名利用NGINX搭建了视频服务,突然发现启动不了了,于是命令开始 使用以下命令查看更详细的错误信息: systemctl status nginx.service Warning: The unit file, source configuration file or drop-ins of nginx.service changed on disk. Run…

利用NGINX搭建了视频服务,突然发现启动不了了,于是命令开始

  1. 使用以下命令查看更详细的错误信息:
    • systemctl status nginx.service
Warning: The unit file, source configuration file or drop-ins of nginx.service changed on disk. Run 'systemctl daemon-reload' to reload units. Job for nginx.service failed because the control process exited with error code. See "systemctl status nginx.service" and "journalctl -xe" for details. [root@raw /]# sudo systemctl daemon-reload [root@raw /]# systemctl status nginx.service ● nginx.service Loaded: loaded (/etc/systemd/system/nginx.service; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2024-04-18 11:23:02 CST; 14s ago4月 18 11:23:02 raw.githubusercontent.com systemd[1]: Starting nginx.service... 4月 18 11:23:02 raw.githubusercontent.com systemd[1]: nginx.service: Control process exited, code=exited status=203 4月 18 11:23:02 raw.githubusercontent.com systemd[1]: nginx.service: Failed with result 'exit-code'. 4月 18 11:23:02 raw.githubusercontent.com systemd[1]: Failed to start nginx.service. 4月 18 11:23:12 raw.githubusercontent.com systemd[1]: /etc/systemd/system/nginx.service:1: Assignment outside of section. Ignoring. 4月 18 11:23:12 raw.githubusercontent.com systemd[1]: /etc/systemd/system/nginx.service:2: Assignment outside of section. Ignoring. 4月 18 11:23:12 raw.githubusercontent.com systemd[1]: /etc/systemd/system/nginx.service:3: Assignment outside of section. Ignoring. 4月 18 11:23:16 raw.githubusercontent.com systemd[1]: /etc/systemd/system/nginx.service:1: Missing '='. [root@raw /]# 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. [root@raw /]# systemctl status nginx.service ● nginx.service Loaded: loaded (/etc/systemd/system/nginx.service; bad; vendor preset: disabled) Active: failed (Result: exit-code) since Thu 2024-04-18 11:23:22 CST; 7s ago Process: 41057 ExecStart=/usr/local/nginx/sbin/nginx (code=exited, status=1/FAILURE)4月 18 11:23:21 raw.githubusercontent.com nginx[41057]: nginx: [emerg] bind() to 0.0.0.0:8090 failed (98: Address already in use) 4月 18 11:23:21 raw.githubusercontent.com nginx[41057]: nginx: [emerg] bind() to 0.0.0.0:82 failed (98: Address already in use) 4月 18 11:23:21 raw.githubusercontent.com nginx[41057]: nginx: [emerg] bind() to 0.0.0.0:8090 failed (98: Address already in use) 4月 18 11:23:21 raw.githubusercontent.com nginx[41057]: nginx: [emerg] bind() to 0.0.0.0:82 failed (98: Address already in use) 4月 18 11:23:22 raw.githubusercontent.com nginx[41057]: nginx: [emerg] bind() to 0.0.0.0:8090 failed (98: Address already in use) 4月 18 11:23:22 raw.githubusercontent.com nginx[41057]: nginx: [emerg] bind() to 0.0.0.0:82 failed (98: Address already in use) 4月 18 11:23:22 raw.githubusercontent.com nginx[41057]: nginx: [emerg] still could not bind() 4月 18 11:23:22 raw.githubusercontent.com systemd[1]: nginx.service: Control process exited, code=exited status=1 4月 18 11:23:22 raw.githubusercontent.com systemd[1]: nginx.service: Failed with result 'exit-code'. 4月 18 11:23:22 raw.githubusercontent.com systemd[1]: Failed to start nginx.service.

然后发现是端口被占用,先杀死端口吧

问题出现在尝试启动 Nginx 时遇到端口冲突导致无法绑定到指定的端口(0.0.0.0:8090 和 0.0.0.0:82)上。可以按照以下步骤解决这个问题:

  1. 查找占用端口的进程:

    • 使用以下命令查找占用端口 8090 和 82 的进程:
      sudo netstat -tuln | grep ':8090\|:82'
  2. 停止占用端口的进程:

    • 根据上一步的输出,找到占用端口的进程,并停止它们,可以使用以下命令杀死占用端口 8090 的进程(假设 PID 为 XXX):
      sudo kill XXX
  3. 修改 Nginx 配置文件:

    • 如果需要修改 Nginx 配置文件中监听的端口,可以编辑 Nginx 配置文件(通常在 /usr/local/nginx/conf/nginx.conf)并将监听端口修改为未被占用的端口,例如 8080。
  4. 重新加载 Nginx 配置并启动服务:

    • 保存修改后的配置文件,然后重新加载 Nginx 配置并尝试启动 Nginx 服务:
      sudo /usr/local/nginx/sbin/nginx -s reload
  5. 再次检查 Nginx 服务状态:

    • 使用以下命令再次检查 Nginx 服务的状态:
      systemctl status nginx

通过找到并停止占用端口的进程,修改 Nginx 配置文件中的监听端口,然后重新加载配置并启动 Nginx 服务,应该可以解决端口冲突导致的启动问题。

然后命令重启nginx

[root@raw conf]# sudo systemctl start nginx

[root@raw conf]# systemctl status nginx


● nginx.service
   Loaded: loaded (/etc/systemd/system/nginx.service; bad; vendor preset: disabled)
   Active: active (running) since Thu 2024-04-18 11:31:03 CST; 5s ago
  Process: 41932 ExecStart=/usr/local/nginx/sbin/nginx (code=exited, status=0/SUCCESS)
 Main PID: 41933 (nginx)
    Tasks: 2 (limit: 203695)
   Memory: 1.3M
   CGroup: /system.slice/nginx.service
           ├─41933 nginx: master process /usr/local/nginx/sbin/nginx
           └─41934 nginx: worker process

4月 18 11:31:03 raw.githubusercontent.com systemd[1]: Starting nginx.service...
4月 18 11:31:03 raw.githubusercontent.com systemd[1]: Started nginx.service.


 

外界还看不到视频的话,那就是防火墙拦截了,再开启端口:

要开放特定端口(例如82端口),您可以按照以下步骤在防火墙中添加规则以允许流量通过该端口:

  1. 使用 firewall-cmd 命令添加端口规则:

    • 执行以下命令以永久性地开放82端口:

      txt

      sudo firewall-cmd --zone=public --add-port=82/tcp --permanent
  2. 重新加载防火墙规则:

    • 执行以下命令以重新加载防火墙规则,使新的端口规则生效:
      sudo firewall-cmd --reload
  3. 验证端口是否已开放:

    • 您可以运行以下命令来查看防火墙规则,确认82端口已成功开放:
      sudo firewall-cmd --list-all

通过执行以上步骤,可以在防火墙中添加规则以允许流量通过82端口。

[root@raw conf]# sudo firewall-cmd --zone=public --add-port=82/tcp --permanent
success
[root@raw conf]# sudo firewall-cmd --reload
success
[root@raw conf]# sudo firewall-cmd --list-all
public (active)
  target: default
  icmp-block-inversion: no
  interfaces: ens192
  sources: 
  services: cockpit dhcpv6-client ssh
  ports: 82/tcp
  protocols: 
  forward: no
  masquerade: no
  forward-ports: 
  source-ports: 
  icmp-blocks: 
  rich rules: 
[root@raw conf]# 
 

然后成功

http://www.yayakq.cn/news/287613/

相关文章:

  • 海口网站建设美丽网站空间换了 使用原有域名
  • 网站开发进度婚纱摄影网站的设计思路
  • 北京移动网站建设公司排名苏州网站建设制作服务商
  • 网站标题logo制作珠海建网站公司
  • 从零开始自己做外贸网站和海外网络营销页面设计层次架构包括什么
  • 建设银行网站设置密码建设工程检测预约网站
  • 网站升级页面连接设置网站制作公司 北京
  • 邢台网约车资格证哪里申请做神马网站优化排名软
  • 电子商务网站设计与开发案例教程门房设计
  • 义乌商城集团网站建设工会网站群建设
  • 企业网站建设需要许可证吗服务器被攻击怎么办
  • 建立网站的公司平台大连网络工程
  • 合肥高端品牌网站建设品牌策划公司取名
  • 做视频网站怎么对接云盘军事最新军事新闻视频
  • 张家港建设银行网站网站开发要考什么证
  • 网站域名备案要多少钱WordPress都可以做什么
  • 云服务器建设网站如果建设网站
  • 做网站有免费的服务器吗电脑网站支付
  • 免费询盘网站北京什么网站找工作
  • 漯河知名网站建设价格公司官网的seo
  • 域名和网站名要一样吗红蝶直播
  • 汕头网站建设科技有限公司沈阳网站seo
  • 万网域名解析地址苏州市网站优化
  • 商务电商网站建设企业网站无锡
  • 上海频道网站建设公司ftp上传网站之后怎么做
  • 网站如何做交换链接赣州网站建设专家
  • 成品源码1688网站免费淄博网站建设优化运营
  • 网站域名如何优化杭州最好的工业设计公司
  • 网站建设项目实施方案廊坊网站推广排名
  • 汉唐皓月网站推广方案做直播网站软件有哪些软件