Fórum Ubuntu Linux - PT

Suporte Técnico => Servidores => Tópico iniciado por: LeandroCGMS em 07 de Dezembro de 2018, 12:26

Título: VirtualHost Forbidden
Enviado por: LeandroCGMS em 07 de Dezembro de 2018, 12:26
Bom dia. Já tentei várias opções pra tentar fazer rodar o virtual host que o Apache encontra, pois o /etc/hosts também está configurado, mas sempre dá a mensagem de que eu não tenho a permissão necessária pra acessá-lo. Adicionei o +x, o +o no chmod, coloquei o usuário e grupo, ora como eu:eu, agora, como eu:www-data e nada de acessar.
Meu arquivo 000-default.conf está assim:

<VirtualHost *:80>
   # The ServerName directive sets the request scheme, hostname and port that
   # the server uses to identify itself. This is used when creating
   # redirection URLs. In the context of virtual hosts, the ServerName
   # specifies what hostname must appear in the request's Host: header to
   # match this virtual host. For the default virtual host (this file) this
   # value is not decisive as it is used as a last resort host regardless.
   # However, you must set it for any further virtual host explicitly.
   #ServerName www.example.com

   ServerAdmin webmaster@localhost
   DocumentRoot /var/www/html

   # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
   # error, crit, alert, emerg.
   # It is also possible to configure the loglevel for particular
   # modules, e.g.
   #LogLevel info ssl:warn

   ErrorLog ${APACHE_LOG_DIR}/error.log
   CustomLog ${APACHE_LOG_DIR}/access.log combined

   # For most configuration files from conf-available/, which are
   # enabled or disabled at a global level, it is possible to
   # include a line for only one particular virtual host. For example the
   # following line enables the CGI configuration for this host only
   # after it has been globally disabled with "a2disconf".
   #Include conf-available/serve-cgi-bin.conf
</VirtualHost>
<VirtualHost *:80>
        ServerName dev.laravel53-basico
DocumentRoot /home/leandro/cursolaravel/laravel53-saldo/public
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Título: Re:VirtualHost Forbidden
Enviado por: zekkerj em 07 de Dezembro de 2018, 13:48
Posta as 10 últimas linhas do log de erro do Apache, por favor.

tail -10 /var/log/apache2/error_log

Posta também as permissões do caminho do DocumentRoot desse VirtualHost.

namei -om /home/leandro/cursolaravel/laravel53-saldo/public
Título: Re:VirtualHost Forbidden
Enviado por: LeandroCGMS em 07 de Dezembro de 2018, 21:22
tail -10 /var/log/apache2/error_log
tail: não foi possível abrir '/var/log/apache2/error_log' para leitura: Arquivo ou diretório inexistente

namei -om /home/leandro/cursolaravel/laravel53-saldo/public
f: /home/leandro/cursolaravel/laravel53-saldo/public
 drwxr-xr-x root     root     /
 drwxr-xr-x root     root     home
 drwxr-xr-x leandro  leandro  leandro
 drwxrwxrwx www-data www-data cursolaravel
                              laravel53-saldo - arquivo ou diretório inexistente
Título: Re:VirtualHost Forbidden
Enviado por: zekkerj em 07 de Dezembro de 2018, 23:29
Precisa ver se o seu Apache está gerando log em outro lugar, e ajustar o comando.

Sobre o caminho que vc indicou pro site, parece que não foi criado corretamente. Verifique e corrija.
Título: Re:VirtualHost Forbidden
Enviado por: LeandroCGMS em 08 de Dezembro de 2018, 12:17
Para alguns tipos de servidores, como o Wampp, o arquivo é o httpd.conf. No meu caso, no arquivo apache2.conf, dentro de /etc/apache2 tem que mudar denied para granted na tag Directory que descreve a "/":
<Directory />
   Options FollowSymLinks
   AllowOverride None
   Require all granted
</Directory>