streams/.homeinstall/README.md

246 lines
6.2 KiB
Markdown
Raw Normal View History

2016-01-10 17:25:36 +00:00
# Hubzilla at Home next to your Router
Run hubzilla-setup.sh for an unattended installation of hubzilla.
2017-12-21 15:29:53 +00:00
The script is known to work without adjustments with
2017-12-21 15:29:53 +00:00
+ Hardware
- Mini-PC with Debian-9.2-amd64, or
- Rapberry 3 with Raspbian, Debian-9.3
+ DynDNS
- selfHOST.de
- freedns.afraid.org
## Disclaimers
- This script does work with Debian 9 only.
- This script has to be used on a fresh debian install only (it does not take account for a possibly already installed and configured webserver or sql implementation).
2016-01-10 17:25:36 +00:00
# Step-by-Step Overwiew
## Preconditions
Hardware
+ Internet connection and router at home
2017-12-21 15:29:53 +00:00
+ Mini-pc connected to your router (a Raspberry 3 will do for very small Hubs)
2016-01-10 17:25:36 +00:00
+ USB drive for backups
Software
2018-01-03 16:21:41 +00:00
+ Fresh installation of Debian 9 (Stretch)
+ Router with open ports 80 and 443 for your Hub
2016-01-10 17:25:36 +00:00
## The basic steps (quick overview)
2016-01-10 17:25:36 +00:00
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
2018-01-03 16:26:31 +00:00
+ Log on to your fresh Debian
- apt-get install git
- mkdir -p /var/www
- cd /var/www
- git clone https://github.com/redmatrix/hubzilla.git html
- cd html/.homeinstall
2018-01-03 16:21:41 +00:00
- cp hubzilla-config.txt.template hubzilla-config.txt
- nano hubzilla-config.txt
2017-12-21 15:29:53 +00:00
- Read the comments carefully
- Enter your values: db pass, domain, values for dyn DNS
2018-01-03 16:26:31 +00:00
- Make sure your external drive (for backups) is mounted
- hubzilla-setup.sh as root
- ... wait, wait, wait until the script is finised
- reboot
2016-01-10 17:25:36 +00:00
+ Open your domain with a browser and step throught the initial configuration of hubzilla.
## Troubleshooting
If the check of the mail address fails when you try to register the very first user in the browser. Do...
cd /var/www/html
util/config system.do_not_check_dns 1
## Optional - Set path to imagemagick
In Admin settings of hubzilla or via terminal
cd /var/www/html
util/config system.imagick_convert_path /usr/bin/convert
2016-01-10 17:25:36 +00:00
# Step-by-Step in Detail
## Preparations Hardware
### Mini-PC
### Recommended: USB Drive for Backups
2018-01-03 16:21:41 +00:00
The installation will create a daily backup written to an external drive.
2016-01-10 17:25:36 +00:00
2017-12-21 15:29:53 +00:00
The USB drive must be compatible with the filesystems
- ext4 (if you do not want to encrypt the USB)
- LUKS + ext4 (if you want to encrypt the USB)
2016-01-10 17:25:36 +00:00
2018-01-03 16:21:41 +00:00
The backup includes
- Hubzilla DB
- Hubzilla installation /var/www/html
- Certificates for letsencrypt
2016-01-10 17:25:36 +00:00
## Preparations Software
### Install Debian Linux on the Mini-PC
2018-01-03 16:21:41 +00:00
Download the stable Debian at https://www.debian.org/
2017-12-21 15:29:53 +00:00
(Debian 8 is no longer supported.)
2018-01-03 16:21:41 +00:00
Create bootable USB drive with Debian on it.You could use
2017-12-21 15:29:53 +00:00
- unetbootin, https://en.wikipedia.org/wiki/UNetbootin
- or simply the linux command "dd"
Example for command dd...
2016-01-10 17:25:36 +00:00
2017-12-21 15:29:53 +00:00
su -
dd if=2017-11-29-raspbian-stretch.img of=/dev/mmcblk0
2016-01-10 17:25:36 +00:00
2017-12-21 15:29:53 +00:00
Do not forget to unmount the SD card before and check if unmounted like in this example...
su -
umount /dev/mmcblk0*
df -h
Switch off your mini pc, plug in your USB drive and start the mini pc from the
2016-01-10 17:25:36 +00:00
stick. Install Debian. Follow the instructions of the installation.
### Configure your Router
Open the ports 80 and 443 on your router for your Debian
## Preparations Dynamic IP Address
Your Hubzilla must be reachable by a domain that you can type in your browser
cooldomain.org
You can use subdomains as well
my.cooldomain.org
2018-01-03 16:21:41 +00:00
There are two ways to get a domain...
2016-01-10 17:25:36 +00:00
2018-01-03 16:21:41 +00:00
### Method 1: Buy a Domain
2016-01-10 17:25:36 +00:00
2017-12-21 15:29:53 +00:00
...for example buy at selfHOST.de
2017-12-21 15:29:53 +00:00
The cost are around 10,- € once and 1,50 € per month (2017).
2016-01-10 17:25:36 +00:00
### Method 2: Register a free subdomain
2016-01-10 17:25:36 +00:00
2018-01-03 16:21:41 +00:00
...for example register at freedns.afraid.org
2016-01-10 17:25:36 +00:00
2017-12-21 15:29:53 +00:00
Follow the instructions in .homeinstall/hubzilla-config.txt.
2016-01-10 17:25:36 +00:00
## Install Hubzilla on your Debian
2018-01-03 16:21:41 +00:00
Login to your debian
2016-01-10 17:25:36 +00:00
(Provided your username is "you" and the name of the mini pc is "debian". You
could take the IP address instead of "debian")
ssh -X you@debian
Change to root user
su -l
Install git
apt-get install git
Make the directory for apache and change diretory to it
mkdir /var/www
cd /var/www/
Clone hubzilla from git ("git pull" will update it later)
git clone https://framagit.org/hubzilla/core html
2016-01-10 17:25:36 +00:00
Change to the install script
cd html/.homeinstall/
Copy the template file
cp hubzilla-config.txt.template hubzilla-config.txt
2016-01-10 17:25:36 +00:00
2017-12-21 15:29:53 +00:00
Modify the file "hubzilla-config.txt". Read the instructions there carefully and enter your values.
2016-01-10 17:25:36 +00:00
nano hubzilla-config.txt
2018-01-03 16:21:41 +00:00
Make sure your external drive (for backups) is plugged in and can be mounted as configured in "hubzilla-config.txt". Otherwise the daily backups will not work.
2016-01-10 17:25:36 +00:00
Run the script
./hubzilla-setup.sh
Wait... The script should not finish with an error message.
In a webbrowser open your domain.
2017-12-21 15:29:53 +00:00
Expected: A test page of hubzilla is shown. All checks there should be
2016-01-10 17:25:36 +00:00
successfull. Go on...
Expected: A page for the Hubzilla server configuration shows up.
Leave db server name "127.0.0.1" and port "0" untouched.
Enter
- DB user name = hubzilla
- DB pass word = This is the password you entered in "hubzilla-config.txt"
- DB name = hubzilla
Leave db type "MySQL" untouched.
Follow the instructions in the next pages.
Recommended: Set path to imagemagick
- in admin settings of hubzilla or
- via terminal
util/config system.imagick_convert_path /usr/bin/convert
2018-01-03 16:21:41 +00:00
After the daily script was executed at 05:30 (am)
2017-12-21 15:29:53 +00:00
- look at /var/www/html/hubzilla-daily.log
2018-01-03 16:21:41 +00:00
- check your backup on the external drive
- optionally view the daily log under yourdomain.org/admin/logs/
- set the logfile to var/www/html/hubzilla-daily.log
## Note for the Rasperry
2017-12-21 15:29:53 +00:00
2018-01-03 16:21:41 +00:00
The script was tested with an Raspberry 3 under Raspian (Debian 9.3, 2017-11-29-raspbian-stretch.img).
2017-12-21 15:29:53 +00:00
It is recommended to deinstall these programms to avoid endless updates. Use...
sudo apt-get purge wolfram-engine sonic-pi
sudo apt-get autoremove
It is recommended to run the Raspi without graphical frontend (X-Server). Use...
sudo raspi-config
2018-01-03 16:21:41 +00:00
to boot the Rapsi to the client console.
2017-12-21 15:29:53 +00:00
2018-01-03 16:21:41 +00:00
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!
2017-12-21 15:29:53 +00:00
On a Raspian Stretch (Debian 9) the validation of the mail address fails for the very first user.
This used to happen on some *bsd distros but there was some work to fix that a year ago (2017).
So if your system isn't registered in DNS or DNS isn't active do
cd /var/www/html
util/config system.do_not_check_dns 1
2017-12-21 15:29:53 +00:00