Aleksander Machniak
2016-05-20 e71de17602c2c13beee9d9f2be2e664d6a80926d
commit | author | age
e71de1 1 # WARNING: For PHP 7 the module name in the line below need to be modified!
34942e 2 <IfModule mod_php5.c>
4c7a98 3 php_flag    display_errors  Off
AM 4 php_flag    log_errors      On
5 # php_value    error_log    logs/errors
aaa6ac 6
93e12f 7 php_value   upload_max_filesize   5M
AM 8 php_value   post_max_size         6M
4c7a98 9 php_value   memory_limit          64M
aaa6ac 10
4c7a98 11 php_flag    register_globals            Off
AM 12 php_flag    zlib.output_compression     Off
13 php_flag    magic_quotes_gpc            Off
14 php_flag    magic_quotes_runtime        Off
15 php_flag    suhosin.session.encrypt     Off
aaa6ac 16
4c7a98 17 #php_value   session.cookie_path     /
e2bcea 18 #php_value   session.hash_function   sha256
4c7a98 19 php_flag    session.auto_start       Off
AM 20 php_value   session.gc_maxlifetime   21600
21 php_value   session.gc_divisor       500
22 php_value   session.gc_probability   1
34942e 23 </IfModule>
4e17e6 24
34942e 25 <IfModule mod_rewrite.c>
0b9b9f 26 Options +FollowSymLinks
34942e 27 RewriteEngine On
aff970 28 RewriteRule ^favicon\.ico$ skins/larry/images/favicon.ico
88934b 29
2dade1 30 # security rules:
AM 31 # - deny access to files not containing a dot or starting with a dot
32 #   in all locations except installer directory
1c2aad 33 RewriteRule ^(?!installer|\.well-known\/|[a-zA-Z0-9]{16})(\.?[^\.]+)$ - [F]
2dade1 34 # - deny access to some locations
AM 35 RewriteRule ^/?(\.git|\.tx|SQL|bin|config|logs|temp|tests|program\/(include|lib|localization|steps)) - [F]
36 # - deny access to some documentation files
fd0583 37 RewriteRule /?(README\.md|composer\.json-dist|composer\.json|package\.xml|Dockerfile)$ - [F]
e3f427 38 </IfModule>
cb3ea1 39
d7f49d 40 <IfModule mod_deflate.c>
T 41 SetOutputFilter DEFLATE
42 </IfModule>
43
bf19fe 44 <IfModule mod_expires.c>
AM 45 ExpiresActive On
46 ExpiresDefault "access plus 1 month"
47 </IfModule>
48
49 FileETag MTime Size
50
51 <IfModule mod_autoindex.c>
52 Options -Indexes
53 </ifModule>
54
d7f49d 55 <IfModule mod_headers.c>
T 56 # replace 'append' with 'merge' for Apache version 2.2.9 and later
832890 57 #Header append Cache-Control public env=!NO_CACHE
7b4f71 58
R 59 # Optional security header
60 # Only increased security if the browser support those features
61 # Be careful! Testing is required! They should be adusted to your intallation / user environment
62
63 # HSTS - HTTP Strict Transport Security
64 #Header always set Strict-Transport-Security "max-age=31536000; preload" env=HTTPS
65
66 # HPKP - HTTP Public Key Pinning
67 # Only template - fill with your values
68 #Header always set Public-Key-Pins "max-age=3600; report-uri=\"\"; pin-sha256=\"\"; pin-sha256=\"\"" env=HTTPS
69
70 # X-Xss-Protection
71 # This header is used to configure the built in reflective XSS protection found in Internet Explorer, Chrome and Safari (Webkit). 
72 #Header set X-XSS-Protection "1; mode=block"
73
74 # X-Frame-Options
75 # The X-Frame-Options header (RFC), or XFO header, protects your visitors against clickjacking attacks
76 # Already set by php code! Do not activate both options
77 #Header set X-Frame-Options SAMEORIGIN
78
79 # X-Content-Type-Options
80 # It prevents Google Chrome and Internet Explorer from trying to mime-sniff the content-type of a response away from the one being declared by the server.
81 #Header set X-Content-Type-Options: "nosniff"
82
83 # CSP - Content Security Policy
348c53 84 # for better privacy/security ask browsers to not set the Referer
7b4f71 85 # more flags for script, stylesheets and images available, read RFC for more information
348c53 86 #Header set Content-Security-Policy "referrer no-referrer"
d7f49d 87 </IfModule>