Eu estou gastando algum tempo tentando provisionar uma caixa do Vagrant rodando a partir de uma caixa de base do CentOS 7.
Depois de uma nova instalação do Apache, consigo acessar o servidor em http
e reiniciar o servidor, mas assim que eu adiciono hosts virtuais para https
, encontro erros. Este é um exemplo dos meus hosts virtuais:
<VirtualHost *:80>
ServerName example.example.com
DocumentRoot /var/www/example.example.com/web
ErrorLog /var/www/example.example.com/error.log
CustomLog /var/www/example.example.com/requests.log combined
</VirtualHost>
<VirtualHost *:443>
# Admin email, Servername, and ailases
ServerAdmin [email protected]
ServerName example.example.com
#Index file and document root
DirectoryIndex index.php
DocumentRoot /var/www/example.example.com/web
#SSL certs
SSLCertificateFile /etc/httpd/ssl/example.example.com.crt
SSLCertificateKeyFile /etc/httpd/ssl/example.example.com.key
#Log locations
LogLevel warn
ErrorLog /var/log/httpd/example.example.com/error.log
CustomLog /var/log/httpd/example.example.com/requests.log combined
</VirtualHost>
E isso é o que recebo quando executo apachectl restart
:
Job for httpd.service failed. See 'systemctl status httpd.service' and 'journalctl -xn' for details.
Então, naturalmente, faço o que me é dito e executo systemctl status httpd.service
, com a seguinte saída:
httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled)
Active: failed (Result: exit-code) since Wed 2015-07-29 00:56:20 UTC; 40s ago
Process: 21318 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=0/SUCCESS)
Process: 21317 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
Main PID: 21317 (code=exited, status=1/FAILURE)
Status: "Total requests: 11; Current requests/sec: 0; Current traffic: 0 B/sec"
Jul 29 00:56:20 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Jul 29 00:56:20 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jul 29 00:56:20 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Jul 29 00:56:20 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Não vejo nenhum erro real, apenas falha.
EDIT: Minha apachectl -t
de saída foi solicitada:
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
Syntax OK