Ver código fonte

confs; def => default

tags/v2.0.0
Robin Thoni 9 anos atrás
pai
commit
f205532367
7 arquivos alterados com 33 adições e 2 exclusões
  1. 2
    2
      sitegen.sh
  2. 0
    0
      sitegen/default
  3. 0
    0
      sitegen/default.conf
  4. 3
    0
      sitegen/http
  5. 3
    0
      sitegen/http.conf
  6. 19
    0
      sitegen/reverse
  7. 6
    0
      sitegen/reverse.conf

+ 2
- 2
sitegen.sh Ver arquivo

@@ -4,7 +4,7 @@ dir="/etc/apache2/sites-available/"
4 4
 
5 5
 if [ $# -eq 0 ] || [ $# -gt 2 ]
6 6
 then
7
-  echo "Usage:" $(basename $0) "hostname [config=def]" >&2
7
+  echo "Usage:" $(basename $0) "hostname [config=default]" >&2
8 8
   exit 1
9 9
 fi
10 10
 
@@ -13,7 +13,7 @@ if [ $# -eq 2 ]
13 13
 then
14 14
   conf="$2"
15 15
 else
16
-  conf="def"
16
+  conf="default"
17 17
 fi
18 18
 
19 19
 def="/etc/sitegen/${conf}"

sitegen/def → sitegen/default Ver arquivo


sitegen/def.conf → sitegen/default.conf Ver arquivo


+ 3
- 0
sitegen/http Ver arquivo

@@ -0,0 +1,3 @@
1
+<VirtualHost *:80>
2
+    Include sites-available/%%HOST%%.conf
3
+</VirtualHost>

+ 3
- 0
sitegen/http.conf Ver arquivo

@@ -0,0 +1,3 @@
1
+ServerName %%HOST%%
2
+DocumentRoot /var/%%HOST%%
3
+ServerAlias %%HOST%%

+ 19
- 0
sitegen/reverse Ver arquivo

@@ -0,0 +1,19 @@
1
+<IfModule mod_ssl.c>
2
+    <VirtualHost *:80>
3
+        ServerName %%HOST%%
4
+        Redirect permanent / https://%%HOST%%/
5
+    </VirtualHost>
6
+    <VirtualHost *:443>
7
+        Include sites-available/%%HOST%%.conf
8
+
9
+        SSLEngine on
10
+        SSLCertificateFile /etc/ssl/private/%%HOST%%.crt
11
+        SSLCertificateKeyFile /etc/ssl/private/%%HOST%%.key
12
+        SSLCertificateChainFile /etc/ssl/certs/sub.class1.server.ca.pem
13
+    </VirtualHost>
14
+</IfModule>
15
+<IfModule !mod_ssl.c>
16
+    <VirtualHost *:80>
17
+        Include sites-available/%%HOST%%.conf
18
+    </VirtualHost>
19
+</IfModule>

+ 6
- 0
sitegen/reverse.conf Ver arquivo

@@ -0,0 +1,6 @@
1
+ServerName %%HOST%%
2
+ServerAlias %%HOST%%
3
+ProxyPreserveHost On
4
+ProxyRequests off
5
+ProxyPass / https://%%HOST%%/
6
+ProxyPassReverse / https://%%HOST%%/

Carregando…
Cancelar
Salvar