How to Install Gibbon on OpenBSD

Gibbon is an open source web-based school management system that allows institutions to manage and organize various academic and administrative tasks. In this tutorial, we will walk you through the process of installing Gibbon on OpenBSD.

Prerequisites

Before you begin, make sure you have the following prerequisites:

Step 1: Install Dependencies

To run Gibbon on your OpenBSD server, you need to install a few dependencies. Type the following command in your terminal:

$ doas pkg_add php php-curl php-gd php-mbstring php-pdo_mysql php-zip

This command will install PHP along with the required extensions.

Step 2: Download and Extract Gibbon

Now that you have all the dependencies installed, it is time to download and extract the Gibbon package. You can download the latest version of Gibbon from the official website https://gibbonedu.org.

Use the following command to download the latest version of Gibbon:

$ doas ftp https://github.com/GibbonEdu/core/archive/refs/tags/v22.0.00.tar.gz

After successful download, extract the file using the following command:

$ doas tar -xf v22.0.00.tar.gz

This command will extract the Gibbon package in the current directory.

Step 3: Move Gibbon files to the Web Root

After extracting the Gibbon package, move the files to the web root directory. The web root directory on OpenBSD is /var/www/htdocs/. Use the following command to move the Gibbon files:

$ doas mv core-22.0.00 /var/www/htdocs/gibbon

This command will move the Gibbon files to the /var/www/htdocs/gibbon directory.

Step 4: Configure Gibbon

By default, Gibbon comes with a configuration file called config.php. This file contains all the necessary settings that you need to modify to get Gibbon up and running.

Use the following command to edit the config.php file:

$ doas vi /var/www/htdocs/gibbon/config.php

Update the following settings as appropriate for your environment:

define('IS_WINDOWS', false);
define('SITE_URL', 'http://localhost/gibbon');
define('INSTALL_PATH', '/var/www/htdocs/gibbon');

define('DB_HOST', 'localhost');
define('DB_NAME', 'gibbon');
define('DB_USER', 'root');
define('DB_PASSWORD', '');
define('DB_PORT', '3306');
define('DB_SOCKET', '');
define('PDO_DSN', 'mysql:host=localhost;port=3306;dbname=gibbon');

define('SESSION_NAME', 'Gibbon');
define('SESSION_LIFETIME', 1440);

define('SMTP_HOST', '');
define('SMTP_PORT', '');
define('SMTP_USERNAME', '');
define('SMTP_PASSWORD', '');

define('LOG_PATH', '/var/log/gibbon');
define('LOG_LEVEL', 'ERROR');

Step 5: Set File Permissions

To allow the web server to access the Gibbon files, you need to set the permissions on the appropriate directories.

Use the following commands to set the appropriate permissions:

$ doas chown -R www:www /var/www/htdocs/gibbon
$ doas chmod -R 770 /var/www/htdocs/gibbon

This command sets the owner of the gibbon directory to www and changes the directory permissions to 770.

Step 6: Configure the Web Server

Finally, you need to configure the web server to recognize Gibbon. By default, OpenBSD uses the httpd web server.

Use the following command to edit the web server configuration file:

$ doas vi /etc/httpd.conf

Add the following lines at the end of the file:

$doas cat /etc/httpd.conf
server "localhost" {
        listen on * port 80
        directory index index.php
        root "/var/www/htdocs"

        location "/*.php" {
                fastcgi socket "/run/php-fpm.sock"
        }
}

server "localhost" {
        listen on * port 80
        directory index index.php
        root "/var/www/htdocs/gibbon"
        location "/*.php" {
                fastcgi socket "/run/php-fpm.sock"
        }
}

This code creates two servers: the first one is set to the default web root directory, while the second one is set to Gibbon's installation directory.

Once you have made the necessary changes, restart the httpd service:

$ doas rcctl enable httpd
$ doas rcctl start httpd

Step 7: Access Gibbon

Once you have completed the above steps, you should be able to access Gibbon by visiting http://localhost/gibbon in your web browser.

Conclusion

Congratulations! You have successfully installed Gibbon on OpenBSD. We encourage you to further explore Gibbon and configure it as per your institutional requirements.

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!