我已经在 Ubuntu 上安装了 LAMP 和 webmin。使用 webmin,我创建了虚拟主机:IP - 192.168.0.104,文档根目录 - /home/inferusvv/www
(顺便说一句,这无所谓,我是使用 webmin 或自己动手创建的)。
如果我打开 192.168.0.104,它会返回 403 Forbidden 错误。
我尝试将 chmod 777 设置为主目录和父目录,但没有结果。
本地主机已成功打开。其文档根目录为默认目录 - /var/www
配置:
<VirtualHost 192.168.0.104>
DocumentRoot /home/inferusvv/www
<Directory "/home/inferusvv/www">
Options Indexes FollowSymLinks
MultiViews AllowOverride All Order allow,deny allow from all
</Directory> </VirtualHost>
错误日志:
[Sun Apr 20 00:47:29.326223 2014] [mpm_prefork:notice] [pid 7785]
AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured --
resuming normal operations [Sun Apr 20 00:47:29.326256 2014]
[core:notice] [pid 7785] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 20 00:54:57.131853 2014] [mpm_prefork:notice] [pid 7785]
AH00169: caught SIGTERM, shutting down [Sun Apr 20 00:54:58.327003
2014] [mpm_prefork:notice] [pid 8554] AH00163: Apache/2.4.7 (Ubuntu)
PHP/5.5.9-1ubuntu4 configured -- resuming normal operations [Sun Apr
20 00:54:58.327056 2014] [core:notice] [pid 8554] AH00094: Command
line: '/usr/sbin/apache2' [Sun Apr 20 00:55:03.982072 2014]
[authz_core:error] [pid 8558] [client 192.168.0.104:45079] AH01630:
client denied by server configuration: /home/inferusvv/www/index.html
[Sun Apr 20 00:55:04.690839 2014] [authz_core:error] [pid 8558]
[client 192.168.0.104:45079] AH01630: client denied by server
configuration: /home/inferusvv/www/index.html [Sun Apr 20
00:55:04.923196 2014] [authz_core:error] [pid 8558] [client
192.168.0.104:45079] AH01630: client denied by server configuration: /home/inferusvv/www/index.html [Sun Apr 20 00:55:05.143330 2014]
[authz_core:error] [pid 8558] [client 192.168.0.104:45079] AH01630:
client denied by server configuration: /home/inferusvv/www/index.html
[Sun Apr 20 00:55:05.357654 2014] [authz_core:error] [pid 8558]
[client 192.168.0.104:45079] AH01630: client denied by server
configuration: /home/inferusvv/www/index.html [Sun Apr 20
00:56:07.465333 2014] [mpm_prefork:notice] [pid 8554] AH00169: caught
SIGTERM, shutting down [Sun Apr 20 00:56:09.052056 2014]
[mpm_prefork:notice] [pid 8673] AH00163: Apache/2.4.7 (Ubuntu)
PHP/5.5.9-1ubuntu4 configured -- resuming normal operations [Sun Apr
20 00:56:09.052095 2014] [core:notice] [pid 8673] AH00094: Command
line: '/usr/sbin/apache2' [Sun Apr 20 00:56:12.696270 2014]
[authz_core:error] [pid 8677] [client 192.168.0.104:45084] AH01630:
client denied by server configuration: /home/inferusvv/www/index.html
[Sun Apr 20 00:56:13.341787 2014] [authz_core:error] [pid 8677]
[client 192.168.0.104:45084] AH01630: client denied by server
configuration: /home/inferusvv/www/index.html [Sun Apr 20
00:56:13.569761 2014] [authz_core:error] [pid 8677] [client
192.168.0.104:45084] AH01630: client denied by server configuration: /home/inferusvv/www/index.html [Sun Apr 20 01:07:38.444145 2014]
[authz_core:error] [pid 8680] [client 192.168.0.104:45377] AH01630:
client denied by server configuration: /home/inferusvv/www/index.html
[Sun Apr 20 01:07:40.594600 2014] [authz_core:error] [pid 8680]
[client 192.168.0.104:45377] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 01:07:53.910335 2014]
[mpm_prefork:notice] [pid 8673] AH00169: caught SIGTERM, shutting down
[Sun Apr 20 10:11:37.504333 2014] [mpm_prefork:notice] [pid 1200]
AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured --
resuming normal operations [Sun Apr 20 10:11:37.529485 2014]
[core:notice] [pid 1200] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 20 10:19:25.905575 2014] [authz_core:error] [pid 1258]
[client 192.168.0.104:51256] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:19:26.280338 2014]
[authz_core:error] [pid 1258] [client 192.168.0.104:51256] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:19:29.229410 2014] [authz_core:error] [pid 1259]
[client 192.168.0.105:65294] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:20:55.582114 2014]
[authz_core:error] [pid 1257] [client 192.168.0.104:51261] AH01630:
client denied by server configuration: /home/inferusvv/www/ [Sun Apr
20 10:20:55.847450 2014] [authz_core:error] [pid 1257] [client
192.168.0.104:51261] AH01630: client denied by server configuration: /home/inferusvv/www/favicon.ico [Sun Apr 20 10:21:12.789489 2014]
[mpm_prefork:notice] [pid 1200] AH00169: caught SIGTERM, shutting down
[Sun Apr 20 10:21:13.870504 2014] [mpm_prefork:notice] [pid 3765]
AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured --
resuming normal operations [Sun Apr 20 10:21:13.870555 2014]
[core:notice] [pid 3765] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 20 10:21:19.459459 2014] [authz_core:error] [pid 3769]
[client 192.168.0.104:51267] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:21:19.736510 2014]
[authz_core:error] [pid 3769] [client 192.168.0.104:51267] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:21:20.248496 2014] [authz_core:error] [pid 3769]
[client 192.168.0.104:51267] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:21:20.443041 2014]
[authz_core:error] [pid 3769] [client 192.168.0.104:51267] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:21:20.479309 2014] [authz_core:error] [pid 3769]
[client 192.168.0.104:51267] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:21:20.684473 2014]
[authz_core:error] [pid 3769] [client 192.168.0.104:51267] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:21:20.697029 2014] [authz_core:error] [pid 3769]
[client 192.168.0.104:51267] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:21:20.872278 2014]
[authz_core:error] [pid 3769] [client 192.168.0.104:51267] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:21:20.898243 2014] [authz_core:error] [pid 3769]
[client 192.168.0.104:51267] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:21:21.086058 2014]
[authz_core:error] [pid 3769] [client 192.168.0.104:51267] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:21:21.097149 2014] [authz_core:error] [pid 3769]
[client 192.168.0.104:51267] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:21:21.301569 2014]
[authz_core:error] [pid 3769] [client 192.168.0.104:51267] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:21:21.303216 2014] [authz_core:error] [pid 3770]
[client 192.168.0.104:51268] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:21:21.501052 2014]
[authz_core:error] [pid 3770] [client 192.168.0.104:51268] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:21:21.504037 2014] [authz_core:error] [pid 3770]
[client 192.168.0.104:51268] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:21:21.696890 2014]
[authz_core:error] [pid 3770] [client 192.168.0.104:51268] AH01630:
client denied by server configuration: /home/inferusvv/www/ [Sun Apr
20 10:21:21.713474 2014] [authz_core:error] [pid 3770] [client
192.168.0.104:51268] AH01630: client denied by server configuration: /home/inferusvv/www/favicon.ico [Sun Apr 20 10:21:21.742161 2014]
[authz_core:error] [pid 3770] [client 192.168.0.104:51268] AH01630:
client denied by server configuration: /home/inferusvv/www/ [Sun Apr
20 10:21:21.756219 2014] [authz_core:error] [pid 3770] [client
192.168.0.104:51268] AH01630: client denied by server configuration: /home/inferusvv/www/favicon.ico [Sun Apr 20 10:21:21.942965 2014]
[authz_core:error] [pid 3770] [client 192.168.0.104:51268] AH01630:
client denied by server configuration: /home/inferusvv/www/favicon.ico
[Sun Apr 20 10:23:05.497139 2014] [authz_core:error] [pid 3770]
[client 192.168.0.105:65322] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:30:51.043435 2014]
[authz_core:error] [pid 3771] [client 192.168.0.105:65492] AH01630:
client denied by server configuration: /home/inferusvv/www/ [Sun Apr
20 10:32:24.632306 2014] [authz_core:error] [pid 3773] [client
192.168.0.105:65524] AH01630: client denied by server configuration: /home/inferusvv/www/ [Sun Apr 20 10:35:31.462412 2014]
[mpm_prefork:notice] [pid 3765] AH00169: caught SIGTERM, shutting down
[Sun Apr 20 10:36:07.925136 2014] [mpm_prefork:notice] [pid 1142]
AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured --
resuming normal operations [Sun Apr 20 10:36:07.972134 2014]
[core:notice] [pid 1142] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 20 10:36:37.234597 2014] [authz_core:error] [pid 1210]
[client 192.168.0.105:49159] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:36:44.817865 2014]
[authz_core:error] [pid 1211] [client 192.168.0.105:49160] AH01630:
client denied by server configuration: /home/inferusvv/www/ [Sun Apr
20 10:36:45.798784 2014] [authz_core:error] [pid 1211] [client
192.168.0.105:49160] AH01630: client denied by server configuration: /home/inferusvv/www/ [Sun Apr 20 10:45:28.535259 2014]
[mpm_prefork:notice] [pid 1142] AH00169: caught SIGTERM, shutting down
[Sun Apr 20 10:45:30.116919 2014] [mpm_prefork:notice] [pid 3020]
AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured --
resuming normal operations [Sun Apr 20 10:45:30.116957 2014]
[core:notice] [pid 3020] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 20 10:45:37.254292 2014] [authz_core:error] [pid 3024]
[client 192.168.0.105:49395] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:45:53.743871 2014]
[mpm_prefork:notice] [pid 3020] AH00169: caught SIGTERM, shutting down
[Sun Apr 20 10:45:55.390600 2014] [mpm_prefork:notice] [pid 3076]
AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured --
resuming normal operations [Sun Apr 20 10:45:55.390638 2014]
[core:notice] [pid 3076] AH00094: Command line: '/usr/sbin/apache2'
[Sun Apr 20 10:45:55.941496 2014] [authz_core:error] [pid 3080]
[client 192.168.0.105:49399] AH01630: client denied by server
configuration: /home/inferusvv/www/ [Sun Apr 20 10:45:56.554178 2014]
[authz_core:error] [pid 3080] [client 192.168.0.105:49399] AH01630:
client denied by server configuration: /home/inferusvv/www/ [Sun Apr
20 10:45:57.624453 2014] [authz_core:error] [pid 3080] [client
192.168.0.105:49399] AH01630: client denied by server configuration: /home/inferusvv/www/ [Sun Apr 20 10:45:57.981383 2014]
[authz_core:error] [pid 3080] [client 192.168.0.105:49399] AH01630:
client denied by server configuration: /home/inferusvv/www/ [Sun Apr
20 10:45:58.317833 2014] [authz_core:error] [pid 3080] [client
192.168.0.105:49399] AH01630: client denied by server configuration: /home/inferusvv/www/ [Sun Apr 20 10:49:18.226108 2014]
[authz_core:error] [pid 3081] [client 10.9.90.6:49511] AH01630: client
denied by server configuration: /home/inferusvv/www/ [Sun Apr 20
10:49:18.977140 2014] [authz_core:error] [pid 3081] [client
10.9.90.6:49511] AH01630: client denied by server configuration: /home/inferusvv/www/favicon.ico [Sun Apr 20 10:49:19.173951 2014]
[authz_core:error] [pid 3081] [client 10.9.90.6:49511] AH01630: client
denied by server configuration: /home/inferusvv/www/favicon.ico [Sun
Apr 20 10:53:52.613515 2014] [authz_core:error] [pid 3083] [client
10.9.90.6:49636] AH01630: client denied by server configuration: /home/inferusvv/www/ [Sun Apr 20 10:53:53.264924 2014]
[authz_core:error] [pid 3083] [client 10.9.90.6:49636] AH01630: client
denied by server configuration: /home/inferusvv/www/favicon.ico [Sun
Apr 20 10:53:53.410589 2014] [authz_core:error] [pid 3083] [client
10.9.90.6:49636] AH01630: client denied by server configuration: /home/inferusvv/www/favicon.ico
答案1
Apache2 需要索引文件,/
否则将返回 403 错误。创建/home/inferusvv/www/index.html
以修复此问题。
您还可以尝试使用 让 Apache2 成为该文件夹的所有者chown -R www-data:www-data /home/inferusvv/www
。