Skip to content

Commit eca4116

Browse files
committed
Create httpd-vhosts.conf
1 parent 0ac23c6 commit eca4116

File tree

1 file changed

+53
-0
lines changed

1 file changed

+53
-0
lines changed

webserver/extra/httpd-vhosts.conf

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Virtual Hosts
2+
#
3+
# Required modules: mod_log_config
4+
5+
# If you want to maintain multiple domains/hostnames on your
6+
# machine you can setup VirtualHost containers for them. Most configurations
7+
# use only name-based virtual hosts so the server doesn't need to worry about
8+
# IP addresses. This is indicated by the asterisks in the directives below.
9+
#
10+
# Please see the documentation at
11+
# <URL:http://httpd.apache.org/docs/2.4/vhosts/>
12+
# for further details before you try to setup virtual hosts.
13+
#
14+
# You may use the command line option '-S' to verify your virtual host
15+
# configuration.
16+
17+
#
18+
# VirtualHost example:
19+
# Almost any Apache directive may go into a VirtualHost container.
20+
# The first VirtualHost section is used for all requests that do not
21+
# match a ServerName or ServerAlias in any <VirtualHost> block.
22+
#
23+
24+
ServerName localhost
25+
26+
LoadModule rewrite_module /usr/local/apache2/modules/mod_rewrite.so
27+
LoadModule deflate_module /usr/local/apache2/modules/mod_deflate.so
28+
LoadModule proxy_module /usr/local/apache2/modules/mod_proxy.so
29+
LoadModule proxy_fcgi_module /usr/local/apache2/modules/mod_proxy_fcgi.so
30+
#LoadModule ssl_module /usr/local/apache2/modules/mod_ssl.so
31+
LoadModule socache_shmcb_module /usr/local/apache2/modules/mod_socache_shmcb.so
32+
33+
<VirtualHost _default_>
34+
# Send apache logs to stdout and stderr
35+
LogLevel notice core:info
36+
CustomLog /proc/self/fd/1 common
37+
ErrorLog /proc/self/fd/2
38+
39+
#Header append X-FRAME-OPTIONS "SAMEORIGIN"
40+
41+
Alias /.well-known/ "/tmp/acme-challenge/.well-known/"
42+
<Directory "/tmp/acme-challenge/">
43+
Options None
44+
AllowOverride None
45+
ForceType text/plain
46+
Require all granted
47+
RedirectMatch 404 "^(?!/\.well-known/acme-challenge/[\w-]{43}$)"
48+
</Directory>
49+
50+
RewriteEngine on
51+
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
52+
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
53+
</VirtualHost>

0 commit comments

Comments
 (0)