【发布时间】:2016-01-02 09:43:50
【问题描述】:
我正在尝试使用为 CakePHP 2.x 项目提供 PHP 5.6.x、Apache 2.4、MySQL 5.x 的默认软件包在 Ubuntu 15.04 上创建 LAMP 堆栈,但我在配置 Apache 时遇到了问题尽管已安装,但似乎无法正常启动。我无法点击我在配置脚本底部添加的测试 index.html,或者 vhost 指向公共目录 /var/www/app/webroot。
所有组件似乎都已正确安装,因为我可以检查它们的所有版本,但是我在 Apache 上配置错误或错过了配置?我真的不想再次安装 XAMPP,因为去年使用了 Laravel Homestead。流浪盒子是最好的选择。
我用我的 Vagrantfile、Lamp.rb 和 provision.sh 脚本创建了一个GIST,它们的路径位于顶部。任何人都可以启动它并查看我做错了什么。
终端出现 Vagrant Up 错误
==> default: Job for apache2.service failed. See "systemctl status
apache2.service" and "journalctl -xe" for details.
当我尝试重新启动 apache 时,我遇到了与第一次运行 vagrant up 时看到的相同的错误:
root@test:/# sudo service apache2 restart
Job for apache2.service failed. See "systemctl status apache2.service" and "journalctl -xe" for details.
来自 var/log/apache2/error.log 的错误日志
我无法访问 error.log 并且得到了这个-bash: cd: var/log/apache2: Permission denied。所以我不得不使用sudo su,这似乎有效,但我不想每次都这样做,所以如果有人知道需要做什么来提供用户许可,我会很感激的。我发现的有关此的帖子似乎并没有真正解释我需要正确执行此操作,只有sudo su 才能工作。从那里我可以使用 nano 访问错误日志。
[Sat Jan 02 19:03:54.589161 2016] [mpm_event:notice] [pid 3529:tid 140703238530944] AH00489: Apache/2.4.10 (Ubuntu) co$
[Sat Jan 02 19:03:54.589263 2016] [core:notice] [pid 3529:tid 140703238530944] AH00094: Command line: '/usr/sbin/apach$
[Sat Jan 02 19:03:58.874664 2016] [mpm_event:notice] [pid 3529:tid 140703238530944] AH00491: caught SIGTERM, shutting $
[Sat Jan 02 19:03:59.950199 2016] [mpm_prefork:notice] [pid 4803] AH00163: Apache/2.4.10 (Ubuntu) configured -- resumi$
[Sat Jan 02 19:03:59.950314 2016] [core:notice] [pid 4803] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jan 02 19:04:01.359328 2016] [mpm_prefork:notice] [pid 4803] AH00169: caught SIGTERM, shutting down
[Sat Jan 02 19:04:02.467409 2016] [mpm_prefork:notice] [pid 4906] AH00163: Apache/2.4.10 (Ubuntu) configured -- resumi$
[Sat Jan 02 19:04:02.467483 2016] [core:notice] [pid 4906] AH00094: Command line: '/usr/sbin/apache2'
[Sat Jan 02 19:05:16.040251 2016] [mpm_prefork:notice] [pid 4906] AH00169: caught SIGTERM, shutting down
【问题讨论】:
-
apache 日志文件中的错误是什么?可以在实例启动并运行后尝试启动 apache 吗?
-
嗨@FrédéricHenri,我已将错误添加到问题中。
标签: shell ubuntu vagrant lamp vagrant-provision