add webserver and clean up

This commit is contained in:
MReenen
2018-06-04 14:59:06 +02:00
parent d9f315cd8f
commit 8f35f1b232
8 changed files with 32 additions and 32 deletions

4
README.md Normal file
View File

@@ -0,0 +1,4 @@
# RZH-Server DEMO
RZH-Server is a server infrastructure running on LXD. Thare will come a deshboard whare you can add mail addresses, DNS domainnames/records, websites, databases and a lot more.
Curently it's in develpment and not sucessfully tesed yet!

View File

@@ -1,20 +0,0 @@
#!/bin/bash
cat > /etc/bind/named.conf.domains/$1.conf <<EOF
zone "$1" {
type master;
file "/etc/bind/named.conf.domain/db.$1";
};
EOF
cat > /etc/bind/named.conf.domain/db.$1 <<EOF
$TTL 604800
@ IN SOA $1. root.$1. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN A $2
EOF

View File

@@ -1,2 +0,0 @@
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.domains/*.conf";

View File

@@ -1,10 +0,0 @@
options {
directory "/var/cache/bind";
forwarders {
8.8.8.8;
8.8.4.4;
};
dnssec-validation auto;
auth-nxdomain no;
listen-on-v6 { any; };
};

View File

3
web/addsite Normal file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
lxc exec web.$1 -- addsite $2

8
web/addwebserver Normal file
View File

@@ -0,0 +1,8 @@
#!/bin/bash
lxc lanch ubuntu:18.04 web.$1
lxc exec web.$1 -- apt-get update
lxc exec web.$1 -- apt-get upgrade -y
lxc exec web.$1 -- apt-get isntall apache2
lxc file push ./src/addsite web.$1/
lxc exec web.$1 -- echo "listen 8080" | tee /etc/apache2/ports.conf

17
web/src/addsite Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
cat > /etc/apache2/site-available/$1.conf <<EOF
<VirtualHost *:8080>
ServerAdmin webmaster@localhost
ServerName $1
DocumentRoot /var/www/$1
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
</VirtualHost>
EOF
mkdir /var/www/$1