Install instructions for Ubunu Linux & Raspberry Pi
This process applies to all Ubuntu variants (Kubuntu, Pop-os, Tuxedo OS etc.).
These instructions also apply to a Raspberry Pi, but remember: the earlier Raspberry Pi models (1 &2) are quite slow.
Posadoble is a web application.
This means it needs a webserver (Apache) and a database (MySQL/MariaDB) to run.
1. Install webserver and database first
Update package manager
Open the terminal and update the package manager:
sudo apt update
sudo apt upgrade
Enter your password if necessary.
Press “y” and press enter when it asks if you are sure you want to update.
Install Apache
In the terminal, type:
sudo apt install apache2
Press “y” and press enter when it asks if you want to install
Check
Let’s test if the webserver is installed by navigating to http://localhost in your browser (like Chrome or Firefox).
Enable rewrite module
So we can make pretty urls that don’t end on .php or .html
sudo a2enmod rewrite
Write permissions
We need permissions to write in the web documents directory (/var/www/).
To do this, we change the owner of the web documents to the current user of the computer:
sudo chown -R [your username] /var/www
(don’t forget to replace [your username] with your actual username on this computer)
Edit envvars
Now the computer user owns the directory, Apache can’t write to this directory anymore.
Let’s fix that by letting Apache act as our current computer user.
(it would be safer to create a new user with less permissions, but this is a quick tutorial).
sudo nano /etc/apache2/envvars
This opens the file envvars in the text editor Nano.
Look for the lines:
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
change both “www-data” into the name of your computer user.
If your user is named “bert”, it will look like this:
export APACHE_RUN_USER=bert
export APACHE_RUN_GROUP=bert
Exit Nano with CTRL-X.
If it asks to save modified buffer (aka save file): press “y”.
If it asks the name of the file, just press enter.
Install PHP
Install php and mysql:
sudo apt install php libapache2-mod-php
sudo apt install php-mysql
Restart Apache
Restart the webserver for the change to take effect:
sudo service apache2 restart
Install MySQL/MariaDB
sudo apt install mariadb-server
To be sure update the package manager again, otherwise the next command might not run.
sudo apt update
sudo apt upgrade
Out of the box mysql is installed with the default user: root with no password.
This is extremely insecure, because everyone and his dog knows this user and password combination.
There is a little tool to fix this security issue:
sudo mariadb-secure-installation
The tool asks a couple of questions:
- Current password for root:
just hit enter, because there is no password yet - Switch to unix_socket authentication? no
Because then you cant connect with windows to mysql - Change root password? yes
- New password
Enter a new password - Re-enter password
Repeat the password you just typed
- New password
- Remove anonymous users? yes
- Disallow root login remotely? yes
The database server and the webserver are installed on the same computer,
it doesn’t make sense that other computers can connect to the database. - remove test database? yes
- reload privilege tables? yes
To make the database extra secure, it is wise to create a new user with another password.
This will be the user that we use for Posadoble.
Make sure that this user has only access to one database: the database of Posadoble.
For the sake of a quick tutorial, I’ll skip this.
2. Install Posadoble
Delete index.html
Remove the example document index.html file from /var/www/html/index.html
because it might interfere with Posadoble.
rm /var/www/html/index.html
Download
Download Posadoble from our download page.
Extract the zip file by double clicking on the file in your file browser.
Copy files
For security reasons, there are 2 types of files:
- Public files – that everybody is allowed to see (images, text on web pages etc)
These are stored in the “public” directory in Posadoble - Private files – that nobody is allowed to see (configuration files with passwords, logfiles, translation files etc)
These are all other files not in the “public” directory.
Copy the source files in the proper webserver directories
When you look in the /var/www/ directory, you’ll see one directory: “html”.
The “html” is the public directory that the webserver will show everyone when typing “http://localhost” in the address bar of the browser.
The public files need to go in the /var/www/html subdirectory directory, the rest one level below in the /var/www/ directory.
In other words:
- Copy all the files from the “public” directory from Posadoble into /var/www/html
- Copy all other files into /var/www
Start Installer
In your browser, type in the address bar:
http://localhost/install/index.php
(you can also click the link above, it will open in a new tab)
- Choose “install” and click “next”
- Check the “I Agree box” and click “next”
Pre requisites checks
You will probably get a couple of errors in the pre-requisites screen, if not, congratulations, skip this step by clicking “next”.
mod_rewrite
Posadoble needs this to make pretty urls in the browser bar.
We enabled mod_rewrite before, so this shouldn’t be a problem.
When you get an error in the installer, you might have missed it earlier:
sudo a2enmod rewrite
Restart the webserver for the change to take effect:
sudo service apache2 restart
url rewriting
If you get an error here,
open the /etc/apache2/apache2.conf file:
sudo nano /etc/apache2/apache2.conf
In the /etc/apache2/apache2.conf file,
look for the following lines:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
“AllowOverride None” should read “AllowOverride All“, so:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
CTRL-X out of Nano, when it asks to save: yes.
Restart the webserver for the change to take effect:
sudo service apache2 restart
PHP modules
Probably PHP misses a couple of modules we need for Posadoble.
You can install them in one go by typing in the terminal:
sudo apt install openssl php-bcmath php-curl php-mbstring php-mysql php-tokenizer php-xml php-zip php-intl php-exif php-gd
Restart the webserver again for this change to take effect:
sudo service apache2 restart
Re-run checks
You can see if everything works by click on the “run checks again” link on the bottom of the page of the installer.
Everything should be good to go now!
Next, next, next
Just follow the guided instructions in the installer and click the “next” button on very screen.
Installation report
The last screen is the installation report.
Please write down (or copy or print) all the information of the installation report for your own administration.
Login
In the installation report you’ll find a button “login”, this takes you to the login screen of Posadoble.
Have fun!