add webserver and clean up
This commit is contained in:
4
README.md
Normal file
4
README.md
Normal 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!
|
||||
20
adddomain
20
adddomain
@@ -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
|
||||
@@ -1,2 +0,0 @@
|
||||
include "/etc/bind/named.conf.options";
|
||||
include "/etc/bind/named.conf.domains/*.conf";
|
||||
@@ -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; };
|
||||
};
|
||||
3
web/addsite
Normal file
3
web/addsite
Normal file
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
lxc exec web.$1 -- addsite $2
|
||||
8
web/addwebserver
Normal file
8
web/addwebserver
Normal 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
17
web/src/addsite
Normal 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
|
||||
Reference in New Issue
Block a user