OrangeHRM is the mostly used free and open source human resource management (HRM) software in the industry. OrangeHRM Inc is the software company behind the OrangeHRM application and also provides two additional editions of orangeHRM, OrangeHRM Professional and OrangeHRM Enterprise. Some of the features of OrangeHRM are listed below.
- Administration Module.
- Personal Information Management.
- Leave Module.
- Time Module.
- Employee Self Service Module.
- Recruitment/ Applicant Tracking Module.
- Performance Module.
Prerequisites
To install OrangeHRM you’ll only need a CentOS 7 server and root privileges over it if you are logged in as non root user then run sudo -i
command to switch to root user. Follow this guide to install OrangeHRM on your CentOS 7 server.
Updating System
It is highly recommended to update your system and upgrade the available packages so please run the below shown command it’ll do the job for you.yum -y update
Installing Apache Web Server
Once the system is updated, you can install the dependencies required. To install OrangeHRM you will need to install the Apache web server along with MaraiDB and PHP with a few extensions.
Run the following command to install the Apache web server.
yum -y install httpd
Now you can start Apache and enable it to start at boot time, using the following commands.
systemctl start httpd.service systemctl enable httpd.service
You can check the status of Apache web server using the following command.
systemctl status httpd
You should see following output:
[root@ip-172-31-21-184 ~]# systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2017-02-04 13:59:58 UTC; 30s ago
Docs: man:httpd(8)
man:apachectl(8)
Main PID: 10556 (httpd)
Status: "Total requests: 0; Current requests/sec: 0; Current traffic: 0 B/sec"
CGroup: /system.slice/httpd.service
├─10556 /usr/sbin/httpd -DFOREGROUND
├─10557 /usr/sbin/httpd -DFOREGROUND
├─10558 /usr/sbin/httpd -DFOREGROUND
├─10559 /usr/sbin/httpd -DFOREGROUND
├─10560 /usr/sbin/httpd -DFOREGROUND
└─10561 /usr/sbin/httpd -DFOREGROUND
Feb 04 13:59:58 ip-172-31-21-184 systemd[1]: Starting The Apache HTTP Server...
Feb 04 13:59:58 ip-172-31-21-184 systemd[1]: Started The Apache HTTP Server.
We will need to install MariaDB for database purposes for OrangeHRM. MariaDB 5.5 is shipped in the default CentOS 7 repository, so just run this command to install MariaDB.
yum -y install mariadb-server
Now you’ll have to start the MariaDB service and enable it to start at the boot time like we have done before for apache server, to do so please run following command.
systemctl start mariadb.service systemctl enable mariadb.service
You can check status of mariaDB using this command and you should see following output.
systemctl status mariadb.service
[root@ip-172-31-21-184 ~]# systemctl status mariadb.service
● mariadb.service - MariaDB database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2017-02-04 14:01:41 UTC; 47s ago
Main PID: 10727 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─10727 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─10884 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr...
Feb 04 14:01:39 ip-172-31-21-184 mariadb-prepare-db-dir[10648]: The latest information about Ma....
Feb 04 14:01:39 ip-172-31-21-184 mariadb-prepare-db-dir[10648]: You can find additional informa...:
Feb 04 14:01:39 ip-172-31-21-184 mariadb-prepare-db-dir[10648]: http://dev.mysql.com
Feb 04 14:01:39 ip-172-31-21-184 mariadb-prepare-db-dir[10648]: Support MariaDB development by ...B
Feb 04 14:01:39 ip-172-31-21-184 mariadb-prepare-db-dir[10648]: Corporation Ab. You can contact....
Feb 04 14:01:39 ip-172-31-21-184 mariadb-prepare-db-dir[10648]: Alternatively consider joining ...:
Feb 04 14:01:39 ip-172-31-21-184 mariadb-prepare-db-dir[10648]: http://mariadb.com/kb/en/contri.../
Feb 04 14:01:39 ip-172-31-21-184 mysqld_safe[10727]: 170204 14:01:39 mysqld_safe Logging to '/...'.
Feb 04 14:01:39 ip-172-31-21-184 mysqld_safe[10727]: 170204 14:01:39 mysqld_safe Starting mysq...ql
Feb 04 14:01:41 ip-172-31-21-184 systemd[1]: Started MariaDB database server.
We will have to make sure that this installation is secure and to do so run following command.
mysql_secure_installation
You’ll be asked to provide root password so enter appropriate password and answer yes to all questions by pressing Y.
Now you’ll have to create a database for OrangeHRM please follow the instructions.
mysql -u root -p
You’ll be asked to enter password so simply enter a password and now execute the following queries to create a new database.
CREATE DATABASE orangehrm;
The above query will create a database named orangrhrm. For the database you can use any name you prefer in the place of orangehrm. Make sure that you use semicolon at the end of each query as a query always ends with a semicolon. Once the database is created you can create a new user and grant the required permissions to the user for the database.
CREATE USER 'orangehrm_user'@'localhost' IDENTIFIED BY 'StrongPassword';
The above query will create a user with username orangehrm_user. You can use any preferred username instead of orangehrm_user. Replace StrongPassword with a strong password.
Now provide the appropriate privileges to your database user over the database you have created. Run the following query to do so.
GRANT ALL PRIVILEGES ON orangehrm.* TO 'orangehrm_user'@'localhost';
Now run the following query to immediately apply the changes on the database privileges.
FLUSH PRIVILEGES;
Now you can exit from MariaDB prompt using following command.\q
.
We will have to install PHP. To do so run following commands as shown below.
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Now use this command to install PHP 5.6 and required extensions.
yum install php56w php56w-opcache
Next you’ll have to restart your apache web server to load new components that we just configured and use following command to restart apache web server.
systemctl restart httpd.service
Installing OrangeHRM
Once we have installed all the dependencies required to install orangeHRM now let’s download and install latest version of orangeHRM available. First go to the web root directory /var/www/html then download the orangeHRM as shown below commands.
cd /var/www/html
If in case you don’t have wget package and unzip package installed on your system then you can install them using yum -y install wget unzip
.
wget http://nchc.dl.sourceforge.net/project/orangehrm/stable/3.3.2/orangehrm-3.3.2.zip
unzip orangehrm-3.3.2.zip
Move all the files from orangehrm directory to your current working directory using below given command.
mv orangehrm-3.3.2/* . && mv orangehrm-3.3.2/.htaccess .
Next you’ll have to set proper ownership permissions and you can do so using this underneath command.
chown -R apache:apache /var/www/html
Next we will have to edit MariaDB configuration file. You can use any text editor to edit configuration file here we are using nano text editor. If in you don’t have nano editor you can install it using yum -y install nano
.
Now run below shown command to edit the MariaDB configuration file.
nano /etc/my.cnf
Under the [mysqld] block please place the following line: event_scheduler = ON
and then restart the MariaDB to apply the changes.
systemctl restart mariadb
Next we will have to edit the apache web server configuration file using any text editor so open the apache configuration file and to do so underneath command will do the job.
nano /etc/httpd/conf/httpd.conf
Please find the line ‘AllowOverride None‘ and change it to ‘AllowOverride All‘, save the file and exit from text editor. This will enable .htaccess files to be used by your web browser. Now restart the apache web server to apply changes that we have just made.
systemctl restart httpd
Next you’ll have to modify firewall rules and if in case you don’t have firewalld services installed on your server then you can install it using yum -y install firewalld
and you can start it using systemctl start firewalld
Next run these below given command to modify the firewalld rules.
firewall-cmd --zone=public --permanent --add-service=httpfirewall-cmd --reload
Now disable SELinux temporarily using this below given command.
setenforce 0
Web Access for OrangeHRM
OrangeHRM will be available on HTTP port 80 by default so just open your web browser and visit http://yourserverIP and complete the required steps to finish the installation process.
HP_NO_IMG/data/uploads/users/744ed2f1-2baa-42b2-b09d-ad15a2ae3934/1102883115.png” alt=” ” />
Click on Next to continue with the installation wizard and by clicking on next button you’ll see a license and agreement page like this simply click on I Accept.
HP_NO_IMG/data/uploads/users/744ed2f1-2baa-42b2-b09d-ad15a2ae3934/1665568857.png” alt=” ” />
Next you’ll be asked to provide database configuration details so enter the database details that we used for orangehrm and then click on Next.
HP_NO_IMG/data/uploads/users/744ed2f1-2baa-42b2-b09d-ad15a2ae3934/1730278030.png” alt=” ” />
The next step is a system check so make sure all listed items are green and ok. Next create a username and password and follow the instructions and then finally click on install button to finish the installation process.
Conclusion
In this tutorial we have learned that how to install OrangeHRM on CentOS 7 server.