Skip to content

Commit d8553ee

Browse files
committed
Full documentation review
1 parent ea8c517 commit d8553ee

33 files changed

+229
-244
lines changed

httpd.conf

+16-17
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Configuration File - Apache Server Configs
22
# https://httpd.apache.org/docs/current/
33

4-
# Sets the top of the directory tree under which the server's
5-
# configuration, error, and log files are kept.
4+
# Sets the top of the directory tree under which the server's configuration,
5+
# error, and log files are kept.
66
# Do not add a slash at the end of the directory path.
7-
# If you point ServerRoot at a non-local disk, be sure to specify
8-
# a local disk on the Mutex directive, if file-based mutexes are used.
9-
# If you wish to share the same ServerRoot for multiple httpd daemons,
10-
# you will need to change at least PidFile.
7+
# If you point ServerRoot at a non-local disk, be sure to specify a local disk
8+
# on the Mutex directive, if file-based mutexes are used.
9+
# If you wish to share the same ServerRoot for multiple httpd daemons, you will
10+
# need to change at least PidFile.
1111
# https://httpd.apache.org/docs/current/mod/core.html#serverroot
1212
ServerRoot "/usr/local/apache2"
1313

@@ -66,15 +66,15 @@ LogLevel warn
6666
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\"" combined
6767

6868
# The location and format of the access logfile.
69-
# If you *do* define per-<VirtualHost> access logfiles, transactions will be
70-
# logged therein and *not* in this file.
69+
# If you *do* define per-<VirtualHost> access logfiles, transactions will
70+
# be logged therein and *not* in this file.
7171
# https://httpd.apache.org/docs/current/mod/mod_log_config.html#customlog
7272
CustomLog logs/access.log combined
7373
</IfModule>
7474

75-
# Prevent Apache from sending in the `Server` response header its
76-
# exact version number, the description of the generic OS-type or
77-
# information about its compiled-in modules.
75+
# Prevent Apache from sending its version number, the description of the
76+
# generic OS-type or information about its compiled-in modules in the "Server"
77+
# response header.
7878
# https://httpd.apache.org/docs/current/mod/core.html#servertokens
7979
ServerTokens Prod
8080
Include h5bp/security/server_software_information.conf
@@ -122,12 +122,11 @@ Include h5bp/media_types/media_types.conf
122122
# Set character encodings.
123123
Include h5bp/media_types/character_encodings.conf
124124

125-
# On systems that support it, memory-mapping or the sendfile
126-
# syscall may be used to deliver files.
127-
# This usually improves server performance, but must
128-
# be turned off when serving from networked-mounted
129-
# filesystems or if support for these functions is otherwise
130-
# broken on your system.
125+
# On systems that support it, memory-mapping or the sendfile syscall may be
126+
# used to deliver files.
127+
# This usually improves server performance, but must be turned off when serving
128+
# from networked-mounted filesystems or if support for these functions is
129+
# otherwise broken on your system.
131130
# Defaults: EnableMMAP On, EnableSendfile Off
132131
# https://httpd.apache.org/docs/current/mod/core.html#enablemmap
133132
# https://httpd.apache.org/docs/current/mod/core.html#enablesendfile

src/cross-origin/requests.conf

+7
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
# https://enable-cors.org/
99
# https://www.w3.org/TR/cors/
1010

11+
# (!) Do not use this without understanding the consequences.
12+
# This will permit access from any other website.
13+
# Instead of using this file, consider using a specific rule such as
14+
# allowing access based on (sub)domain:
15+
#
16+
# Header set Access-Control-Allow-Origin "subdomain.example.com"
17+
1118
<IfModule mod_headers.c>
1219
Header set Access-Control-Allow-Origin "*"
1320
</IfModule>

src/cross-origin/resource_timing.conf

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44

55
# Allow cross-origin access to the timing information for all resources.
66
#
7-
# If a resource isn't served with a `Timing-Allow-Origin` header that
8-
# would allow its timing information to be shared with the document,
9-
# some of the attributes of the `PerformanceResourceTiming` object will
10-
# be set to zero.
7+
# If a resource isn't served with a `Timing-Allow-Origin` header that would
8+
# allow its timing information to be shared with the document, some of the
9+
# attributes of the `PerformanceResourceTiming` object will be set to zero.
1110
#
1211
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Timing-Allow-Origin
1312
# https://www.w3.org/TR/resource-timing/

