How to Install Fusion Directory on Void Linux

Fusion Directory is a web-based interface to manage LDAP directories. In this tutorial, we will learn how to install Fusion Directory on Void Linux.

Prerequisites

Before you start, make sure you have the following:

Step 1: Install Required Packages

First, we need to install required packages for Fusion Directory. Open a terminal and run the following command to update the package list:

sudo xbps-install -Syu

Then install the required packages by running the following command:

sudo xbps-install -S mariadb mariadb-client mariadb-server php php-fpm php-mysql nginx

Step 2: Install Fusion Directory

We will now download the Fusion Directory .tar.gz file and extract it. In a terminal, run the following commands:

cd /tmp
wget https://repos.fusiondirectory.org/sources/fusiondirectory/fusiondirectory_1.4.2.tar.gz
tar zxf fusiondirectory_1.4.2.tar.gz

Then copy the extracted files to /usr/share/nginx/html/fd directory:

sudo cp -R fusiondirectory* /usr/share/nginx/html/fd/

Step 3: Configure MariaDB

We will now configure MariaDB to store LDAP data. Run the following command in the terminal to start MariaDB:

sudo systemctl start mariadb

Then run the following command to secure MariaDB installation:

sudo mysql_secure_installation

Follow the instructions to set the root password and secure the MariaDB installation.

Now, we need to create a database and user for Fusion Directory. Open the MariaDB prompt by running the following command:

sudo mysql -u root -p

Enter the root password and press Enter. Then run the following commands:

CREATE DATABASE fusiondirectory;
CREATE USER 'fusiondirectory'@'localhost' IDENTIFIED BY 'your_password_here';
GRANT ALL PRIVILEGES ON fusiondirectory.* TO 'fusiondirectory'@'localhost';
FLUSH PRIVILEGES;

Remember to replace your_password_here with a strong password.

Step 4: Configure PHP-FPM

We need to configure PHP-FPM to enable required PHP modules for Fusion Directory. Open the PHP-FPM configuration file in a text editor:

sudo nano /etc/php-fpm.conf

Then uncomment the following lines by removing the semicolon at the beginning of each line:

;extension=mysqli
;extension=pdo_mysql

Save and close the file by pressing CTRL + X, Y, and ENTER.

Now, restart PHP-FPM service to apply the changes by running the following command:

sudo systemctl restart php-fpm

Step 5: Configure Nginx

We need to configure Nginx to serve the Fusion Directory web application. Open the Nginx configuration file in a text editor:

sudo nano /etc/nginx/nginx.conf

Remove the default_server directive by deleting the following lines:

    server {
        listen       80 default_server;
        listen       [::]:80 default_server;
        server_name  _;
        root         /usr/share/nginx/html;

        # Load configuration files for the default server block.
        include /etc/nginx/default.d/*.conf;

        location / {
        }

        error_page 404 /404.html;
            location = /40x.html {
        }

        error_page 500 502 503 504 /50x.html;
            location = /50x.html {
        }
    }

Then add the following Nginx server block configuration:

server {
    listen 80;
    server_name your_domain.com;

    index index.php;
    root /usr/share/nginx/html/fd;

    access_log /var/log/nginx/fusiondirectory.access.log;
    error_log /var/log/nginx/fusiondirectory.error.log;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/run/php-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
    }
}

Remember to replace your_domain.com with your own domain name or IP address.

Save and close the file by pressing CTRL + X, Y, and ENTER.

Now, restart Nginx service to apply the changes by running the following command:

sudo systemctl restart nginx

Step 6: Access Fusion Directory

Open a web browser and navigate to http://your_domain.com/fd. You should see the Fusion Directory login page. Use the default username admin and password admin to login for the first time. You will be prompted to change the password.

Congratulations! You have successfully installed Fusion Directory on Void Linux.

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!