|
# |
|
# ServerRoot: The top of the directory tree under which the server's |
|
# configuration, error, and log files are kept. |
|
# |
|
# Do not add a slash at the end of the directory path. If you point |
|
# ServerRoot at a non-local disk, be sure to specify a local disk on the |
|
# Mutex directive, if file-based mutexes are used. If you wish to share the |
|
# same ServerRoot for multiple httpd daemons, you will need to change at |
|
# least PidFile. |
|
# |
|
ServerRoot "/usr/local/apache2" |
|
|
|
# |
|
# Listen: Allows you to bind Apache to specific IP addresses and/or |
|
# ports, instead of the default. See also the <VirtualHost> |
|
# directive. |
|
# |
|
# Change this to Listen on specific IP addresses as shown below to |
|
# prevent Apache from glomming onto all bound IP addresses. |
|
# |
|
Listen 80 |
|
Listen 443 |
|
|
|
# |
|
# Dynamic Shared Object (DSO) Support |
|
# |
|
# To be able to use the functionality of a module which was built as a DSO you |
|
# have to place corresponding `LoadModule' lines at this location so the |
|
# directives contained in it are actually available _before_ they are used. |
|
# Statically compiled modules (those listed by `httpd -l') do not need |
|
# to be loaded here. |
|
# |
|
LoadModule mpm_event_module modules/mod_mpm_event.so |
|
LoadModule authn_file_module modules/mod_authn_file.so |
|
LoadModule authn_core_module modules/mod_authn_core.so |
|
LoadModule authz_host_module modules/mod_authz_host.so |
|
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so |
|
LoadModule authz_user_module modules/mod_authz_user.so |
|
LoadModule authz_core_module modules/mod_authz_core.so |
|
LoadModule access_compat_module modules/mod_access_compat.so |
|
LoadModule auth_basic_module modules/mod_auth_basic.so |
|
LoadModule reqtimeout_module modules/mod_reqtimeout.so |
|
LoadModule filter_module modules/mod_filter.so |
|
LoadModule mime_module modules/mod_mime.so |
|
LoadModule log_config_module modules/mod_log_config.so |
|
LoadModule env_module modules/mod_env.so |
|
LoadModule headers_module modules/mod_headers.so |
|
LoadModule setenvif_module modules/mod_setenvif.so |
|
LoadModule version_module modules/mod_version.so |
|
LoadModule ssl_module modules/mod_ssl.so |
|
LoadModule unixd_module modules/mod_unixd.so |
|
LoadModule status_module modules/mod_status.so |
|
LoadModule autoindex_module modules/mod_autoindex.so |
|
LoadModule dir_module modules/mod_dir.so |
|
LoadModule alias_module modules/mod_alias.so |
|
LoadModule rewrite_module modules/mod_rewrite.so |
|
|
|
ServerName localhost |
|
|
|
<IfModule mod_rewrite.c> |
|
RewriteEngine On |
|
</IfModule> |
|
|
|
<VirtualHost *:80> |
|
RewriteEngine On |
|
RewriteCond %{HTTPS} off |
|
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
|
</VirtualHost> |
|
|
|
<VirtualHost *:443> |
|
SSLEngine On |
|
SSLCertificateFile "/usr/local/apache2/conf/server.crt" |
|
SSLCertificateKeyFile "/usr/local/apache2/conf/server.key" |
|
|
|
# Allow requests to HTTP resources |
|
# @see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/upgrade-insecure-requests |
|
Header always set Content-Security-Policy "upgrade-insecure-requests;" |
|
|
|
DocumentRoot "/usr/local/apache2/htdocs" |
|
ServerName localhost |
|
ServerAlias www.localhost |
|
|
|
<Directory "/usr/local/apache2/htdocs"> |
|
AllowOverride All |
|
Require all granted |
|
</Directory> |
|
</VirtualHost> |