summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2019-10-01 13:53:35 +0000
committerDennis Kobert <dennis@kobert.dev>2019-10-01 13:53:35 +0000
commitece1500b62c6f4a901e1acc07e150283fc95c6e3 (patch)
tree22ce3980811888f830879b231b53594824556c7e
parent2a86c71254fef89b5ec717d138316bc416eaaee9 (diff)
Change httpd conf
-rw-r--r--web-server/httpd.conf49
1 files changed, 32 insertions, 17 deletions
diff --git a/web-server/httpd.conf b/web-server/httpd.conf
index 07a11c7..255a88d 100644
--- a/web-server/httpd.conf
+++ b/web-server/httpd.conf
@@ -2,20 +2,20 @@
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
-# In particular, see
+# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
-# consult the online docs. You have been warned.
+# consult the online docs. You have been warned.
#
# Configuration and logfile names: If the filenames you specify for many
# of the server's control files begin with "/" (or "drive:/" for Win32), the
# server will use that explicit path. If the filenames do *not* begin
# with "/", the value of ServerRoot is prepended -- so "logs/access_log"
# with ServerRoot set to "/usr/local/apache2" will be interpreted by the
-# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
+# server as "/usr/local/apache2/logs/access_log", whereas "/logs/access_log"
# will be interpreted as '/logs/access_log'.
#
@@ -45,7 +45,7 @@ ServerRoot "/usr/local/apache2"
# ports, instead of the default. See also the <VirtualHost>
# directive.
#
-# Change this to Listen on specific IP addresses as shown below to
+# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses.
#
#Listen 12.34.56.78:80
@@ -130,7 +130,7 @@ LoadModule log_config_module modules/mod_log_config.so
LoadModule env_module modules/mod_env.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
-#LoadModule expires_module modules/mod_expires.so
+LoadModule expires_module modules/mod_expires.so
LoadModule headers_module modules/mod_headers.so
#LoadModule ident_module modules/mod_ident.so
#LoadModule usertrack_module modules/mod_usertrack.so
@@ -199,7 +199,7 @@ LoadModule alias_module modules/mod_alias.so
<IfModule unixd_module>
#
# If you wish httpd to run as a different user or group, you must run
-# httpd as root initially and it will switch.
+# httpd as root initially and it will switch.
#
# User/Group: The name (or #number) of the user/group to run httpd as.
# It is usually good practice to create a dedicated user and group for
@@ -240,7 +240,7 @@ ServerName www.kobert.dev:80
#
# Deny access to the entirety of your server's filesystem. You must
-# explicitly permit access to web content directories in other
+# explicitly permit access to web content directories in other
# <Directory> blocks below.
#
<Directory />
@@ -297,9 +297,24 @@ DocumentRoot "/usr/local/apache2/htdocs"
DirectoryIndex index.html
</IfModule>
+<IfModule mod_expires.c>
+ # Turn on the module.
+ ExpiresActive on
+ # Set the default expiry times.
+ ExpiresDefault "access plus 2 hours"
+ ExpiresByType text/html "access plus 10 minutes"
+ ExpiresByType text/javascript "access plus 1 year"
+ ExpiresByType application/javascript "access plus 1 year"
+ ExpiresByType text/css "access plus 1 year"
+ ExpiresByType image/png "access plus 1 year"
+ ExpiresByType image/jpg "access plus 1 year"
+ ExpiresByType image/jpeg "access plus 1 year"
+ ExpiresByType image/gif "access plus 1 year"
+</IfModule>
+
#
-# The following lines prevent .htaccess and .htpasswd files from being
-# viewed by Web clients.
+# The following lines prevent .htaccess and .htpasswd files from being
+# viewed by Web clients.
#
<Files ".ht*">
Require all denied
@@ -352,8 +367,8 @@ LogLevel warn
<IfModule alias_module>
#
- # Redirect: Allows you to tell clients about documents that used to
- # exist in your server's namespace, but do not anymore. The client
+ # Redirect: Allows you to tell clients about documents that used to
+ # exist in your server's namespace, but do not anymore. The client
# will make a new request for the document at its new location.
# Example:
# Redirect permanent /foo http://www.example.com/bar
@@ -370,7 +385,7 @@ LogLevel warn
# the filesystem path.
#
- # ScriptAlias: This controls which directories contain server scripts.
+ # ScriptAlias: This controls which directories contain server scripts.
# ScriptAliases are essentially the same as Aliases, except that
# documents in the target directory are treated as applications and
# run by the server when requested rather than as documents sent to the
@@ -482,10 +497,10 @@ LogLevel warn
#MaxRanges unlimited
#
-# EnableMMAP and EnableSendfile: On systems that support it,
+# EnableMMAP and EnableSendfile: On systems that support it,
# memory-mapping or the sendfile syscall may be used to deliver
# files. This usually improves server performance, but must
-# be turned off when serving from networked-mounted
+# be turned off when serving from networked-mounted
# filesystems or if support for these functions is otherwise
# broken on your system.
# Defaults: EnableMMAP On, EnableSendfile Off
@@ -495,9 +510,9 @@ LogLevel warn
# Supplemental configuration
#
-# The configuration files in the conf/extra/ directory can be
-# included to add extra features or to modify the default configuration of
-# the server, or you may simply copy their contents here and change as
+# The configuration files in the conf/extra/ directory can be
+# included to add extra features or to modify the default configuration of
+# the server, or you may simply copy their contents here and change as
# necessary.
# Server-pool management (MPM specific)