Jirafeau is a web-based file sharing tool that allows you to securely share files with others. In this tutorial, we will go through the steps to install Jirafeau on NetBSD.
Before we get started, make sure you have the following:
First, we need to install some packages required to run Jirafeau:
# pkgin update
# pkgin install mariadb-server php74-fpm php74-mysqli php74-gd php74-curl
We need to create a MariaDB database to store the data for Jirafeau. Log in to your MariaDB server and create a new database:
# mysql -u root -p
MariaDB> CREATE DATABASE jirafeau;
MariaDB> GRANT ALL PRIVILEGES ON jirafeau.* TO 'jirafeau'@'localhost' IDENTIFIED BY 'your_password';
MariaDB> FLUSH PRIVILEGES;
MariaDB> exit
Make sure to replace your_password
with a secure password for the Jirafeau user.
Download the latest version of Jirafeau from the GitLab repository:
# cd /var/www
# git clone https://gitlab.com/mojo42/Jirafeau.git jirafeau
Edit the PHP configuration to match the following:
# vi /usr/pkg/etc/php-7.4-fpm/php.ini
memory_limit = 256M
upload_max_filesize = 100M
post_max_size = 100M
max_execution_time = 600
max_input_time = 600
max_input_vars = 10000
Save and exit the file.
Copy the settings.inc.php-dist
file to settings.inc.php
and edit the file to match your server configuration:
# cd jirafeau
# cp settings.inc.php-dist settings.inc.php
# vi settings.inc.php
define('DB_TYPE', 'mysqli');
define('DB_HOST', 'localhost');
define('DB_USER', 'jirafeau');
define('DB_PASS', 'your_password');
define('DB_NAME', 'jirafeau');
define('MAIN_URL', 'http://your_ip_or_domain/jirafeau/');
define('THUMB_DIR', 'thumb/');
define('THUMB_PREFIX', 'thumb-');
define('TMP_DIR', 'temp/');
define('CHECK_MIMETYPE', true);
define('SECRET_KEY', 'your_secret_key');
define('LDAP_ENABLE', false);
Save and exit the file.
Create an NGINX configuration file for Jirafeau:
# vi /usr/pkg/etc/nginx/sites-available/jirafeau
server {
listen 80;
server_name your_ip_or_domain;
root /var/www/jirafeau;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico)$ {
expires 30d;
access_log off;
}
location ~ \.php$ {
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}
Save and exit the file.
Enable the NGINX configuration file and restart the service:
# cd /usr/pkg/etc/nginx/sites-enabled/
# ln -s ../sites-available/jirafeau jirafeau
# nginx -s reload
Finally, allow HTTP traffic on the NetBSD firewall:
# echo 'pass in proto tcp from any to any port 80' >> /etc/pf.conf
# pfctl -f /etc/pf.conf
Visit the Jirafeau website in your web browser to finish the installation:
http://your_ip_or_domain/jirafeau/
Follow the prompts to set up your administrator account and you're ready to go!
In this tutorial, we have shown you how to install Jirafeau on NetBSD. You can now securely share files with others using the Jirafeau file sharing tool.
If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!
Alternatively, for the best virtual desktop, try Shells!