无法使用apache在Ubuntu 17.10上运行虚拟主机

时间:2018-04-21 16:11:40

标签: ubuntu apache2

可能只是一个小小的失败。

我正在使用PHP开发工具从Windows迁移到Linux,无法让我的v-hosts运行。我这样做的方式与我在Windows机器和旧Linux机器上完成的方式相同。但它不起作用。

这就是我的方式:

主机文件权限

-rw-r--r-- 1 root root 232 Apr 14 10:03 /etc/hosts

托管文件内容

127.0.0.1   localhost
127.0.1.1   ubuntu.dev  ubuntu

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

/ etc / apache2 / sites-available

的内容
drwxr-xr-x 2 root root 4096 Apr 21 17:44 .
drwxr-xr-x 8 root root 4096 Apr 21 17:19 ..
-rw-r--r-- 1 root root 1332 Jul 27  2017 000-default.conf
-rw-r--r-- 1 root root 6338 Jul 27  2017 default-ssl.conf
-rw-r--r-- 1 root root  480 Apr 21 17:43 ubuntu.dev.conf

/etc/apache2/sites-available/ubuntu.dev.conf的内容

<VirtualHost *:80>
        ServerAdmin mail@mymail.de
        ServerName ubuntu.dev
        ServerAlias www.ubuntu.dev
        DocumentRoot /var/www/html/
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /var/www/html/>
                DirectoryIndex index.html index.php
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

/ etc / apache2 / sites-enabled

的内容
drwxr-xr-x 2 root root 4096 Apr 21 17:43 .
drwxr-xr-x 8 root root 4096 Apr 21 17:19 ..
lrwxrwxrwx 1 root root   35 Apr 21 17:19 000-default.conf -> ../sites-available/000-default.conf
lrwxrwxrwx 1 root root   34 Apr 21 17:41 ubuntu.dev.conf -> ../sites-available/ubuntu.dev.conf

/etc/apache2/sites-enabled/ubuntu.dev.conf的内容

<VirtualHost *:80>
        ServerAdmin mail@mymail.de
        ServerName ubuntu.dev
        ServerAlias www.ubuntu.dev
        DocumentRoot /var/www/html/
        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
        <Directory /var/www/html/>
                DirectoryIndex index.html index.php
                AllowOverride All
                Order allow,deny
                Allow from all
        </Directory>
</VirtualHost>

你有什么提示吗?

关心n00n ....

编辑文件#1 - access.log

::1 - - [21/Apr/2018:17:34:22 +0200] "GET / HTTP/1.1" 200 3477 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
::1 - - [21/Apr/2018:17:34:22 +0200] "GET /icons/ubuntu-logo.png HTTP/1.1" 200 3623 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
::1 - - [21/Apr/2018:17:34:22 +0200] "GET /favicon.ico HTTP/1.1" 404 500 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36"
::1 - - [21/Apr/2018:17:51:53 +0200] "GET / HTTP/1.1" 200 3477 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"
::1 - - [21/Apr/2018:17:51:53 +0200] "GET /favicon.ico HTTP/1.1" 404 500 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"
::1 - - [22/Apr/2018:09:50:46 +0200] "GET / HTTP/1.1" 200 3477 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"
::1 - - [22/Apr/2018:09:50:46 +0200] "GET /icons/ubuntu-logo.png HTTP/1.1" 304 180 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"
::1 - - [22/Apr/2018:09:50:46 +0200] "GET /favicon.ico HTTP/1.1" 404 500 "http://localhost/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36"

编辑文件#2:error.log

[Sat Apr 21 17:19:34.406581 2018] [mpm_event:notice] [pid 22619:tid 139673765931968] AH00489: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:19:34.406753 2018] [core:notice] [pid 22619:tid 139673765931968] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:19:48.671535 2018] [mpm_event:notice] [pid 22619:tid 139673765931968] AH00491: caught SIGTERM, shutting down
[Sat Apr 21 17:19:48.737337 2018] [mpm_event:notice] [pid 22828:tid 140270657166272] AH00489: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:19:48.737543 2018] [core:notice] [pid 22828:tid 140270657166272] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:22:55.285086 2018] [mpm_event:notice] [pid 22828:tid 140270657166272] AH00491: caught SIGTERM, shutting down
[Sat Apr 21 17:22:55.344240 2018] [mpm_prefork:notice] [pid 31501] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:22:55.344386 2018] [core:notice] [pid 31501] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:22:55.717155 2018] [mpm_prefork:notice] [pid 31501] AH00169: caught SIGTERM, shutting down
[Sat Apr 21 17:22:55.811931 2018] [mpm_prefork:notice] [pid 31558] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:22:55.811997 2018] [core:notice] [pid 31558] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:26:24.073839 2018] [mpm_prefork:notice] [pid 31558] AH00169: caught SIGTERM, shutting down
[Sat Apr 21 17:26:24.184819 2018] [mpm_prefork:notice] [pid 31945] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:26:24.184887 2018] [core:notice] [pid 31945] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:30:29.517890 2018] [mpm_prefork:notice] [pid 31945] AH00171: Graceful restart requested, doing restart
[Sat Apr 21 17:30:29.564761 2018] [mpm_prefork:notice] [pid 31945] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:30:29.564782 2018] [core:notice] [pid 31945] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:42:12.205460 2018] [mpm_prefork:notice] [pid 31945] AH00171: Graceful restart requested, doing restart
[Sat Apr 21 17:42:12.250360 2018] [mpm_prefork:notice] [pid 31945] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:42:12.250383 2018] [core:notice] [pid 31945] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:43:04.967366 2018] [mpm_prefork:notice] [pid 31945] AH00169: caught SIGTERM, shutting down
[Sat Apr 21 17:43:05.073899 2018] [mpm_prefork:notice] [pid 6355] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:43:05.073966 2018] [core:notice] [pid 6355] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:49:23.855978 2018] [mpm_prefork:notice] [pid 6355] AH00169: caught SIGTERM, shutting down
[Sat Apr 21 17:51:18.491458 2018] [mpm_prefork:notice] [pid 849] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sat Apr 21 17:51:18.491694 2018] [core:notice] [pid 849] AH00094: Command line: '/usr/sbin/apache2'
[Sat Apr 21 17:59:39.110292 2018] [mpm_prefork:notice] [pid 849] AH00169: caught SIGTERM, shutting down
[Sun Apr 22 09:46:16.682729 2018] [mpm_prefork:notice] [pid 920] AH00163: Apache/2.4.27 (Ubuntu) configured -- resuming normal operations
[Sun Apr 22 09:46:16.683120 2018] [core:notice] [pid 920] AH00094: Command line: '/usr/sbin/apache2'

0 个答案:

没有答案