src/errors/error_prevention.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
# Disable the pattern matching based on filenames.
66
#
7-
# This setting prevents Apache from returning a 404 error as the result
8-
# of a rewrite when the directory with the same name does not exist.
7+
# This setting prevents Apache from returning a 404 error as the result of a
8+
# rewrite when the directory with the same name does not exist.
99
#
1010
# https://httpd.apache.org/docs/current/content-negotiation.html#multiviews
1111

src/internet_explorer/x-ua-compatible.conf

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
# https://hsivonen.fi/doctype/#ie8
99
#
1010
# (!) Starting with Internet Explorer 11, document modes are deprecated.
11-
# If your business still relies on older web apps and services that were
12-
# designed for older versions of Internet Explorer, you might want to
13-
# consider enabling `Enterprise Mode` throughout your company.
11+
# If your business still relies on older web apps and services that were
12+
# designed for older versions of Internet Explorer, you might want to
13+
# consider enabling `Enterprise Mode` throughout your company.
1414
#
1515
# https://msdn.microsoft.com/en-us/library/ie/bg182625.aspx#docmode
1616
# https://blogs.msdn.microsoft.com/ie/2014/04/02/stay-up-to-date-with-enterprise-mode-for-internet-explorer-11/

src/media_types/character_encodings.conf

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
# | Character encodings |
33
# ----------------------------------------------------------------------
44

5-
# Serve all resources labeled as `text/html` or `text/plain`
6-
# with the media type `charset` parameter set to `UTF-8`.
5+
# Serve all resources labeled as `text/html` or `text/plain` with the media type
6+
# `charset` parameter set to `UTF-8`.
77
#
88
# https://httpd.apache.org/docs/current/mod/core.html#adddefaultcharset
99

1010
AddDefaultCharset utf-8
1111

1212
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1313

14-
# Serve the following file types with the media type `charset`
15-
# parameter set to `UTF-8`.
14+
# Serve the following file types with the media type `charset` parameter set to
15+
# `UTF-8`.
1616
#
1717
# https://httpd.apache.org/docs/current/mod/mod_mime.html#addcharset
1818

src/media_types/media_types.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
AddType video/webm webm
4848
AddType video/x-flv flv
4949

50-
# Serving `.ico` image files with a different media type
51-
# prevents Internet Explorer from displaying them as images:
50+
# Serving `.ico` image files with a different media type prevents
51+
# Internet Explorer from displaying them as images:
5252
# https://github.com/h5bp/html5-boilerplate/commit/37b5fec090d00f38de64b591bcddcb205aadf8ee
5353

5454
AddType image/x-icon cur ico

src/rewrites/rewrite_engine.conf

+8-9
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22
# | Rewrite engine |
33
# ----------------------------------------------------------------------
44

5-
# (1) Turn on the rewrite engine (this is necessary in order for
6-
# the `RewriteRule` directives to work).
5+
# (1) Turn on the rewrite engine (this is necessary in order for the
6+
# `RewriteRule` directives to work).
77
#
88
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#RewriteEngine
99
#
1010
# (2) Enable the `FollowSymLinks` option if it isn't already.
1111
#
1212
# https://httpd.apache.org/docs/current/mod/core.html#options
1313
#
14-
# (3) If your web host doesn't allow the `FollowSymlinks` option,
15-
# you need to comment it out or remove it, and then uncomment
16-
# the `Options +SymLinksIfOwnerMatch` line (4), but be aware
17-
# of the performance impact.
14+
# (3) If your web host doesn't allow the `FollowSymlinks` option, you need to
15+
# comment it out or remove it, and then uncomment the
16+
# `Options +SymLinksIfOwnerMatch` line (4), but be aware of the performance
17+
# impact.
1818
#
1919
# https://httpd.apache.org/docs/current/misc/perf-tuning.html#symlinks
2020
#
@@ -23,9 +23,8 @@
2323
# https://www.rackspace.com/knowledge_center/frequently-asked-question/why-is-modrewrite-not-working-on-my-site
2424
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewritebase
2525
#
26-
# (5) Depending on how your server is set up, you may also need to
27-
# use the `RewriteOptions` directive to enable some options for
28-
# the rewrite engine.
26+
# (5) Depending on how your server is set up, you may also need to use the
27+
# `RewriteOptions` directive to enable some options for the rewrite engine.
2928
#
3029
# https://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriteoptions
3130

