CakePHP 2.6虚拟主机apache2 linux

时间:2017-02-14 13:14:32

标签: php linux apache cakephp

我想在我的apache上设置cakePHP

我的apache.conf文件

 <VirtualHost *:80>
        ServerName campusjaeger.dev
        ServerAlias campusjaeger.dev
        DocumentRoot /home/insasse/campusjaeger/cakephp/app/webroot
        AccessFileName .htlocal .htdefault .htaccess
        <Directory "/home/insasse/campusjaeger/cakephp/app/webroot">
                Options FollowSymLinks
                AllowOverride All
                Require all granted
        </Directory>
</VirtualHost>

但是不是在webroot下加载index.php而是调用/ var / www / html /下的index.php ...我做错了什么?

我的tail access.log

127.0.0.1 - - [14/Feb/2017:14:21:57 +0100] "GET /favicon.ico HTTP/1.1" 404 507 "http://campusjaeger.dev/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET / HTTP/1.1" 200 3524 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3623 "http://campusjaeger.dev/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET /favicon.ico HTTP/1.1" 404 507 "http://campusjaeger.dev/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET / HTTP/1.1" 200 3524 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3623 "http://campusjaeger.dev/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET /favicon.ico HTTP/1.1" 404 507 "http://campusjaeger.dev/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET / HTTP/1.1" 200 3524 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3623 "http://campusjaeger.dev/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"
127.0.0.1 - - [14/Feb/2017:14:21:58 +0100] "GET /favicon.ico HTTP/1.1" 404 507 "http://campusjaeger.dev/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36"

my tail error.log

[Tue Feb 14 14:10:08.333823 2017] [mpm_prefork:notice] [pid 16084] AH00169: caught SIGTERM, shutting down
[Tue Feb 14 14:10:09.501924 2017] [mpm_prefork:notice] [pid 16577] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Tue Feb 14 14:10:09.501989 2017] [core:notice] [pid 16577] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 14 14:17:21.337819 2017] [mpm_prefork:notice] [pid 16577] AH00169: caught SIGTERM, shutting down
[Tue Feb 14 14:17:22.476980 2017] [mpm_prefork:notice] [pid 17035] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Tue Feb 14 14:17:22.477040 2017] [core:notice] [pid 17035] AH00094: Command line: '/usr/sbin/apache2'
[Tue Feb 14 14:19:38.505825 2017] [mpm_prefork:notice] [pid 17035] AH00169: caught SIGTERM, shutting down
[Tue Feb 14 14:19:39.648414 2017] [mpm_prefork:notice] [pid 17248] AH00163: Apache/2.4.18 (Ubuntu) configured -- resuming normal operations
[Tue Feb 14 14:19:39.648478 2017] [core:notice] [pid 17248] AH00094: Command line: '/usr/sbin/apache2'

1 个答案:

答案 0 :(得分:0)

永远记得做sudo a2ensite my_vhost.conf

希望能帮助某人。