我有使用 mediawiki 上传的图像文件,它们将所有者设置为 www-data。查看文件导致 403 禁止。(所有其他站点文件归 SITE_USER 所有)。
SITE_USER 和 www-data 都位于彼此的(次要)组中。
我在这里遗漏了什么?
编辑:我的 Apache 指令
DocumentRoot "/home/SITE_USER/public_html/en.domain.org"
ServerName en.domain.org
# Alias for Wiki so images work
Alias /images "/home/SITE_USER/public_html/mediawiki/sites/images"
<Directory "/home/SITE_USER/public_html/en.domain.org">
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ %{DOCUMENT_ROOT}//index.php [L]
## http://www.mediawiki.org/wiki/Manual:Short_URL/Apache
# Enable the rewrite engine
RewriteEngine On
# Short url for wiki pages
RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/index.php [L]
# Redirect / to Main Page
RewriteRule ^/*$ %{DOCUMENT_ROOT}/index.php [L]
#
Options -Indexes +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
Require all granted
</Directory>
答案1
我通过添加修复了它
<Directory "/home/DOMAIN/public_html/mediawiki/sites/images">
allow from all
Require all granted
</Directory>