首页 > 解决方案 > 不会在 Amazon Linux 中重新加载 httpd.conf

问题描述

如何反映 /etc/httpd/conf/httpd.conf 中的修改?

我遇到了麻烦... EC2 中的 Apache 不能正常工作。

我的 Amzon linux 版本在这里

$  cat /etc/system-release
Amazon Linux release 2 (Karoo)
$ sudo systemctl restart httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.

所以我检查了状态。

$ 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  2021-05-10
     Docs: man:httpd.service(8)
  Process: 2971 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 2971 (code=exited, status=1/FAILURE)
   Status: "Reading configuration..."

 5月 10 13:00:00 ip-xxx-xx-xx-xx.ap-northeast-1.compute.internal httpd[2971]: AH00112: Warning: DocumentRoot [/var/www/stackflow/public] does not exist

我注意到 DocumentRoot [/var/www/stackflow/public] 是错误的路径...

我修改了

/etc/httpd/conf/httpd.conf

<Directory "/var/www/stackoverflow/public">
    AllowOverride all
   #Require all denied
    Require all granted
</Directory>

DocumentRoot "/var/www/html"
$ sudo systemctl reload httpd.service
Job for httpd.service invalid.

变化似乎没有体现出来。

标签: linuxapacheamazon-linux

解决方案


推荐阅读