banner image

Setup OrangeHRM on Debian 9 stretch or Ubuntu 16.04 LTS with Apache2, MariaDB and PHP 7.1 Support



Setup OrangeHRM on Debian 9 or Ubuntu 16.04 LTS with Apache2, MariaDB and PHP 7.1 Support

OrangeHRM Open Source is a free and open source HR software that offers a wealth of modules to suit the needs of your business. This widely-used HR management system is feature-rich, intuitive and provides an essential HR management platform along with free documentation and access to a broad community of users


Let's get start

This is what they say what we need

      Apache HTTP Server 1.3 or later
      MySQL 5.1.6 or later
      PHP 5.3.0 or later

What we actually going to use

      Apache HTTP Server 2
      MariaDB
      PHP 7.1

It's recommended and good practice to update your system to latest stable version

Use following Commands

sudo apt-get update -y sudo apt-get upgrade -y

Step 2: Install Apache2 HTTP Server

OrangeHRM requires a webserver and the second most popular webserver in use today is Apache2. So, go and install


apt-get install apache2 apache2-data libaio1 libapr1 libaprutil1 libdbd-mysql-perl libdbi-perl libhtml-template-perl libterm-readkey-perl libwrap0 tcpd -y

check apache web server status . some time due to system issues install may contain some errors if that happen apache wan't start so to confirm that web server working 100% OK  we check service status .

service apache2 status

If its not started then you can start apache from following command

service apache2 start or service apache2 restart

Step 3: Install PHP 7.1

PHP 7.1 isn’t available on Ubuntu or debian 9 default repositories… in order to install it, you will have to get it from third-party repositories.

Ubuntu

sudo apt-get install software-properties-common sudo add-apt-repository ppa:ondrej/php

Debian 9 Stretch

sudo apt install ca-certificates apt-transport-https wget -q https://packages.sury.org/php/apt.gpg -O- | sudo apt-key add - echo "deb https://packages.sury.org/php/ stretch main" | sudo tee /etc/apt/sources.list.d/php.list

System repo update

sudo apt update

Run the commands below to add the below third party repository to upgrade to PHP 7.1

apt install php7.1 php7.1-common php7.1-mbstring php7.1-xmlrpc php7.1-soap php7.1-gd php7.1-xml php7.1-intl php7.1-mysql php7.1-cli php7.1-mcrypt php7.1-ldap php7.1-zip php7.1-curl

After install PHP, run the commands below to open FPM PHP default file.

sudo nano /etc/php/7.1/apache2/php.ini

Then make the change the following lines below in the file and save.

 file_uploads = On
 allow_url_fopen = On
 memory_limit = 256M
 upload_max_filesize = 100M
 date.timezone = America/Chicago

Step 4: Installing and Configuring MariaDB 

OrangeHRM also requires a database server. and We are going to use MariaDB database server. it is a great place to start. To install it run the commands below.

sudo apt-get install mariadb-server mariadb-client

After installing, Check database server status with following
service mysql status

By default MariaDB is not secured, so you will need to secure it. You can secure it by running the mysql_secure_installation script.

sudo mysql_secure_installation

When prompted, answer the questions below by following the guide.
  •  Enter current password for root (enter for none): Just press the Enter
  •  Set root password? [Y/n]: Y
  •  New password: Enter password
  •  Re-enter new password:
  •  Repeat password Remove anonymous users? [Y/n]: Y
  •  Disallow root login remotely? [Y/n]: Y
  •  Remove test database and access to it? [Y/n]: Y
  •  Reload privilege tables now? [Y/n]: Y

Create OrangeHRM Database

Now We have install all the packages that are required, First let's create a OrangeHRM database.

Run the commands below to logon to the database server. When prompted for a password, type the root password you created above.

sudo mysql -u root -p

  • Then create a database called orangehrm

 CREATE DATABASE orangehrm;

  •  Create a database user called orangehrmuser with new password

 CREATE USER 'orangehrmuser'@'localhost' IDENTIFIED BY 'new_password_here'; 

  •  Then grant the user full access to the database.

 GRANT ALL ON orangehrm.* TO 'orangehrmuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION; 

  •  Finally, save your changes and exit.

