Install Hubzilla in 7 easy steps

 somewhere between the lines,  last edited: Fri, 21 Apr 2017 22:01:25 +0200  
Installing my favorite web suite aka Hubzilla on the forthcoming Debian 9 "Stretch" is a joy. Quick, straightforward and easy. I will show you how to do it in about 10 minutes or less.
Currently I am preparing for the switch to Debian 9 "Stretch". So far I am quite happy with the update and I am pretty happy to finally welcome back to my favourite distro the pacemaker clustering suite. But that is another story and shall be told at another time. :)
(This is just a quick cheatsheet, I will later write a longer howto for later. Promised.)
I am starting with a basic Debian installation. The only additional feature chosen during installation is ssh-server.
  • The Basics: Install the required dependencies:
    apt-get install vim git apache2 mariadb-server php certbot python-certbot-apache php-curl php-gd php-mbstring php-xml php-mysql
  • Webserver apache: Create vhost file /etc/apache2/sites-available/hubzilla.conf and enable vhost, enable the required apache module rewrite
    <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/hubzilla
        <Directory />
            Options FollowSymLinks
            AllowOverride All
        <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
        ErrorLog ${APACHE_LOG_DIR}/hubzilla_error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/hubzilla_access.log combined

    Enable the new vhost
    enable /etc/apache2/sites-available/hubzilla.conf
    Enable apache modules rewrite
    a2enmod rewrite
    Restart apache2 in order to activate all these changes
    systemctl restart apache2
  • Download Hubzilla: clone the Hubzilla Git repository and chown everything to be writable to the webserver account www-data
    cd /var/www/ ; git clone ; chown -R www-data. hubzilla;
  • create the database
    mysql -u root
    create database hubzilla ; CREATE USER 'hubzilla'@'localhost' IDENTIFIED BY 'totally-secret-password'; GRANT ALL PRIVILEGES ON hubzilla.* to 'hubzilla'@'localhost';
  • SSL Encryption: create the letscencrypt certificates in order to use SSL and have certbot automatically configure your apache vhost to use SSL. Just follow the instructions. Let certbot configure your vhost to use SSL.
  • setup a cronjob
    echo "*/10 * * * *    cd /var/www/hubzilla; /usr/bin/php Zotlabs/Daemon/Master.php Cron"  >> /etc/crontab
  • Finally: open your browser and follow the instructions.
I think on CentOS I used something like this for SELinux:
setsebool -P httpd_can_sendmail on
semanage fcontext -a -t httpd_sys_content_t "/var/www/hubzilla(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/hubzilla/store(/.*)?"
semanage fcontext -a -t httpd_sys_rw_content_t "/var/www/hubzilla/.htconfig.php"
restorecon -Rv /var/www/hubzilla/
  last edited: Fri, 21 Apr 2017 22:11:08 +0200  
Yes, that should be right. :)
Though I left CentOS because I had _very_ strange issues with Hubzilla refusing to embed links and the likes. Very strange, but once I moved the site back to Debian everything was fine again. Should have got some logs somewhere.
Einer von Vielen
But maybe we should improve the script to be more flexible, not just for home use.