I'm currently trying to create a page with apache2
on a Debian stretch to host an app but when I a2ensite
the HTTP version it just doesn't work, and when I enable the ssl
one the entire server stops working, even the pages not related to that one page. Both conf files are fine, I'm stuck, any idea what could be wrong?
EDIT: Logs show this, at 09:06:37 I a2ensite, and stops working, at 09:07:01 I a2dissite and it works again:
[Fri Jul 13 09:06:37.059026 2018] [mpm_prefork:notice] [pid 20067] AH00171:
Graceful restart requested, doing restart
[Fri Jul 13 09:06:37.245485 2018] [mpm_prefork:notice] [pid 20067] AH00163:
Apache/2.4.10 (Debian) OpenSSL/1.0.1t configured -- resuming normal operations
[Fri Jul 13 09:06:37.245513 2018] [core:notice] [pid 20067] AH00094: Command
line: '/usr/sbin/apache2'
[Fri Jul 13 09:07:01.050648 2018] [mpm_prefork:notice] [pid 20067] AH00171:
Graceful restart requested, doing restart
[Fri Jul 13 09:07:01.171448 2018] [mpm_prefork:notice] [pid 20067] AH00163:
Apache/2.4.10 (Debian) OpenSSL/1.0.1t configured -- resuming normal
operations
[Fri Jul 13 09:07:01.171475 2018] [core:notice] [pid 20067] AH00094: Command
line: '/usr/sbin/apache2'
EDIT: Both .Conf files content:
<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 (...)
DocumentRoot /var/www/html/(site)
ServerName (site)
# 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
<Directory "/var/www/html/(site)">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
RewriteEngine on
RewriteCond %{SERVER_NAME} =(site)
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
The SSL one:
<IfModule mod_ssl.c>
<VirtualHost *:443>
# 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 (...)
DocumentRoot /var/www/html/(site)
ServerName (site)
# 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
<Directory "/var/www/html/(site)">
DirectoryIndex index.php
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
</IfModule>