天骄老祖 发表于 2015-12-16 22:59

添加虚拟主机配置文件,导致Apache无法重启

在/etc/httpd/conf.d 下添加配置文件vhost-server0.conf 的内容为:

<VirtualHost*:80>
ServerName server0.example.com
DocumentRoot "/var/www/html"
CustomLog "Logs/server0_vhost_log" combined
<Directory "/var/www/html">
<RequireAll>
Require all granted
Require not host .my133t.org
</RequireAll>
</Directory>
</VirtualHost>


保存退出后,Apache无法重启,但是注释掉CustomLog "Logs/server0_vhost_log" combined后,就可以重启成功,不知道为什么?

action08 发表于 2015-12-17 15:51

启动报错了没,错误信息说啥了

天骄老祖 发表于 2015-12-19 17:52




# journalctl -xn
-- Logs begin at Sun 2015-12-20 01:31:19 CST, end at Sun 2015-12-20 01:31:22 CST. --
Dec 19 17:45:11 localhost httpd: (2)No such file or directory: AH02297: Cannot access directory '/Logs/' for log file '/Logs/server0_vhost_
Dec 19 17:45:11 localhost httpd: AH00014: Configuration check failed
Dec 19 17:45:11 localhost systemd: httpd.service: main process exited, code=exited, status=1/FAILURE
Dec 19 17:45:11 localhost systemd: Failed to start The Apache HTTP Server.
-- Subject: Unit httpd.service has failed
-- Defined-By: systemd

--
-- Unit httpd.service has failed.
--
-- The result is failed.
Dec 19 17:45:11 localhost systemd: Unit httpd.service entered failed state.
Dec 19 17:46:17 localhost systemd: Starting Cleanup of Temporary Directories...
-- Subject: Unit systemd-tmpfiles-clean.service has begun with start-up
-- Defined-By: systemd

--
-- Unit systemd-tmpfiles-clean.service has begun starting up.
Dec 19 17:46:17 localhost systemd: Started Cleanup of Temporary Directories.
-- Subject: Unit systemd-tmpfiles-clean.service has finished start-up
-- Defined-By: systemd

--
-- Unit systemd-tmpfiles-clean.service has finished starting up.
--
-- The start-up result is done.
Dec 19 17:46:30 localhost gnome-session: (gnome-settings-daemon:2583): color-plugin-WARNING **: unable to get EDID for xrandr-Virtual1: una
Dec 19 17:46:30 localhost gnome-session: (gnome-settings-daemon:2583): color-plugin-WARNING **: unable to get EDID for xrandr-Virtual1: una
Dec 19 17:46:30 localhost gnome-session: (gnome-settings-daemon:2583): color-plugin-WARNING **: unable to get EDID for xrandr-Virtual1: una



回复 2# action08


   

action08 发表于 2015-12-19 18:10

Dec 19 17:45:11 localhost httpd: (2)No such file or directory: AH02297: Cannot access directory '/Logs/' for log file '/Logs/server0_vhost_


仅仅是目录问题ls -al /Logs

天骄老祖 发表于 2015-12-19 18:46

看日志是应该在/Logs 下有文件, 但是在 /var/html/www下已经有了还不够吗?

回复 4# action08


   

action08 发表于 2015-12-19 22:10

回复 5# 天骄老祖


    以你配置文件为准,要不你修改到/var/html/www 目录下也行


还是权限问题
页: [1]
查看完整版本: 添加虚拟主机配置文件,导致Apache无法重启