diff --git a/README.md b/README.md index 92701e2..e6fc443 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,7 @@ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs -## Install Glass +## Install Glass (as root)
cd /opt git clone https://github.com/Akkadius/glass-isc-dhcp.git @@ -153,26 +153,18 @@ npm start * For Debian this is all that is needed and Glass should start immediately * For Ubuntu users - you will have additional Apparmor config to add * **Highly Recommended** to iptables port 3000 to close off Glass if you are facing the public on your server +* [Glass Process Keepalive](#glass-process-keepalive) -## Apparmor (Ubuntu LTS) +## Apparmor * Ubuntu uses AppArmor by default - you will most likely run into file access issues without exemptions -### Option 1) Add file exemptions to apparmor (For glass and dhcpd) -+## Glass Process Keepalive +* To keep your server alive through reboots, possible crashes and process restarts, we need to use a process monitor and for simplicity we will use NodeJS's **Forever**. Forever is already installed during Glass installation. We will add it to our **crontab** + +sed -i '/\/etc\/dhcp\/\*\*/a\ \ \/var\/lib\/dhcp\/\*\* lrw,' /etc/apparmor.d/usr.sbin.dhcpd sed -i '/\/etc\/dhcp\/\*\*/a\ \ \/opt\/glass-isc-dhcp\/\*\* lrw,' /etc/apparmor.d/usr.sbin.dhcpd service apparmor restart-### Option 2) Disable completely (not recommended) - --sudo ln -s /etc/apparmor.d/usr.sbin.dhcpd /etc/apparmor.d/disable/ -sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd -- ## Glass Configuration * Glass configuration is stored in **./config/glass_config.json** * All of these settings can be edited in both Glass Settings and Glass Alerts within the Web Interface, if you have custom file locations you will need to edit this config file before starting @@ -198,6 +190,16 @@ sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.dhcpd }
+crontab -l > mycrontab +echo "@reboot cd /opt/glass-isc-dhcp && /usr/bin/forever --minUptime 10000 --spinSleepTime 10000 -a -o ./logs/glass-process.log -e ./logs/glass-error.log ./bin/www" >> mycrontab +crontab mycrontab +rm mycrontab ++ ## Secure your Server * Glass runs on web port 3000 - if you're going to run this on a production server, make sure that you lock it down from the outside world if anyone can access it. Even if they don't have a password - vulnerabilities can surface at any point in the future and your system becomes a prime target