首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在Ubuntu 16.04上重新启动Apache

无法在Ubuntu 16.04上重新启动Apache
EN

Ask Ubuntu用户
提问于 2017-08-17 07:45:14
回答 2查看 1.8K关注 0票数 1

我试图添加新域,但是在尝试重新启动apache之后,我得到了以下内容:

代码语言:javascript
复制
● apache2.service - LSB: Apache2 web server
   Loaded: loaded (/etc/init.d/apache2; bad; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Thu 2017-08-17 07:58:06 UTC; 15s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 2026 ExecStart=/etc/init.d/apache2 start (code=exited, status=1/FAILURE)

Aug 17 07:58:06 server apache2[2026]: AH00112: Warning: DocumentRoot [/etc/sentora/panel/] does not exist
Aug 17 07:58:06 server apache2[2026]: AH00112: Warning: DocumentRoot [/var/sentora/hostdata/trgovac/public_html/trgovac_rs] does not exist
Aug 17 07:58:06 server apache2[2026]: (2)No such file or directory: AH02291: Cannot access directory '/var/sentora/logs/domains/banko-sistemi/' for error log of vhost defined at /etc/apache2/sites-enabled/svi.conf:687
Aug 17 07:58:06 server apache2[2026]: AH00014: Configuration check failed
Aug 17 07:58:06 server apache2[2026]: Action 'configtest' failed.
Aug 17 07:58:06 server apache2[2026]: The Apache error log may have more information.
Aug 17 07:58:06 server systemd[1]: apache2.service: Control process exited, code=exited status=1
Aug 17 07:58:06 server systemd[1]: Failed to start LSB: Apache2 web server.
Aug 17 07:58:06 server systemd[1]: apache2.service: Unit entered failed state.
Aug 17 07:58:06 server systemd[1]: apache2.service: Failed with result 'exit-code'.

有人知道为什么会发生这种事吗?如何重新启动apache?

EN

回答 2

Ask Ubuntu用户

发布于 2017-08-17 08:12:36

您的安装中存在一些权限问题。您可以从以下日志的最后2行中找到这一点:

代码语言:javascript
复制
Aug 17 07:58:06 server apache2[2026]: AH00112: Warning: DocumentRoot [/etc/sentora/panel/] does not exist
Aug 17 07:58:06 server apache2[2026]: AH00112: Warning: DocumentRoot [/var/sentora/hostdata/trgovac/public_html/trgovac_rs] does not exist
Aug 17 07:58:06 server apache2[2026]: (2)No such file or directory: AH02291: Cannot access directory '/var/sentora/logs/domains/banko-sistemi/' for error log of vhost defined at /etc/apache2/sites-enabled/svi.conf:687
Aug 17 07:58:06 server apache2[2026]: AH00014: Configuration check failed

有两个警告(这些只是警告,不会让Apache失败,但值得注意)。您已经在虚拟主机的配置2中配置了不存在的文档根。一个在/etc/sentora/panel/,另一个在/var/sentora/hostdata/trgovac/public_html/trgovac_rs

但是,导致Apache无法启动的错误是,它试图创建/修改Apache在/var/sentora/logs/domains/banko-sistemi/中无法访问的日志。

要解决这个问题,请确保目录存在,如果它没有创建目录,并授予Apache修改它的访问权限:

代码语言:javascript
复制
sudo mkdir -p /var/sentora/logs/domains/banko-sistemi
sudo chown -u www-data /var/sentora/logs/domains/banko-sistemi

如果您更改了默认的Apache用户,请将www-data更改为您为Apache选择的任何用户。

票数 1
EN

Ask Ubuntu用户

发布于 2017-08-17 08:06:01

我来解决这个问题。我在这个位置上创建了目录“banko”/var/sentora/log/domains/banko/。

之后,我重新启动apache,没有任何问题。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/947005

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档