我是ubuntu(和Linux)的新手,并且有一个简单的问题 .
我已安装目录/ media / 2A98EDD2ACA90087 / WebProject /并希望将http:/ localhost /从var / www移至/ media / 2A98EDD2ACA90087 / WebProject /
我更改了站点启用/ 000-default和/ etc / apache2 / sites-available
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /media/2A98EDD2ACA90087/WebProject
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /media/2A98EDD2ACA90087/WebProject>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>
</VirtualHost>
并有这个apache消息!
Forbidden You don't have permission to access / on this server
当我创建“test”目录并将localhost从var / www移动到var / www / test时 - 一切正常 . 我想文件权限问题??我该怎么办?
问题已经解决了 . 谢谢Patrick和Joh . 真的需要给index.html提供读访问权:chmod 644 /media/2A98EDD2ACA90087/WebProject/index.html
但我无法更改我的Ntfs挂载驱动器的访问权限 . 我要重新安装
为什么无法在ubuntu上更改外部硬盘的权限所有权组
1 回答
apache服务器作为特定用户运行 - 可能是"apache",您可以运行
ps
来查看 - 并且该用户必须具有访问webroot的权限 . 你可以让它由apache拥有,或者使它成为组可读的(并且你是'll probably want it group-writable) and either add apache to the group that owns it, or change the group to apache'的组 .假设httpd运行为“apache”(组:apache)而你是“jdoe”(组:jdoe)