Installing OrangeHRM on Arch Linux

OrangeHRM is an open-source HR management software that offers a range of features, including personnel information management, employee self-service, leave management, time and attendance tracking, and more. In this tutorial, we'll be discussing the steps to install OrangeHRM on Arch Linux.

Requirements

Before we dive into the installation process, let's make sure that we have all the necessary requirements:

Installation Steps

Let's start installing OrangeHRM on Arch Linux:

Step 1: Update the System

Firstly, update your system with the latest packages and dependencies.

sudo pacman -Syu

Step 2: Install Apache web server

Run the following command to install the Apache web server.

sudo pacman -S apache

After installation, start the Apache service and enable it to run on system boot:

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Step 3: Install PHP

Next, we need to install PHP on our system.

sudo pacman -S php php-apache

Step 4: Install MariaDB server

OrangeHRM requires a database server to store its data. We'll be using MariaDB server for this tutorial.

Use the following command to install MariaDB server:

sudo pacman -S mariadb

After installation, start the MariaDB service and enable it to run on system boot:

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Next, run the mysql_secure_installation command to secure your MariaDB installation:

sudo mysql_secure_installation

Step 5: Create a database for OrangeHRM

Now that we have installed MariaDB, let's create a new database for OrangeHRM.

Log in to the MariaDB server as root:

sudo mysql -u root -p

Create a new database called orangehrm_database:

CREATE DATABASE orangehrm_database;

Create a new user called orangehrm_user and set a password:

CREATE USER 'orangehrm_user'@'localhost' IDENTIFIED BY 'password';

Grant all privileges to the orangehrm_user for the orangehrm_database:

GRANT ALL PRIVILEGES ON orangehrm_database.* TO 'orangehrm_user'@'localhost';

Flush the privileges:

FLUSH PRIVILEGES;

Exit the MariaDB server:

EXIT;

Step 6: Download and Install OrangeHRM

Download the latest version of OrangeHRM from their official website (https://www.orangehrm.com/download/).

Extract the downloaded file into the /var/www/html directory:

sudo tar -xzf orangehrm-<version>.tar.gz -C /var/www/html/

Set the ownership for the extracted directory to the Apache user:

sudo chown -R http:http /var/www/html/orangehrm-<version>/

Step 7: Configure OrangeHRM

Create a new configuration file named config-db.php inside the /var/www/html/orangehrm-<version>/lib/confs/ directory:

sudo nano /var/www/html/orangehrm-<version>/lib/confs/config-db.php

Copy the following code and replace the values with your own:

<?php
   define('DB_HOST','localhost');
   define('DB_NAME','orangehrm_database');
   define('DB_USER','orangehrm_user');
   define('DB_PASSWORD','password');
   define('DB_TYPE','mysql');
?>

Save and exit the file.

Step 8: Set Permissions

Set the permissions for the sessions directory:

sudo chmod 777 /var/www/html/orangehrm-<version>/symfony/cache/orangehrm/sessions/

Step 9: Configure Apache

Create a new virtual host file for OrangeHRM:

sudo nano /etc/httpd/conf/extra/orangehrm.conf

Copy the following code and replace the values with your own:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html/orangehrm-<version>
    ServerName your_domain.com
    ErrorLog /var/log/httpd/orangehrm_error.log
    CustomLog /var/log/httpd/orangehrm_access.log combined
</VirtualHost>

Save and exit the file.

Enable the rewrite module:

sudo a2enmod rewrite

Restart the Apache service:

sudo systemctl restart httpd.service

Step 10: Access OrangeHRM

Open a web browser and navigate to http://your_domain.com. Follow the installation wizard to complete the installation.

Conclusion

In this tutorial, we have successfully installed and configured OrangeHRM on Arch Linux. With OrangeHRM, you can automate your HR management tasks and streamline your workflows efficiently.

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!