Eu gostaria que o Apache servisse arquivos "normais" de /srv/http/public
, e arquivos de usuário de /srv/http/[user]
, para que os diretórios pudessem parecer
/srv/http
/public
index.html - Accessible at localhost/index.html
/austin
index.html - Accessible at localhost/~austin/index.html
No momento, tenho as seguintes configurações relevantes nos .conf
arquivos do Apache
User http
Group http
DocumentRoot "/srv/http/public"
<Directory "/srv/http/public">
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>
UserDir /srv/http
UserDir disabled root
<Directory "/srv/http">
AllowOverride FileInfo AuthConfig Limit Indexes
Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
<Limit GET POST OPTIONS>
Order allow,deny
Allow from all
</Limit>
<LimitExcept GET POST OPTIONS>
Order deny,allow
Deny from all
</LimitExcept>
</Directory>
E as seguintes permissões em /srv/http
:
drwxr-xr-x root http /srv/http
drwxr-xr-x http http /srv/http/public
-rwxr-xr-x http http /srv/http/public/index.html
drwxr-xr-x austin http /srv/http/austin
-rwxr-xr-x austin http /srv/http/austin/index.html
Usando esta configuração, localhost/index.html
exibe bem, mas localhost/~austin/index.html
dá uma403 Acesso proibido!erro, não importa o que eu tente.
Editar:a entrada error_log relevante: [error] [client ::1] client denied by server configuration: /srv/http/austin/index.html
O que estou fazendo de errado?
Ah, e não acho que isso realmente importe, mas estou usando Arch Linux e Apache 2.2.19
Responder1
O problema era que a <Directory>
diretiva para os diretórios de usuários era muito restritiva.
A reutilização das mesmas diretivas do /srv/http/public
diretório permite que o mundo externo veja quaisquer arquivos do usuário:
<Directory "/srv/http">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>