Estou tentando solucionar problemas de uma instância do Apache que estava funcionando bem até uma reinicialização na semana passada. Agora parece que os vhosts não estão sendo carregados e não consigo entender o porquê.
Qualquer tentativa de acessar app.domain.com, que deve encaminhar para a raiz do documento do vhost, na verdade aponta para a raiz do documento do servidor principal.
O httpd.conf está abaixo (com alguns pequenos ofuscamentos)
ServerRoot "/etc/httpd"
Listen 80
Include conf.modules.d/*.conf
User web-user
Group web-group
ServerAdmin [email protected]
DocumentRoot "/var/www/html"
<Directory />
AllowOverride all
Require all denied
</Directory>
<Directory "/var/www">
#Previous value none
AllowOverride none
# Allow open access:
Require all granted
</Directory>
# Further relax access to the default document root:
<Directory "/var/www/html">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
################### VHOST Directory #######################
<Directory "/apps/app/public_html">
Order allow,deny
Allow from all
Require all granted
</Directory>
<IfModule dir_module>
DirectoryIndex index.html
</IfModule>
<Files ".ht*">
Require all denied
</Files>
ErrorLog "logs/error_log"
LogLevel warn
<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b" common
<IfModule logio_module>
# You need to enable mod_logio.c to use %I and %O
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
</IfModule>
CustomLog "logs/access_log" combined
</IfModule>
<IfModule alias_module>
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
</IfModule>
<Directory "/var/www/cgi-bin">
AllowOverride None
Options None
Require all granted
</Directory>
<IfModule mime_module>
TypesConfig /etc/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
</IfModule>
AddDefaultCharset UTF-8
<IfModule mime_magic_module>
MIMEMagicFile conf/magic
</IfModule>
EnableSendfile on
IncludeOptional conf.d/*.conf
IncludeOptional sites-enabled/*.conf
O arquivo vhost.conf localizado em sites habilitados
<VirtualHost *:443>
ServerName app.domain.com
ServerAlias app.domain.com
DocumentRoot /apps/app/public_html
ErrorLog /var/www/app/error_log
CustomLog /var/www/app/access_log combined
</VirtualHost>
Eu também tenho um arquivo .htaccess na raiz do documento principal (/ var / www / html) que redireciona qualquer tráfego de texto sem formatação para o site SSL.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://app.domain.com/$1 [R,L]
Alguém consegue identificar o erro na minha configuração?
EDIT: Resultado do httpd -S
[root@server]# httpd -S
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using app.domain.com. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443 is a NameVirtualHost
default server app.domain.com (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost app.domain.com (/etc/httpd/conf.d/ssl.conf:56)
port 443 namevhost app.domain.com (/etc/httpd/sites-enabled/app.conf:1)
alias app.domain.com
ServerRoot: "/etc/httpd"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/etc/httpd/logs/error_log"
Mutex authdigest-opaque: using_defaults
Mutex proxy-balancer-shm: using_defaults
Mutex rewrite-map: using_defaults
Mutex authdigest-client: using_defaults
Mutex ssl-stapling: using_defaults
Mutex proxy: using_defaults
Mutex authn-socache: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/run/httpd/" mechanism=default
Mutex mpm-accept: using_defaults
PidFile: "/run/httpd/httpd.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="web-user" id=1001
Group: name="web-group" id=1001