Merge branch 'fix_homeinstall_for_Debian_10' into 'dev'
Fix homeinstall for debian 10 See merge request hubzilla/core!1725
This commit is contained in:
commit
01abd73a2a
@ -1,10 +1,65 @@
|
|||||||
# Hubzilla at Home next to your Router
|
# How to use
|
||||||
|
|
||||||
This readme will show you how to install and run Hubzilla (or Zap) at home.
|
## Disclaimers
|
||||||
|
|
||||||
The installation is done by a script.
|
- This script does work with Debian 10 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).
|
||||||
|
|
||||||
What the script will do for you...
|
## Preconditions
|
||||||
|
|
||||||
|
Hardware
|
||||||
|
|
||||||
|
+ Internet connection and router at home
|
||||||
|
+ Mini-pc connected to your router (a Raspberry 3 will do for very small Hubs)
|
||||||
|
+ USB drive for backups
|
||||||
|
|
||||||
|
Software
|
||||||
|
|
||||||
|
+ Fresh installation of Debian 10 (Stretch)
|
||||||
|
+ Router with open ports 80 and 443 for your web server
|
||||||
|
|
||||||
|
## How to run the script
|
||||||
|
|
||||||
|
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
|
||||||
|
+ Log on to your fresh Debian
|
||||||
|
- apt-get install git
|
||||||
|
- mkdir -p /var/www
|
||||||
|
- cd /var/www
|
||||||
|
- git clone https://framagit.org/hubzilla/core.git html
|
||||||
|
- cd html/.homeinstall
|
||||||
|
- cp hubzilla-config.txt.template hubzilla-config.txt
|
||||||
|
- nano hubzilla-config.txt
|
||||||
|
- Read the comments carefully
|
||||||
|
- Enter your values: db pass, domain, values for dyn DNS
|
||||||
|
- Prepare your external disk for backups
|
||||||
|
- hubzilla-setup.sh as root
|
||||||
|
- ... wait, wait, wait until the script is finised
|
||||||
|
+ Open your domain with a browser and step throught the initial configuration of hubzilla.
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
## Optional - Switch verification of email on/off
|
||||||
|
|
||||||
|
Do this just befor you register the user.
|
||||||
|
|
||||||
|
In Admin settings of hubzilla or via terminal
|
||||||
|
|
||||||
|
cd /var/www/html
|
||||||
|
|
||||||
|
Check the current setting
|
||||||
|
|
||||||
|
util/config system verify_email
|
||||||
|
|
||||||
|
Switch the verification on/off (1/0)
|
||||||
|
|
||||||
|
util/config system verify_email 0
|
||||||
|
|
||||||
|
## What the script will do for you...
|
||||||
|
|
||||||
+ install everything required by Hubzilla, basically a web server (Apache), PHP, a database (MySQL), certbot,...
|
+ install everything required by Hubzilla, basically a web server (Apache), PHP, a database (MySQL), certbot,...
|
||||||
+ create a database
|
+ create a database
|
||||||
@ -38,69 +93,11 @@ The script can install both [Hubzilla](https://zotlabs.org/page/hubzilla/hubzill
|
|||||||
- core: git clone https://framagit.org/zot/zap.git html (in this readme)
|
- core: git clone https://framagit.org/zot/zap.git html (in this readme)
|
||||||
- addons: util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons (in hubzilla-setup.sh)
|
- addons: util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons (in hubzilla-setup.sh)
|
||||||
|
|
||||||
## Disclaimers
|
|
||||||
|
|
||||||
- This script does work with Debian 10 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).
|
|
||||||
|
|
||||||
# Step-by-Step Overwiew
|
# Step-by-Step - some Details
|
||||||
|
|
||||||
## Preconditions
|
## Preparations
|
||||||
|
|
||||||
Hardware
|
|
||||||
|
|
||||||
+ Internet connection and router at home
|
|
||||||
+ Mini-pc connected to your router (a Raspberry 3 will do for very small Hubs)
|
|
||||||
+ USB drive for backups
|
|
||||||
|
|
||||||
Software
|
|
||||||
|
|
||||||
+ Fresh installation of Debian 10 (Stretch)
|
|
||||||
+ Router with open ports 80 and 443 for your web server
|
|
||||||
|
|
||||||
## The basic steps (quick overview)
|
|
||||||
|
|
||||||
+ Register your own domain (for example at selfHOST) or a free subdomain (for example at freeDNS)
|
|
||||||
+ Log on to your fresh Debian
|
|
||||||
- apt-get install git
|
|
||||||
- mkdir -p /var/www
|
|
||||||
- cd /var/www
|
|
||||||
- git clone https://framagit.org/hubzilla/core.git html
|
|
||||||
- cd html/.homeinstall
|
|
||||||
- cp hubzilla-config.txt.template hubzilla-config.txt
|
|
||||||
- nano hubzilla-config.txt
|
|
||||||
- Read the comments carefully
|
|
||||||
- Enter your values: db pass, domain, values for dyn DNS
|
|
||||||
- Prepare your external disk for backups
|
|
||||||
- hubzilla-setup.sh as root
|
|
||||||
- ... wait, wait, wait until the script is finised
|
|
||||||
+ 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
|
|
||||||
|
|
||||||
# Step-by-Step in Detail
|
|
||||||
|
|
||||||
## Preparations Software
|
|
||||||
|
|
||||||
## Install Debian 9
|
|
||||||
|
|
||||||
Provided you use a Raspberry Pi 3...
|
|
||||||
|
|
||||||
Download the OS Raspbian from https://www.raspberrypi.org/downloads/raspbian/
|
|
||||||
|
|
||||||
Follow the installation instruction there.
|
|
||||||
|
|
||||||
## Configure your Router
|
## Configure your Router
|
||||||
|
|
||||||
@ -146,12 +143,5 @@ to boot the Rapsi to the client console.
|
|||||||
|
|
||||||
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!
|
DO NOT FORGET TO CHANGE THE DEFAULT PASSWORD FOR USER PI!
|
||||||
|
|
||||||
On a Raspian Stretch (Debian 10) 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
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,14 +28,13 @@
|
|||||||
# * php,
|
# * php,
|
||||||
# * mariadb - the database for hubzilla,
|
# * mariadb - the database for hubzilla,
|
||||||
# * adminer,
|
# * adminer,
|
||||||
# * git to download and update hubzilla addon
|
# * git to download and update addons
|
||||||
# - download hubzilla core and addons
|
|
||||||
# - configure cron
|
# - configure cron
|
||||||
# * "Master.php" for regular background prozesses of hubzilla
|
# * "Master.php" for regular background prozesses of hubzilla
|
||||||
# * "apt-get update" and "apt-get dist-upgrade" and "apt-get autoremove" to keep linux up-to-date
|
# * "apt-get update" and "apt-get dist-upgrade" and "apt-get autoremove" to keep linux up-to-date
|
||||||
# * run command to keep the IP up-to-date > DynDNS provided by selfHOST.de or freedns.afraid.org
|
# * run command to keep the IP up-to-date > DynDNS provided by selfHOST.de or freedns.afraid.org
|
||||||
# * backup hubzillas database and files (rsync)
|
# * backup hubzillas database and files (rsync)
|
||||||
# - letsencrypt
|
# - run letsencrypt to create, register and use a certifacte for https
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
# Discussion
|
# Discussion
|
||||||
@ -56,7 +55,7 @@
|
|||||||
# - creates a daily cron that runs the hubzilla-daily.sh
|
# - creates a daily cron that runs the hubzilla-daily.sh
|
||||||
#
|
#
|
||||||
# hubzilla-daily.sh makes a (daily) backup of all relevant files
|
# hubzilla-daily.sh makes a (daily) backup of all relevant files
|
||||||
# - /var/lib/mysql/ > hubzilla database
|
# - /var/lib/mysql/ > database
|
||||||
# - /var/www/ > hubzilla/zap from github
|
# - /var/www/ > hubzilla/zap from github
|
||||||
# - /etc/letsencrypt/ > certificates
|
# - /etc/letsencrypt/ > certificates
|
||||||
#
|
#
|
||||||
@ -223,6 +222,11 @@ function install_curl {
|
|||||||
nocheck_install "curl"
|
nocheck_install "curl"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function install_wget {
|
||||||
|
print_info "installing wget..."
|
||||||
|
nocheck_install "wget"
|
||||||
|
}
|
||||||
|
|
||||||
function install_sendmail {
|
function install_sendmail {
|
||||||
print_info "installing sendmail..."
|
print_info "installing sendmail..."
|
||||||
nocheck_install "sendmail sendmail-bin"
|
nocheck_install "sendmail sendmail-bin"
|
||||||
@ -269,7 +273,19 @@ function install_adminer {
|
|||||||
else
|
else
|
||||||
print_info "file /etc/adminer/adminer.conf exists already"
|
print_info "file /etc/adminer/adminer.conf exists already"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
a2enmod rewrite
|
||||||
|
|
||||||
|
if [ ! -f /etc/apache2/apache2.conf ]
|
||||||
|
then
|
||||||
|
die "could not find file /etc/apache2/apache2.conf"
|
||||||
|
fi
|
||||||
|
sed -i \
|
||||||
|
"s/AllowOverride None/AllowOverride all/" \
|
||||||
|
/etc/apache2/apache2.conf
|
||||||
|
|
||||||
a2enconf adminer
|
a2enconf adminer
|
||||||
|
systemctl restart mariadb
|
||||||
systemctl reload apache2
|
systemctl reload apache2
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,10 +423,9 @@ function install_letsencrypt {
|
|||||||
then
|
then
|
||||||
die "Failed to install let's encrypt: 'le_domain' is empty in $configfile"
|
die "Failed to install let's encrypt: 'le_domain' is empty in $configfile"
|
||||||
fi
|
fi
|
||||||
# check if user gave mail address
|
|
||||||
if [ -z "$le_email" ]
|
if [ -z "$le_email" ]
|
||||||
then
|
then
|
||||||
die "Failed to install let's encrypt: 'le_domain' is empty in $configfile"
|
die "Failed to install let's encrypt: 'le_email' is empty in $configfile"
|
||||||
fi
|
fi
|
||||||
nocheck_install "certbot python-certbot-apache"
|
nocheck_install "certbot python-certbot-apache"
|
||||||
print_info "run certbot ..."
|
print_info "run certbot ..."
|
||||||
@ -431,12 +446,19 @@ function check_https {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function install_hubzilla {
|
function install_hubzilla {
|
||||||
print_info "installing hubzilla addons..."
|
print_info "installing addons..."
|
||||||
cd /var/www/html/
|
cd /var/www/html/
|
||||||
# if you install Hubzilla
|
if git remote -v | grep -i "origin.*core.git"
|
||||||
# util/add_addon_repo https://framagit.org/hubzilla/addons hzaddons
|
then
|
||||||
# if you install ZAP
|
print_info "hubzilla"
|
||||||
util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons
|
util/add_addon_repo https://framagit.org/hubzilla/addons hzaddons
|
||||||
|
elif git remote -v | grep -i "origin.*zap.git"
|
||||||
|
then
|
||||||
|
print_info "zap"
|
||||||
|
util/add_addon_repo https://framagit.org/zot/zap-addons.git zaddons
|
||||||
|
else
|
||||||
|
die "neither zap nor hubzilla repository > did not install addons or zap/hubzilla"
|
||||||
|
fi
|
||||||
mkdir -p "store/[data]/smarty3"
|
mkdir -p "store/[data]/smarty3"
|
||||||
chmod -R 777 store
|
chmod -R 777 store
|
||||||
touch .htconfig.php
|
touch .htconfig.php
|
||||||
@ -446,7 +468,7 @@ function install_hubzilla {
|
|||||||
chown root:www-data /var/www/html/
|
chown root:www-data /var/www/html/
|
||||||
chown root:www-data /var/www/html/.htaccess
|
chown root:www-data /var/www/html/.htaccess
|
||||||
chmod 0644 /var/www/html/.htaccess
|
chmod 0644 /var/www/html/.htaccess
|
||||||
print_info "installed hubzilla"
|
print_info "installed addons"
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_rsync {
|
function install_rsync {
|
||||||
@ -585,6 +607,7 @@ check_config
|
|||||||
stop_hubzilla
|
stop_hubzilla
|
||||||
update_upgrade
|
update_upgrade
|
||||||
install_curl
|
install_curl
|
||||||
|
install_wget
|
||||||
install_sendmail
|
install_sendmail
|
||||||
install_apache
|
install_apache
|
||||||
install_imagemagick
|
install_imagemagick
|
||||||
@ -600,23 +623,34 @@ configure_cron_selfhost
|
|||||||
|
|
||||||
if [ "$le_domain" != "localhost" ]
|
if [ "$le_domain" != "localhost" ]
|
||||||
then
|
then
|
||||||
install_letsencrypt
|
install_letsencrypt
|
||||||
check_https
|
configure_apache_for_https
|
||||||
|
check_https
|
||||||
else
|
else
|
||||||
print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https"
|
print_info "is localhost - skipped installation of letsencrypt and configuration of apache for https"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
install_hubzilla
|
install_hubzilla
|
||||||
|
|
||||||
|
if [ "$le_domain" != "localhost" ]
|
||||||
|
then
|
||||||
|
rewrite_to_https
|
||||||
|
install_rsnapshot
|
||||||
|
else
|
||||||
|
print_info "is localhost - skipped rewrite to https and installation of rsnapshot"
|
||||||
|
fi
|
||||||
|
|
||||||
configure_cron_daily
|
configure_cron_daily
|
||||||
|
|
||||||
if [ "$le_domain" != "localhost" ]
|
if [ "$le_domain" != "localhost" ]
|
||||||
then
|
then
|
||||||
install_rsync
|
install_cryptosetup
|
||||||
install_cryptosetup
|
write_uninstall_script
|
||||||
else
|
else
|
||||||
print_info "is localhost - skipped installation of cryptosetup"
|
print_info "is localhost - skipped installation of cryptosetup"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
#set +x # stop debugging from here
|
#set +x # stop debugging from here
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user