src/rewrites/rewrite_http_to_https.conf

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,9 @@
66
#
77
# https://wiki.apache.org/httpd/RewriteHTTPToHTTPS
88

9-
# (1) If you're using cPanel AutoSSL or the Let's Encrypt webroot
10-
# method it will fail to validate the certificate if validation
11-
# requests are redirected to HTTPS. Turn on the condition(s)
12-
# you need.
9+
# (1) If you're using cPanel AutoSSL or the Let's Encrypt webroot method it
10+
# will fail to validate the certificate if validation requests are
11+
# redirected to HTTPS. Turn on the condition(s) you need.
1312
#
1413
# https://www.iana.org/assignments/well-known-uris/well-known-uris.xhtml
1514
# https://tools.ietf.org/html/draft-ietf-acme-acme-12

src/rewrites/rewrite_nowww.conf

+8-9
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44

55
# Rewrite www.example.com → example.com
66

7-
# The same content should never be available under two different
8-
# URLs, especially not with and without `www.` at the beginning.
9-
# This can cause SEO problems (duplicate content), and therefore,
10-
# you should choose one of the alternatives and redirect the other
11-
# one.
7+
# The same content should never be available under two different URLs,
8+
# especially not with and without `www.` at the beginning.
9+
# This can cause SEO problems (duplicate content), and therefore, you should
10+
# choose one of the alternatives and redirect the other one.
1211
#
1312
# (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
1413

1514
# (1) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
1615
# appropriate schema automatically (http or https).
1716
#
18-
# (2) The rule assumes by default that both HTTP and HTTPS
19-
# environments are available for redirection.
20-
# If your SSL certificate could not handle one of the domains
21-
# used during redirection, you should turn the condition on.
17+
# (2) The rule assumes by default that both HTTP and HTTPS environments are
18+
# available for redirection.
19+
# If your SSL certificate could not handle one of the domains used during
20+
# redirection, you should turn the condition on.
2221
#
2322
# https://github.com/h5bp/server-configs-apache/issues/52
2423

src/rewrites/rewrite_www.conf

+8-9
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,20 @@
44

55
# Rewrite example.com → www.example.com
66

7-
# The same content should never be available under two different
8-
# URLs, especially not with and without `www.` at the beginning.
9-
# This can cause SEO problems (duplicate content), and therefore,
10-
# you should choose one of the alternatives and redirect the other
11-
# one.
7+
# The same content should never be available under two different URLs,
8+
# especially not with and without `www.` at the beginning.
9+
# This can cause SEO problems (duplicate content), and therefore, you should
10+
# choose one of the alternatives and redirect the other one.
1211
#
1312
# (!) NEVER USE BOTH WWW-RELATED RULES AT THE SAME TIME!
1413

1514
# (1) Set %{ENV:PROTO} variable, to allow rewrites to redirect with the
1615
# appropriate schema automatically (http or https).
1716
#
18-
# (2) The rule assumes by default that both HTTP and HTTPS
19-
# environments are available for redirection.
20-
# If your SSL certificate could not handle one of the domains
21-
# used during redirection, you should turn the condition on.
17+
# (2) The rule assumes by default that both HTTP and HTTPS environments are
18+
# available for redirection.
19+
# If your SSL certificate could not handle one of the domains used during
20+
# redirection, you should turn the condition on.
2221
#
2322
# https://github.com/h5bp/server-configs-apache/issues/52
2423

src/security/content-security-policy.conf

