更改 trueCrypt 分区中的 Apache DocumentDirectory 路径

更改 trueCrypt 分区中的 Apache DocumentDirectory 路径

我最近从 Windows 转到 Linux,所以我将我的机器设置为双启动 Windows7 和 Ubuntu 10.04。我能够在 Ubuntu 分区上成功设置 Apache,但我需要移动 DocumentRoot,因为我的网站位于另一个硬盘驱动器中的 TrueCrypt 分区上,这样我才能在两个操作系统中访问它们。我遵循了一些关于如何更改 DocumentRoot 路径的指南,所以我最终修改了默认文件位于/etc/apache2/站点可用

DocumentRoot /media/truecrypt1/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /media/truecrypt1/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>

这些是我更改过的行,但现在当我访问 localhost 时,我总是得到 禁止访问 您无权访问此服务器上的 /。Apache/2.2.14 (Ubuntu) 服务器位于本地主机端口 80

答案1

可能是 /media/truecrypt/www 上的权限未设置为 Apache 运行时用户/组(可能是 www-data:www-data)可以访问的位置。使用 chown 至少将组递归设置为 /media/truecrypt/www 上的 www-data,并确保 chmod 为 750 或 770(如果您有 cgi 或其他需要该目录写入权限的脚本)。

不要在 /media/truecrypt/www 上使用 chmod 755 或 775(绝对不是 777),因为你可能不希望 Apache 以外的进程作为 www-data:www-data 访问你的 Truecrypted 文件

相关内容