Apache 在编辑配置文件并重新启动后搜索旧的 DocumentRoot

发布于 2024-11-28 00:18:06 字数 547 浏览 2 评论 0原文

我正在使用 Arch Linux 3.0-ARCH。我已将 /etc/httpd/conf/httpd.conf 中的 DocumentRoot/srv/http 更改为 /var/ www。然后我发出这个命令:

% sudo /etc/rc.d/httpd restart
:: Restarting Apache Web Server                                           [BUSY] 
Warning: DocumentRoot [/srv/http] does not exist

尽管如果我将文件复制到 /var/www,它们可以在本地主机上看到。 我已经设置了正确的权限 - /var/www 由 root 拥有,其组是 www。我和 Apache 运行的 http 用户都是该组的成员。该目录的权限为 775

I'm using Arch Linux 3.0-ARCH. I've changed my DocumentRoot in /etc/httpd/conf/httpd.conf from /srv/http to /var/www. Then I issued this command:

% sudo /etc/rc.d/httpd restart
:: Restarting Apache Web Server                                           [BUSY] 
Warning: DocumentRoot [/srv/http] does not exist

Although if I copy files to /var/www, they can be seen on localhost.
I've set the correct permissions—/var/www is owned by root, its group is www. Both I and the http user that Apache runs as are a member of that group. Permissions on the directory are 775.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

琴流音 2024-12-05 00:18:07

您检查过这些设置吗?

/etc/httpd/conf/extra/httpd-ssl.conf
/etc/httpd/conf/extra/httpd-userdir.conf
/etc/httpd/conf/extra/httpd-vhosts.conf

Have you checked these settings?

/etc/httpd/conf/extra/httpd-ssl.conf
/etc/httpd/conf/extra/httpd-userdir.conf
/etc/httpd/conf/extra/httpd-vhosts.conf
等你爱我 2024-12-05 00:18:07

发出此命令:

user@arch~>> grep "srv/http" /etc/httpd -R | grep -v vhost | grep -v log

如果您启用了虚拟主机,此命令将告诉您正在寻找 /srv/http/ 目录的内容

,请改用此命令:

user@arch~>> grep "srv/http" /etc/httpd -R | grep -v log

Issue this command:

user@arch~>> grep "srv/http" /etc/httpd -R | grep -v vhost | grep -v log

This command will tell you what is looking for /srv/http/ directory

if you have vhosts enabled, use this one instead:

user@arch~>> grep "srv/http" /etc/httpd -R | grep -v log
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文