71 lines
1.9 KiB
Markdown
71 lines
1.9 KiB
Markdown
# Bash Scripts
|
|
|
|
## Install Apache and Samba
|
|
|
|
```bash
|
|
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-apache.sh)"
|
|
```
|
|
|
|
### Optionally install uCMS
|
|
|
|
<pre><code>cd /var/www/cms/www
|
|
git clone https://git.myspace.nu/MySpace/uCMS-3.git .
|
|
chmod -R ugo+rwx ./</code></pre>
|
|
|
|
## Install MySQL
|
|
|
|
```bash
|
|
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-mysql.sh)"
|
|
```
|
|
|
|
## Install UFW (and disable iptables)
|
|
|
|
```bash
|
|
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-ufw.sh)"
|
|
```
|
|
|
|
## Install Bind
|
|
|
|
```bash
|
|
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-bind.sh)"
|
|
```
|
|
|
|
## Install Samba Active Directory Domain Controller
|
|
|
|
```bash
|
|
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-ubuntu-dc.sh)"
|
|
```
|
|
|
|
Combind with [pi.hole](https://pi-hole.net/) by running
|
|
|
|
```bash
|
|
curl -sSL https://install.pi-hole.net | bash
|
|
```
|
|
|
|
And update ```/etc/samba/smb.conf``` with ```dns forwarder = <IP-of-pi.hole>``` and make sure the DHCP uses the dc as DNS.
|
|
|
|
## Install Wireguard
|
|
|
|
```bash
|
|
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/install-wireguard-server.sh)"
|
|
```
|
|
Add user
|
|
```bash
|
|
wg-adduser.sh
|
|
```
|
|
Allow single user full LAN access, add this to `/etc/wireguard/wg0.conf`. `-s 192.168.200.3` is the source (client) IP address. Iptables rules are evaluated from top to bottom, looking for the first match. The rest of the rules will be ignored.
|
|
```
|
|
PostUp = iptables -A FORWARD -i %i -s 192.168.200.3/32 -j ACCEPT
|
|
...
|
|
PostDown = iptables -D FORWARD -i %i -s 192.168.200.3/32 -j ACCEPT
|
|
```
|
|
|
|
|
|
|
|
## Install VM Tweaks
|
|
|
|
```bash
|
|
sudo su -c "bash <(wget -qO- https://git.myspace.nu/MySpace/Docs/raw/branch/master/BashScripts/vm-tweaks.sh)"
|
|
```
|
|
|