议程:在Linux和Windows之间具有公共项目文件夹
我在Ubuntu 14.04机器上将文档根目录从/var/www/html
更改为/media/mithun/Projects/test
我收到错误提示:
Forbidden
您无权访问此服务器上的/。
位于本地主机端口80的Apache / 2.4.7(Ubuntu)服务器
所以我将一些脚本添加到:sudo gedit /etc/apache2/sites-available/000-default.conf
# DocumentRoot /var/www/html
DocumentRoot /media/mithun/Projects/test
但是Document Root /var/www/test
有效,但不适用于Windows NTFS分区驱动器。
甚至在引用后:
没有成功:(请帮助我...
注意: 项目是新卷(内部驱动器:在Windows中,其E:/驱动器)
@@ Lmwangi-请在下面检查我的更新以供参考:
输出:
ls /etc/apparmor.d/
abstractions lightdm-guest-session usr.bin.evince usr.sbin.cupsd cache local usr.bin.firefox usr.sbin.mysqld disable sbin.dhclient usr.lib.telepathy usr.sbin.rsyslogd force-complain tunables usr.sbin.cups-browsed usr.sbin.tcpdump
我曾尝试杀死过装甲:
sudo /etc/init.d/apparmor kill
我接收输出为:
Usage: /etc/init.d/apparmor {start|stop|restart|reload|force-reload|status|recache}
此后,我也能够成功地重新启动apache
也许问题很简单:www-data用户可以访问您的新根目录吗?尝试:
$ chown -R www-data:www-data /media/mithun/Projects
到现在为止您已经发现,不能仅使用(例如chmod
之类的工具)操纵NTFS分区上的权限
但是,在安装分区时,您可以尝试强制给定整个分区的所有者/权限。
现在执行此操作的方法取决于您实际使用的NTFS实用程序(而且我不知道,因此我假设您使用的是ntfs-3g
)
例如用以下参数安装分区(用实际分区替换dev/sdX
,用目标路径替换/path/to/where
drive / is / mount`):
mount -o gid=www-data /dev/sdX /path/where/the/drive/is/mounted
应该使分区上的所有文件都属于www-data
组。
如果文件系统显式设置组所有权,则这可能仍然不起作用。在这种情况下,您可能需要设置usermap
,它将Windows用户/组(在分区上找到)映射到Linux用户/组。
ntfs-3g.usermap
实用程序将帮助您生成一个初始用户映射文件,然后您可以根据需要对其进行编辑:
ntfs-3g.usermap /dev/sdX
然后将用户映射传递给安装选项:
mount -o usermapping=/path/to/usermap.file /dev/sdX /path/where/the/drive/is/mounted
尽管在Windows上使用ubuntu时,我遇到了同样的问题,可以通过重新安装具有读写访问权限的驱动器来解决。下面的命令将帮助您做到这一点:
sudo mount -o remount,rw /disk/location /disk/new_location