4aea5c37 by Gopal

Backup of apache and ssl files for Flexydial Securities

1 parent 31674bae
1 #
2 # This is the main Apache HTTP server configuration file. It contains the
3 # configuration directives that give the server its instructions.
4 # See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
5 # In particular, see
6 # <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
7 # for a discussion of each configuration directive.
8 #
9 # Do NOT simply read the instructions in here without understanding
10 # what they do. They're here only as hints or reminders. If you are unsure
11 # consult the online docs. You have been warned.
12 #
13 # Configuration and logfile names: If the filenames you specify for many
14 # of the server's control files begin with "/" (or "drive:/" for Win32), the
15 # server will use that explicit path. If the filenames do *not* begin
16 # with "/", the value of ServerRoot is prepended -- so 'log/access_log'
17 # with ServerRoot set to '/www' will be interpreted by the
18 # server as '/www/log/access_log', where as '/log/access_log' will be
19 # interpreted as '/log/access_log'.
20
21 #
22 # ServerRoot: The top of the directory tree under which the server's
23 # configuration, error, and log files are kept.
24 #
25 # Do not add a slash at the end of the directory path. If you point
26 # ServerRoot at a non-local disk, be sure to specify a local disk on the
27 # Mutex directive, if file-based mutexes are used. If you wish to share the
28 # same ServerRoot for multiple httpd daemons, you will need to change at
29 # least PidFile.
30 #
31
32 ServerRoot "/etc/httpd"
33
34
35
36 # Security Check points
37 Header always append X-Frame-Options DENY
38 Header set Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
39 # Header set Content-Security-Policy "default-src 'self'; script-src 'self'; img-src 'self';"
40 Header set X-Content-Type-Options nosniff
41 Header set X-Permitted-Cross-Domain-Policies "master-only"
42 Header set X-XSS-Protection "1; mode=block"
43 Header set X-Powered-By "Buzzworks 1.02"
44 Header always edit Set-Cookie (.*) "$1;HttpOnly;Secure"
45 Header set Cache-Control "private, no-cache, no-store, proxy-revalidate, no-transform"
46 Header set Pragma "no-cache"
47 ServerTokens Prod
48 ServerSignature Off
49
50 <Location />
51 <LimitExcept GET POST>
52 order deny,allow
53 deny from all
54 </LimitExcept>
55 </Location>
56 # Security Check points
57
58 #
59 # Listen: Allows you to bind Apache to specific IP addresses and/or
60 # ports, instead of the default. See also the <VirtualHost>
61 # directive.
62 #
63 # Change this to Listen on specific IP addresses as shown below to
64 # prevent Apache from glomming onto all bound IP addresses.
65 #
66 #Listen 12.34.56.78:80
67 Listen 80
68
69 #
70 # Dynamic Shared Object (DSO) Support
71 # To be able to use the functionality of a module which was built as a DSO you
72 # have to place corresponding `LoadModule' lines at this location so the
73 # directives contained in it are actually available _before_ they are used.
74 # Statically compiled modules (those listed by `httpd -l') do not need
75 # to be loaded here.
76 #
77 # Example:
78 # LoadModule foo_module modules/mod_foo.so
79 #
80 Include conf.modules.d/*.conf
81
82 #
83 # If you wish httpd to run as a different user or group, you must run
84 # httpd as root initially and it will switch.
85 #
86 # User/Group: The name (or #number) of the user/group to run httpd as.
87 # It is usually good practice to create a dedicated user and group for
88 # running httpd, as with most system services.
89 #
90 User apache
91 Group apache
92
93 # 'Main' server configuration
94 #
95 # The directives in this section set up the values used by the 'main'
96 # server, which responds to any requests that aren't handled by a
97 # <VirtualHost> definition. These values also provide defaults for
98 # any <VirtualHost> containers you may define later in the file.
99 #
100 # All of these directives may appear inside <VirtualHost> containers,
101 # in which case these default settings will be overridden for the
102 # virtual host being defined.
103 #
104
105
106
107
108 # ServerAdmin: Your address, where problems with the server should be
109 # e-mailed. This address appears on some server-generated pages, such
110 # as error documents. e.g. [email protected]
111 #
112 ServerAdmin root@localhost
113
114 #
115 # ServerName gives the name and port that the server uses to identify itself.
116 # This can often be determined automatically, but we recommend you specify
117 # it explicitly to prevent problems during startup.
118 #
119 # If your host doesn't have a registered DNS name, enter its IP address here.
120 #
121 #ServerName www.example.com:80
122
123 #
124 # Deny access to the entirety of your server's filesystem. You must
125 # explicitly permit access to web content directories in other
126 # <Directory> blocks below.
127 #
128 <Directory />
129 AllowOverride none
130 Require all denied
131 </Directory>
132
133 #
134 # Note that from this point forward you must specifically allow
135 # particular features to be enabled - so if something's not working as
136 # you might expect, make sure that you have specifically enabled it
137 # below.
138 #
139
140 #
141 # DocumentRoot: The directory out of which you will serve your
142 # documents. By default, all requests are taken from this directory, but
143 # symbolic links and aliases may be used to point to other locations.
144 #
145 DocumentRoot "/var/www/html"
146
147 #
148 # Relax access to content within /var/www.
149 #
150 <Directory "/var/www">
151 AllowOverride None
152 # Allow open access:
153 Require all granted
154 </Directory>
155
156 # Further relax access to the default document root:
157 <Directory "/var/www/html">
158 #
159 # Possible values for the Options directive are "None", "All",
160 # or any combination of:
161 # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
162 #
163 # Note that "MultiViews" must be named *explicitly* --- "Options All"
164 # doesn't give it to you.
165 #
166 # The Options directive is both complicated and important. Please see
167 # http://httpd.apache.org/docs/2.4/mod/core.html#options
168 # for more information.
169 #
170 Options Indexes FollowSymLinks
171
172 #
173 # AllowOverride controls what directives may be placed in .htaccess files.
174 # It can be "All", "None", or any combination of the keywords:
175 # Options FileInfo AuthConfig Limit
176 #
177 AllowOverride None
178
179 #
180 # Controls who can get stuff from this server.
181 #
182 Require all granted
183 </Directory>
184
185 #
186 # DirectoryIndex: sets the file that Apache will serve if a directory
187 # is requested.
188 #
189 <IfModule dir_module>
190 DirectoryIndex index.html
191 </IfModule>
192
193 #
194 # The following lines prevent .htaccess and .htpasswd files from being
195 # viewed by Web clients.
196 #
197 <Files ".ht*">
198 Require all denied
199 </Files>
200
201 #
202 # ErrorLog: The location of the error log file.
203 # If you do not specify an ErrorLog directive within a <VirtualHost>
204 # container, error messages relating to that virtual host will be
205 # logged here. If you *do* define an error logfile for a <VirtualHost>
206 # container, that host's errors will be logged there and not here.
207 #
208 ErrorLog "logs/error_log"
209
210 #
211 # LogLevel: Control the number of messages logged to the error_log.
212 # Possible values include: debug, info, notice, warn, error, crit,
213 # alert, emerg.
214 #
215 LogLevel warn
216
217 <IfModule log_config_module>
218 #
219 # The following directives define some format nicknames for use with
220 # a CustomLog directive (see below).
221 #
222 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
223 LogFormat "%h %l %u %t \"%r\" %>s %b" common
224
225 <IfModule logio_module>
226 # You need to enable mod_logio.c to use %I and %O
227 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
228 </IfModule>
229
230 #
231 # The location and format of the access logfile (Common Logfile Format).
232 # If you do not define any access logfiles within a <VirtualHost>
233 # container, they will be logged here. Contrariwise, if you *do*
234 # define per-<VirtualHost> access logfiles, transactions will be
235 # logged therein and *not* in this file.
236 #
237 #CustomLog "logs/access_log" common
238
239 #
240 # If you prefer a logfile with access, agent, and referer information
241 # (Combined Logfile Format) you can use the following directive.
242 #
243 CustomLog "logs/access_log" combined
244 </IfModule>
245
246 <IfModule alias_module>
247 #
248 # Redirect: Allows you to tell clients about documents that used to
249 # exist in your server's namespace, but do not anymore. The client
250 # will make a new request for the document at its new location.
251 # Example:
252 # Redirect permanent /foo http://www.example.com/bar
253
254 #
255 # Alias: Maps web paths into filesystem paths and is used to
256 # access content that does not live under the DocumentRoot.
257 # Example:
258 # Alias /webpath /full/filesystem/path
259 #
260 # If you include a trailing / on /webpath then the server will
261 # require it to be present in the URL. You will also likely
262 # need to provide a <Directory> section to allow access to
263 # the filesystem path.
264
265 #
266 # ScriptAlias: This controls which directories contain server scripts.
267 # ScriptAliases are essentially the same as Aliases, except that
268 # documents in the target directory are treated as applications and
269 # run by the server when requested rather than as documents sent to the
270 # client. The same rules about trailing "/" apply to ScriptAlias
271 # directives as to Alias.
272 #
273 ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
274
275 </IfModule>
276
277 #
278 # "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
279 # CGI directory exists, if you have that configured.
280 #
281 <Directory "/var/www/cgi-bin">
282 AllowOverride None
283 Options None
284 Require all granted
285 </Directory>
286
287 <IfModule mime_module>
288 #
289 # TypesConfig points to the file containing the list of mappings from
290 # filename extension to MIME-type.
291 #
292 TypesConfig /etc/mime.types
293
294 #
295 # AddType allows you to add to or override the MIME configuration
296 # file specified in TypesConfig for specific file types.
297 #
298 #AddType application/x-gzip .tgz
299 #
300 # AddEncoding allows you to have certain browsers uncompress
301 # information on the fly. Note: Not all browsers support this.
302 #
303 #AddEncoding x-compress .Z
304 #AddEncoding x-gzip .gz .tgz
305 #
306 # If the AddEncoding directives above are commented-out, then you
307 # probably should define those extensions to indicate media types:
308 #
309 AddType application/x-compress .Z
310 AddType application/x-gzip .gz .tgz
311
312 #
313 # AddHandler allows you to map certain file extensions to "handlers":
314 # actions unrelated to filetype. These can be either built into the server
315 # or added with the Action directive (see below)
316 #
317 # To use CGI scripts outside of ScriptAliased directories:
318 # (You will also need to add "ExecCGI" to the "Options" directive.)
319 #
320 #AddHandler cgi-script .cgi
321
322 # For type maps (negotiated resources):
323 #AddHandler type-map var
324
325 #
326 # Filters allow you to process content before it is sent to the client.
327 #
328 # To parse .shtml files for server-side includes (SSI):
329 # (You will also need to add "Includes" to the "Options" directive.)
330 #
331 AddType text/html .shtml
332 AddOutputFilter INCLUDES .shtml
333
334 </IfModule>
335
336 #
337 # Specify a default charset for all content served; this enables
338 # interpretation of all content as UTF-8 by default. To use the
339 # default browser choice (ISO-8859-1), or to allow the META tags
340 # in HTML content to override this choice, comment out this
341 # directive:
342 #
343 AddDefaultCharset UTF-8
344
345 <IfModule mime_magic_module>
346 #
347 # The mod_mime_magic module allows the server to use various hints from the
348 # contents of the file itself to determine its type. The MIMEMagicFile
349 # directive tells the module where the hint definitions are located.
350 #
351 MIMEMagicFile conf/magic
352 </IfModule>
353
354 #
355 # Customizable error responses come in three flavors:
356 # 1) plain text 2) local redirects 3) external redirects
357 #
358 # Some examples:
359 #ErrorDocument 500 "The server made a boo boo."
360 #ErrorDocument 404 /missing.html
361 #ErrorDocument 404 "/cgi-bin/missing_handler.pl"
362 #ErrorDocument 402 http://www.example.com/subscription_info.html
363 #
364
365 #
366 # EnableMMAP and EnableSendfile: On systems that support it,
367 # memory-mapping or the sendfile syscall may be used to deliver
368 # files. This usually improves server performance, but must
369 # be turned off when serving from networked-mounted
370 # filesystems or if support for these functions is otherwise
371 # broken on your system.
372 # Defaults if commented: EnableMMAP On, EnableSendfile Off
373 #
374 #EnableMMAP off
375 EnableSendfile on
376
377 # Supplemental configuration
378 #
379 # Load config files in the "/etc/httpd/conf.d" directory, if any.
380 IncludeOptional conf.d/*.conf
381
382 TraceEnable off
383
1 #
2 # When we also provide SSL we have to listen to the
3 # the HTTPS port in addition.
4 #
5 Listen 443 https
6
7 ##
8 ## SSL Global Context
9 ##
10 ## All SSL configuration in this context applies both to
11 ## the main server and all SSL-enabled virtual hosts.
12 ##
13
14 # Pass Phrase Dialog:
15 # Configure the pass phrase gathering process.
16 # The filtering dialog program (`builtin' is a internal
17 # terminal dialog) has to provide the pass phrase on stdout.
18 SSLPassPhraseDialog exec:/usr/libexec/httpd-ssl-pass-dialog
19
20 # Inter-Process Session Cache:
21 # Configure the SSL Session Cache: First the mechanism
22 # to use and second the expiring timeout (in seconds).
23 SSLSessionCache shmcb:/run/httpd/sslcache(512000)
24 SSLSessionCacheTimeout 300
25
26 # Pseudo Random Number Generator (PRNG):
27 # Configure one or more sources to seed the PRNG of the
28 # SSL library. The seed data should be of good random quality.
29 # WARNING! On some platforms /dev/random blocks if not enough entropy
30 # is available. This means you then cannot use the /dev/random device
31 # because it would lead to very long connection times (as long as
32 # it requires to make more entropy available). But usually those
33 # platforms additionally provide a /dev/urandom device which doesn't
34 # block. So, if available, use this one instead. Read the mod_ssl User
35 # Manual for more details.
36 SSLRandomSeed startup file:/dev/urandom 256
37 SSLRandomSeed connect builtin
38 #SSLRandomSeed startup file:/dev/random 512
39 #SSLRandomSeed connect file:/dev/random 512
40 #SSLRandomSeed connect file:/dev/urandom 512
41
42 #
43 # Use "SSLCryptoDevice" to enable any supported hardware
44 # accelerators. Use "openssl engine -v" to list supported
45 # engine names. NOTE: If you enable an accelerator and the
46 # server does not start, consult the error logs and ensure
47 # your accelerator is functioning properly.
48 #
49 SSLCryptoDevice builtin
50 #SSLCryptoDevice ubsec
51
52 ##
53 ## SSL Virtual Host Context
54 ##
55
56 <VirtualHost _default_:443>
57
58 # General setup for the virtual host, inherited from global configuration
59 #DocumentRoot "/var/www/html"
60 #ServerName www.example.com:443
61
62 # Use separate log files for the SSL virtual host; note that LogLevel
63 # is not inherited from httpd.conf.
64 ErrorLog logs/ssl_error_log
65 TransferLog logs/ssl_access_log
66 LogLevel warn
67
68 # SSL Engine Switch:
69 # Enable/Disable SSL for this virtual host.
70 SSLEngine on
71
72 # List the protocol versions which clients are allowed to connect with.
73 # Disable SSLv3 by default (cf. RFC 7525 3.1.1). TLSv1 (1.0) should be
74 # disabled as quickly as practical. By the end of 2016, only the TLSv1.2
75 # protocol or later should remain in use.
76 SSLProtocol TLSv1.1 TLSv1.2
77 SSLProxyProtocol TLSv1.1 TLSv1.2
78
79 # User agents such as web browsers are not configured for the user's
80 # own preference of either security or performance, therefore this
81 # must be the prerogative of the web server administrator who manages
82 # cpu load versus confidentiality, so enforce the server's cipher order.
83 SSLHonorCipherOrder on
84
85 # SSL Cipher Suite:
86 # List the ciphers that the client is permitted to negotiate.
87 # See the mod_ssl documentation for a complete list.
88 # The OpenSSL system profile is configured by default. See
89 # update-crypto-policies(8) for more details.
90 SSLCipherSuite PROFILE=SYSTEM
91 SSLProxyCipherSuite PROFILE=SYSTEM
92
93 # Server Certificate:
94 # Point SSLCertificateFile at a PEM encoded certificate. If
95 # the certificate is encrypted, then you will be prompted for a
96 # pass phrase. Note that a kill -HUP will prompt again. A new
97 # certificate can be generated using the genkey(1) command.
98 SSLCertificateFile /etc/pki/tls/certs/localhost.crt
99
100 # Server Private Key:
101 # If the key is not combined with the certificate, use this
102 # directive to point at the key file. Keep in mind that if
103 # you've both a RSA and a DSA private key you can configure
104 # both in parallel (to also allow the use of DSA ciphers, etc.)
105 SSLCertificateKeyFile /etc/pki/tls/private/localhost.key
106
107 # Server Certificate Chain:
108 # Point SSLCertificateChainFile at a file containing the
109 # concatenation of PEM encoded CA certificates which form the
110 # certificate chain for the server certificate. Alternatively
111 # the referenced file can be the same as SSLCertificateFile
112 # when the CA certificates are directly appended to the server
113 # certificate for convinience.
114 #SSLCertificateChainFile /etc/pki/tls/certs/server-chain.crt
115
116 # Certificate Authority (CA):
117 # Set the CA certificate verification path where to find CA
118 # certificates for client authentication or alternatively one
119 # huge file containing all of them (file must be PEM encoded)
120 #SSLCACertificateFile /etc/pki/tls/certs/ca-bundle.crt
121
122 # Client Authentication (Type):
123 # Client certificate verification type and depth. Types are
124 # none, optional, require and optional_no_ca. Depth is a
125 # number which specifies how deeply to verify the certificate
126 # issuer chain before deciding the certificate is not valid.
127 #SSLVerifyClient require
128 #SSLVerifyDepth 10
129
130 # Access Control:
131 # With SSLRequire you can do per-directory access control based
132 # on arbitrary complex boolean expressions containing server
133 # variable checks and other lookup directives. The syntax is a
134 # mixture between C and Perl. See the mod_ssl documentation
135 # for more details.
136 #<Location />
137 #SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
138 # and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
139 # and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
140 # and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
141 # and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
142 # or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
143 #</Location>
144
145 # SSL Engine Options:
146 # Set various options for the SSL engine.
147 # o FakeBasicAuth:
148 # Translate the client X.509 into a Basic Authorisation. This means that
149 # the standard Auth/DBMAuth methods can be used for access control. The
150 # user name is the `one line' version of the client's X.509 certificate.
151 # Note that no password is obtained from the user. Every entry in the user
152 # file needs this password: `xxj31ZMTZzkVA'.
153 # o ExportCertData:
154 # This exports two additional environment variables: SSL_CLIENT_CERT and
155 # SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
156 # server (always existing) and the client (only existing when client
157 # authentication is used). This can be used to import the certificates
158 # into CGI scripts.
159 # o StdEnvVars:
160 # This exports the standard SSL/TLS related `SSL_*' environment variables.
161 # Per default this exportation is switched off for performance reasons,
162 # because the extraction step is an expensive operation and is usually
163 # useless for serving static content. So one usually enables the
164 # exportation for CGI and SSI requests only.
165 # o StrictRequire:
166 # This denies access when "SSLRequireSSL" or "SSLRequire" applied even
167 # under a "Satisfy any" situation, i.e. when it applies access is denied
168 # and no other module can change it.
169 # o OptRenegotiate:
170 # This enables optimized SSL connection renegotiation handling when SSL
171 # directives are used in per-directory context.
172 #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire
173 <Files ~ "\.(cgi|shtml|phtml|php3?)$">
174 SSLOptions +StdEnvVars
175 </Files>
176 <Directory "/var/www/cgi-bin">
177 SSLOptions +StdEnvVars
178 </Directory>
179
180 # SSL Protocol Adjustments:
181 # The safe and default but still SSL/TLS standard compliant shutdown
182 # approach is that mod_ssl sends the close notify alert but doesn't wait for
183 # the close notify alert from client. When you need a different shutdown
184 # approach you can use one of the following variables:
185 # o ssl-unclean-shutdown:
186 # This forces an unclean shutdown when the connection is closed, i.e. no
187 # SSL close notify alert is send or allowed to received. This violates
188 # the SSL/TLS standard but is needed for some brain-dead browsers. Use
189 # this when you receive I/O errors because of the standard approach where
190 # mod_ssl sends the close notify alert.
191 # o ssl-accurate-shutdown:
192 # This forces an accurate shutdown when the connection is closed, i.e. a
193 # SSL close notify alert is send and mod_ssl waits for the close notify
194 # alert of the client. This is 100% SSL/TLS standard compliant, but in
195 # practice often causes hanging connections with brain-dead browsers. Use
196 # this only for browsers where you know that their SSL implementation
197 # works correctly.
198 # Notice: Most problems of broken clients are also related to the HTTP
199 # keep-alive facility, so you usually additionally want to disable
200 # keep-alive for those clients, too. Use variable "nokeepalive" for this.
201 # Similarly, one has to force some clients to use HTTP/1.0 to workaround
202 # their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
203 # "force-response-1.0" for this.
204 BrowserMatch "MSIE [2-5]" \
205 nokeepalive ssl-unclean-shutdown \
206 downgrade-1.0 force-response-1.0
207
208 # Per-Server Logging:
209 # The home of a custom SSL log file. Use this when you want a
210 # compact non-error SSL logfile on a virtual host basis.
211 CustomLog logs/ssl_request_log \
212 "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
213
214 </VirtualHost>
215
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!