HowTo/Apache: mudanças entre as edições
< HowTo
(Criou página com '* Alterar o arquivo: '''/etc/apache2/apache2.conf''' <syntaxhighlight lang="bash" style="border: 1px solid blue;"> #<Directory /var/www/> <Directory /home/*/public_html/> Options Indexes FollowSymLinks #AllowOverride None AllowOverride All Require all granted </Directory> </syntaxhighlight> * E o arquivo: '''/etc/apache2/sites-enabled/000-default.conf''' <syntaxhighlight lang="bash" style="border: 1px solid blue;"> #DocumentRoot /var/www/html DocumentRoot /home/<us...') |
Sem resumo de edição |
||
Linha 1: | Linha 1: | ||
==Instalação== | |||
<syntaxhighlight lang="bash" style="border: 1px solid blue;"> | |||
sudo apt install apache2 | |||
</syntaxhighlight> | |||
==Configuração== | |||
* Alterar o arquivo: '''/etc/apache2/apache2.conf''' | * Alterar o arquivo: '''/etc/apache2/apache2.conf''' | ||
<syntaxhighlight lang="bash" style="border: 1px solid blue;"> | <syntaxhighlight lang="bash" style="border: 1px solid blue;"> |
Edição das 13h56min de 7 de junho de 2024
Instalação
sudo apt install apache2
Configuração
- Alterar o arquivo: /etc/apache2/apache2.conf
#<Directory /var/www/>
<Directory /home/*/public_html/>
Options Indexes FollowSymLinks
#AllowOverride None
AllowOverride All
Require all granted
</Directory>
- E o arquivo: /etc/apache2/sites-enabled/000-default.conf
#DocumentRoot /var/www/html
DocumentRoot /home/<username>/public_html
ATENÇÃO: Pegadinha ao definir o DocumentRoot no diretório: /home/<username>
- Deve-se conceder permissão de execução ao grupo do usuário no diretório do usuário em: /home
sudo chmod g+x /home/<username>
- Também é necessário incluir o usuário do Apache www-data ao grupo do usuário:
sudo usermod -aG <username> www-data
- Teste de leitura para o usuário do Apache no novo diretório:
sudo -u www-data test -r /home/<username>/public_html/ && echo OK || echo not OK