+28-29
Original file line numberDiff line numberDiff line change
@@ -5,54 +5,53 @@
55
# Mitigate the risk of cross-site scripting and other content-injection
66
# attacks.
77
#
8-
# This can be done by setting a `Content Security Policy` which
9-
# whitelists trusted sources of content for your website.
8+
# This can be done by setting a `Content Security Policy` which whitelists
9+
# trusted sources of content for your website.
1010
#
11-
# There is no policy that fits all websites, you will have to modify
12-
# the `Content-Security-Policy` directives in the example depending
13-
# on your needs.
11+
# There is no policy that fits all websites, you will have to modify the
12+
# `Content-Security-Policy` directives in the example depending on your needs.
1413
#
1514
# The example policy below aims to:
1615
#
17-
# (1) Restrict all fetches by default to the origin of the current website
18-
# by setting the `default-src` directive to `'self'` - which acts as a
16+
# (1) Restrict all fetches by default to the origin of the current website by
17+
# setting the `default-src` directive to `'self'` - which acts as a
1918
# fallback to all "Fetch directives" (https://developer.mozilla.org/en-US/docs/Glossary/Fetch_directive).
2019
#
2120
# This is convenient as you do not have to specify all Fetch directives
2221
# that apply to your site, for example:
2322
# `connect-src 'self'; font-src 'self'; script-src 'self'; style-src 'self'`, etc.
2423
#
25-
# This restriction also means that you must explicitly define from
26-
# which site(s) your website is allowed to load resources from.
24+
# This restriction also means that you must explicitly define from which
25+
# site(s) your website is allowed to load resources from.
2726
#
28-
# (2) The `<base>` element is not allowed on the website. This is to
29-
# prevent attackers from changing the locations of resources loaded
30-
# from relative URLs.
27+
# (2) The `<base>` element is not allowed on the website. This is to prevent
28+
# attackers from changing the locations of resources loaded from relative
29+
# URLs.
3130
#
32-
# If you want to use the `<base>` element, then `base-uri 'self'`
33-
# can be used instead.
31+
# If you want to use the `<base>` element, then `base-uri 'self'` can be
32+
# used instead.
3433
#
35-
# (3) Form submissions are only allowed from the current website by
36-
# setting: `form-action 'self'`.
34+
# (3) Form submissions are only allowed from the current website by setting:
35+
# `form-action 'self'`.
3736
#
38-
# (4) Prevents all websites (including your own) from embedding your
39-
# webpages within e.g. the `<iframe>` or `<object>` element by
40-
# setting `frame-ancestors 'none'`.
37+
# (4) Prevents all websites (including your own) from embedding your webpages
38+
# within e.g. the `<iframe>` or `<object>` element by setting:
39+
# `frame-ancestors 'none'`.
4140
#
42-
# The `frame-ancestors` directive helps avoid "Clickjacking" attacks
43-
# and is similar to the `X-Frame-Options` header.
41+
# The `frame-ancestors` directive helps avoid "Clickjacking" attacks and
42+
# is similar to the `X-Frame-Options` header.
4443
#
45-
# Browsers that support the CSP header will ignore `X-Frame-Options`
46-
# if `frame-ancestors` is also specified.
44+
# Browsers that support the CSP header will ignore `X-Frame-Options` if
45+
# `frame-ancestors` is also specified.
4746
#
48-
# (5) Forces the browser to treat all the resources that are served over
49-
# HTTP as if they were loaded securely over HTTPS by setting the
47+
# (5) Forces the browser to treat all the resources that are served over HTTP
48+
# as if they were loaded securely over HTTPS by setting the
5049
# `upgrade-insecure-requests` directive.
5150
#
52-
# Please note that `upgrade-insecure-requests` does not ensure
53-
# HTTPS for the top-level navigation. If you want to force the
54-
# website itself to be loaded over HTTPS you must include the
55-
# `Strict-Transport-Security` header.
51+
# Please note that `upgrade-insecure-requests` does not ensure HTTPS for
52+
# the top-level navigation. If you want to force the website itself to be
53+
# loaded over HTTPS you must include the `Strict-Transport-Security`
54+
# header.
5655
#
5756
# (6) The `Content-Security-Policy` header is included in all responses
5857
# that are able to execute scripting. This includes the commonly used

0 commit comments

Comments
 (0)