FLUSH PRIVILEGES;
EXIT;



Step 5: Download OrangeHRM Latest

Release visit OrangeHRM site and download the latest version. First we download it to know where we curentlly located to know current place with " pwd " or "ls -l " then We unzip it and move folder to /var/www/html/

wget https://excellmedia.dl.sourceforge.net/project/orangehrm/stable/4.0/orangehrm-4.0.zip
unzip orangehrm-4.0.zip
sudo mv orangehrm-4.0 /var/www/html/orangehrm

After Complete file download & move it in to Web Dir we need to set current user access & permission

sudo chown -R www-data:www-data /var/www/html/orangehrm/
sudo chmod -R 755 /var/www/html/orangehrm/

Configure Apache2 Finally,

configure Apahce2 site configuration file for OrangeHRM. This file will control how users access OrangeHRM content. Run the commands below to create a new configuration file called orangehrm.conf

sudo nano /etc/apache2/sites-available/orangehrm.conf


Then copy and paste the content below into the file and save it. Replace the highlighted line with your own domain name and directory root location.

<VirtualHost *:80>

     ServerAdmin admin@example.com
     DocumentRoot /var/www/html/orangehrm
     ServerName example.com
     ServerAlias www.example.com

     <Directory /var/www/html/orangehrm/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined

</VirtualHost>
Save (crtl + x )the file and exit(press y enter).
After configuring the VirtualHost above, enable it by running the commands below 
sudo a2ensite orangehrm.conf sudo a2enmod rewrite
Restart Apache2 Web Server 
To load all the settings above, restart Apache2 by running the commands below.
sudo service apache2 restart
Then open your browser and browse to the server domain name followed by install. You should see Concrete setup wizard to complete. Please follow the wizard carefully.
http://example.com or server IP
Then follow the on-screen instructions until you’ve successfully installed OrangeHRM.
if there any firewall then you must allow port 80 open 

Now, open your favorite web browser and access the URL http://yourdomain.com, you will be redirected to the OrangeHRM web installation wizard as shown in below image.



Click on the "Next" button. You should see the License agreement in below image



Now, click on the "I Accept" button. You should see the following page.


Enter your database configuration information such as Database Host (127.0.0.1), Database Port, Database Name, Username, and Password. Then click on the "Next" button. You should see the following page.


Make sure all of the system check items are green. Then Click on the "Next" button. You should see the following page.


Provide your admin user details like admin username and password. Then click on the "Next" button. You should see the following page.


Now, confirm all the details which you have provided earlier. Then click on the "Install" button. Once the installation is completed, you should see the following page. This should be all done .if there any error or fail then we may need to go web server log and orange hrm  log files



Provide your company name and click on the "Finish" button, you should see the OrangeHRM login page in below image. Provide your admin credentials and click on the "Login" button, you should see the OrangeHRM Dashboard



 OrangeHRM install errors
Here is the solution to orange hrm database connection  Error 
In step 6 if there install aborted due to an error "unable to create Database"



Solution to OrangeHRM install errors unable to create database 

OrangeHRM install errors

to pass this issue you guys can use "localhost ip address (127.0.0.1) "as Database host name In step 2  and process will be going smoothly



Contact me for any issue or connect it I'm open for work 24/7 

Email : darshanavkapuge@gmail.com
Skype : darshana.kapuge
Mobile : +94714617222

Setup OrangeHRM on Debian 9 stretch or Ubuntu 16.04 LTS with Apache2, MariaDB and PHP 7.1 Support Setup OrangeHRM on Debian 9 stretch or Ubuntu 16.04 LTS with Apache2, MariaDB and PHP 7.1 Support Reviewed by danrox on August 25, 2018 Rating: 5

No comments:

Setup OrangeHRM on Debian 9 stretch or Ubuntu 16.04 LTS with Apache2, MariaDB and PHP 7.1 Support

Setup OrangeHRM on Debian 9 or Ubuntu 16.04 LTS with Apache2, MariaDB and PHP 7.1 Support OrangeHRM Open Source is a free and open sou...

Powered by Blogger.