【问题标题】:I tried to start laravel project on linux我试图在 linux 上启动 laravel 项目
【发布时间】:2021-07-07 05:12:08
【问题描述】:

突然...我的网站发生超时错误。 似乎不是进程不起作用。 我应该如何重新启动项目...

php-fpm.conf

$  service apache2 restart
Redirecting to /bin/systemctl restart apache2.service
Failed to restart apache2.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status apache2.service' for details.
[ec2-user@ip-172-31-30-200 laravel6]$ systemctl status httpd.service
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
  Drop-In: /usr/lib/systemd/system/httpd.service.d
           └─php-fpm.conf
   Active: failed (Result: exit-code) since Mon 2021-04-12 09:12:06 ; 1min 48s ago
     Docs: man:httpd.service(8)
  Process: 4123 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 4123 (code=exited, status=1/FAILURE)
   Status: "Reading configuration..."
.ap-northeast-1.compute.internal systemd[1]: Starting The Apache HTTP Server...
.ap-northeast-1.compute.internal httpd[4123]: (98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
.ap-northeast-1.compute.internal httpd[4123]: (98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
.ap-northeast-1.compute.internal httpd[4123]: no listening sockets available, shutting down
.ap-northeast-1.compute.internal httpd[4123]: AH00015: Unable to open logs
.ap-northeast-1.compute.internal systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
.ap-northeast-1.compute.internal systemd[1]: Failed to start The Apache HTTP Server.
.ap-northeast-1.compute.internal systemd[1]: Unit httpd.service entered failed state.
.ap-northeast-1.compute.internal systemd[1]: httpd.service failed.

$ systemctl restart php7.0-fpm.service 
Failed to restart php7.0-fpm.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status php7.0-fpm.service' for details.
$  systemctl stop httpd
Failed to stop httpd.service: The name org.freedesktop.PolicyKit1 was not provided by any .service files
See system logs and 'systemctl status httpd.service' for details.

【问题讨论】:

  • 你好像有 2 个配置文件在同一个端口监听
  • 应该如何修复配置文件?什么配置阻止凝视过程?

标签: php laravel apache httpd.conf amazon-linux


【解决方案1】:

也许您尝试在两个配置文件中使用相同的端口,或者在 nginx 等其他服务上使用 80 端口。尝试sudo lsof -n -i :80 | grep LISTEN检查使用80端口的进程。

另外,您错过了执行systemctl 命令的sudo 命令。可能是权限问题。

【讨论】:

    【解决方案2】:

    @nuzil 在这里回答,

    48)Address already in use: AH00072: make_sock: could not bind to address [::]:80

    请编辑 httpd.conf 文件。

    /usr/local/etc/httpd/httpd.conf
    

    然后替换

    Listen 80
    

    Listen 127.0.0.1:80
    

    重启apache

    sudo apachectl -k restart
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-20
      • 1970-01-01
      • 1970-01-01
      • 2020-09-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-15
      相关资源
      最近更新 更多