How to Install Jirafeau on MXLinux Latest
Jirafeau is a free and open-source, simple file-sharing solution that can be self-hosted. In this tutorial, we will learn how to install Jirafeau on MXLinux Latest.
Prerequisites
Before we go ahead with the installation, we'll have to make sure our MXLinux has the following installed in it:
- Apache2
- PHP 5.4 or greater
- PHP Curl Extension
- PHP SQLite3 Extension
- Git
You can install these prerequisites using the following command:
sudo apt install apache2 php php-curl php-sqlite3 git
Step 1: Clone the Jirafeau Repository
To download the Jirafeau files, we'll use Git to clone the Jirafeau repository.
To do that, follow the commands given below:
Change your working directory to
/var/www/html.cd /var/www/htmlClone the Jirafeau repository using Git.
sudo git clone https://gitlab.com/mojo42/Jirafeau.git
Step 2: Change Ownership and Permissions of the Jirafeau Files
The files that we downloaded above probably have root ownership. To give apache2 ownership over these files, we need to change their ownership.
Use the command below to change ownership of the Jirafeau files in the htmldirectory.
sudo chown -R www-data:www-data /var/www/html/Jirafeau
The above command will give access to your web server user, www-data.
Next, we have to make sure the files inside the /var/www/html/jirafeau directory are readable and executable.
Use the command below to change the permissions of Jirafeau's files inside its directory.
sudo chmod -R 755 /var/www/html/Jirafeau
Step 3: Configure Apache Virtual Host
Next, we need to configure a new virtual host for Jirafeau.
Create a new virtual host configuration file for Jirafeau.
sudo cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/jirafeau.confOpen the newly-created
jirafeau.conffile in your preferred text editor.sudo nano /etc/apache2/sites-available/jirafeau.confReplace the contents in the text editor with the following.
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName jirafeau.example.com
DocumentRoot /var/www/html/Jirafeau
<Directory /var/www/html/Jirafeau/>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/jirafeau_error.log
CustomLog ${APACHE_LOG_DIR}/jirafeau_access.log combined
</VirtualHost>
Update ServerAdmin, ServerName and DocumentRoot(if it's different in your MXLinux latest version) to match your requirements.
Enable the
jirafeau.conffile.sudo a2ensite jirafeau.confRestart apache2 to take the changes into effect.
sudo systemctl restart apache2
Step 4: Create SQLite Database
Jirafeau stores the file uploads in an SQLite database. So, we need to create a new SQLite database for Jirafeau.
Create a new SQLite database under the Jirafeau directory.
cd /var/www/html/Jirafeau/ sudo sqlite3 jirafeau.dbAt the SQLite command prompt, run the following commands:
.headers on .mode column .width 30 10 50 50 CREATE TABLE IF NOT EXISTS upload ( id INTEGER PRIMARY KEY, token TEXT, filename TEXT, mimetype TEXT, size INTEGER, filedata BLOB );Exit the SQLite command prompt.
.quit
Step 5: Accessing Jirafeau
At this point, Jirafeau is installed and configured. You can now visit your domain or IP address to use Jirafeau.
http://your_domain_or_IP_address/
You should see the Jirafeau home screen, where you can upload and share files.
Conclusion
We have successfully installed and set up Jirafeau on MXLinux Latest. You can now start uploading and sharing files using Jirafeau.