How to Install WebERP On Ubuntu 16.04

Kick-start your open source projects with access to hundreds of frameworks

WebERP a complete web based accounting and business management tool that can be used for online shop or a retail management system released under an OpenSource license. It is available in many languages and supports all popular operating systems including, Linux, Mac, and Windows. WebERP comes with a wide range of features like Purchase Orders, Sales orders, Manufacturing, Low foot-print, fast, simple code, Sales Analysis, PDF reports, Fully utf-8 compliant, Multi-currency support, Multiple themes and much more.

In this tutorial, I will show you step by step to install WebERP on Ubuntu 16.04 server.

Requirements

  • A fresh Ubuntu 16.04 server installed on your system.
  • A non-root user with sudo privileges is setup on your server.

Getting Started

Let’s start by updating your system packages with the latest version with the following command:

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

After your system is fully updated, restart the system to apply all these changes.

Install LAMP Server

WebERP runs on Apache, written in PHP and uses MySQL for storing the database. So you will need to install Apache, PHP, and MariaDB to your system.

First, install Apache, PHP and required PHP libraries with the following command:

sudo apt-get install apache2, php7.0 php7.0-cli php7.0-mysql php7.0-gd php7.0-mcrypt php7.0-json php-pear -y

Once the installation is complete, start Apache service and enable it to start on boot with the following command:

sudo systemctl start apache2
sudo systemctl enable apache2

By default, the latest version of the MariaDB is not available in Ubuntu 16.04. So you will need to add MariaDB repository to your system.

You can do this by running the following command:

sudo apt-get install software-properties-common -y
sudo apt-key adv –recv-keys –keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository ‘deb [arch=amd64,i386,ppc64el] http://www.ftp.saix.net/DB/mariadb/repo/10.1/ubuntu xenial main’

Next, update the repository and install MariaDB server with the following command:

sudo apt-get update -y
sudo apt-get install mariadb-server mariadb-client -y

Once the installation is complete, start MariaDB service and enable it to start on boot with the following command:

sudo systemctl start mysql
sudo systemctl enable mysql

Configure MariaDB

Next, you will need to secure MariaDB installation. You can do this by running the following script:

sudo mysql_secure_installation

The above script will set the root password, remove anonymous users, disallow remote root login and remove test database.

Once the MariaDB is secured, login to MySQL console and create a database for WebERP:

mysql -u root -p

Enter your root password and create a database as per your need:

MariaDB [(none)]CREATE DATABASE weberp_db;

Next, create a username and password for WebERP with the following command:

MariaDB [(none)]CREATE USER ‘weberp’@’localhost’ IDENTIFIED BY ‘password’;

Next, grant privileges to the weberp database with the following command:

MariaDB [(none)]GRANT ALL PRIVILEGES ON weberp_db.* TO ‘weberp’@’localhost’;

Next, flush the privileges with the following command:

MariaDB [(none)]flush privileges;

Finally close the MySQL console:

MariaDB [(none)]exit;

Download WebERP

You can download the latest version of the WebERP from their official website with the wget command as shown below:

wget https://excellmedia.dl.sourceforge.net/project/web-erp/webERP4.14.1.zip

After downloading WebERP, extract the downloaded source with the unzip command:

unzip webERP4.14.1.zip

Next, copy the extracted directory to the Apache web root directory:

sudo cp -r webERP /var/www/html/weberp

Next, change the ownership of the weberp directory:

sudo chown -R www-data:www-data /var/www/html/weberp

Configure Apache for WebERP

Next, create an apache virtual host file for WebERP:

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

Add the following lines:

VirtualHost *:80
ServerAdmin [email protected]
DocumentRoot "/var/www/html/weberp/"
ServerName yourdomain.com
ServerAlias www.yourdomain.com
Directory "/var/www/html/weberp/"
Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all
/Directory
ErrorLog /var/log/apache2/weberp-error_log
CustomLog /var/log/apache2/weberp-access_log common
/VirtualHost

Save the file when you are finished, then activate the new virtual host with the following command:

sudo a2ensite weberp

Finally, restart Apache service to reload the changes:

sudo systemctl restart apache2

Access WebERP Web Interface

WebERP runs on port 80, so you will need to allow port 80 through the firewall. First, enable the UFW firewall with the following command:

sudo ufw enable

Next, allow port 80 through the UFW firewall with the following command:

sudo ufw allow 80/tcp

You can get the status of the UFW firewall with the following command:

sudo ufw status

Once the UFW firewall is configured, open your web browser and type the URL http://yourdomain.com, you will be redirected to the WebERP welcome page as shown below:

WebERP install wizard

Select your language and click on the NEXT STEP button, you should see the WebERP database configuration page in below image:

Database configuration

Provide all the information like, host, database name, database username, and password, then click on the NEXT button. You should see the WebERP installation wizard in the below image:

company settings

administrator settings

Now, provide required details like Company name, Time zone, Admin account username, password, E-mail address, then click on the INSTALL button. You should see the WebERP login screen in below image:

Login

Now, provide your Admin username and password, then click on the Login button. You should see the WebERP dashboard in the following image:

WebERP Dashboard

Now start using WebERP.

 

Install and Configure Kolab Groupware on Ubuntu 16.04 LTS

Kolab is an Open source web-based groupware software application that provides solutions for an email server, directory service, web service, Calendar, Task, address books and more. Kolab supports several clients including, outlook, KDE Contact, Thunderbird, and Roundcube. Kolab provides user-friendly and easy to use web interface that can be used to add, modify and delete users, domains, shared folders and much more.

Kolab comes with lots of features, some of them are listed below:

  • Provide support for mixed-client environments like outlook, web, and KDE.
  • Uses IMAP and POP3 for email and LDAP for storing configuration data.
  • Provide support for shared contacts and calendars.
  • Full server-side support for CardDAV and WebDAV, ActiveSync and CalDAV.

Requirements

  • A server running Ubuntu 16.04.
  • A non-root user with sudo privileges setup on your server.
  • A static IP 192.168.0.190 setup on your server.

Getting Started

Before starting, you will need to set up Fully Qualified Domain Name or hostname to your system. You can do this by editing /etc/hosts and /etc/hostname file:

sudo nano /etc/hosts

Add the IP address and hostname at the end of the file:

192.168.0.190 mail.kolab.com mail

Save and close the file, then edit /etc/hostname file:

sudo nano /etc/hostname

Add the following line:

mail.kolab.com

Save the file when you are finished, then restart your system to apply all the changes.

Install MariaDB

Before installing Kolab, you will need to install the latest version of the MariaDB in your server. By default, MariaDB is not available in Ubuntu 16.04 default repository. So, first download the APT key for MariaDB with the following command:

sudo apt-key adv –recv-keys –keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8

Next, add the Maria-DB repository with the following command:

sudo add-apt-repository ‘deb [arch=amd64,i386,ppc64el] http://mirror.jmu.edu/pub/mariadb/repo/10.1/ubuntu xenial main’

Next, update the repository and install MariaDB with the following command:

sudo apt-get update -y
sudo apt-get install mariadb-server -y

Once MariaDB is installed, start MariaDB service and enable it to start on boot time with the following command:

sudo systemctl start mysql
sudo systemctl enable mysql

Next, secure the MariaDB installation by running the following script:

sudo mysql_secure_installation

Answer all the questions as shown below:

Enter current password for root (enter for none):
Change the root password? [Y/n] n
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

Once MariaDB is secured, you can proceed to the next step.

Install Kolab

By default, Kolab is not available in Ubuntu 16.04 default repository. So you will need to add the Kolab repository to the APT. You can do this by editing /etc/apt/sources.list file:

sudo nano /etc/apt/sources.list

Add the following lines at the end of the file:

deb http://obs.kolabsys.com/repositories/Kolab:/16/Ubuntu_16.04/ ./
deb-src http://obs.kolabsys.com/repositories/Kolab:/16/Ubuntu_16.04/ ./

Save and close the file, then Import the GPG key used to sign the packages:

wget -q -O- https://ssl.kolabsys.com/community.asc | sudo apt-key add –

Next, you will need to ensure the Kolab packages have priority over the Ubuntu packages. You can do this by creating /etc/apt/preferences.d/kolab file:

sudo nano /etc/apt/preferences.d/kolab

Add the following lines:

Package: *
Pin: origin obs.kolabsys.com
Pin-Priority: 501

Save the file and update the repository metadata with the following command:

sudo apt-get update -y

Finally, install Kolab by just running the following command:

sudo apt-get install kolab -y

Configure Kolab

After installing Kolab, you will need to setup Kolab Groupware. You can do this by running the following command:

sudo setup-kolab

During the Kolab setup, you will be asked the following questions, please follow the instructions provided along with them.

#Please supply a password for the LDAP administrator user 'admin', used to login to the graphical console of 389 Directory server.

Administrator password [JAOw_2oIhlezXlK]: 
Confirm Administrator password: 

#Please supply a password for the LDAP Directory Manager user, which is the administrator user you will be using to at least initially log in to the Web
#Admin, and that Kolab uses to perform administrative tasks.

Directory Manager password [QXML8Suxv-YTUFr]: 
Confirm Directory Manager password: 

#Please choose the system user and group the service should use to run under. These should be existing, unprivileged, local system POSIX accounts with no shell.

User [dirsrv]: 
Group [dirsrv]: 

#This setup procedure plans to set up Kolab Groupware for the following domain name space. This domain name is obtained from the reverse DNS entry on your
#network interface. Please confirm this is the appropriate domain name space.

kolab.com [Y/n]: Y

#The standard root dn we composed for you follows. Please confirm this is the root dn you wish to use.

dc=kolab,dc=com [Y/n]: Y

#Setup is now going to set up the 389 Directory Server. This may take a little while (during which period there is no output and no progress indication).

Created symlink from /etc/systemd/system/multi-user.target.wants/dirsrv.target to /lib/systemd/system/dirsrv.target.

#Please supply a Cyrus Administrator password. This password is used by Kolab to execute administrative tasks in Cyrus IMAP. You may also need the password
#yourself to troubleshoot Cyrus IMAP and/or perform other administrative tasks against Cyrus IMAP directly.

Cyrus Administrator password [h3IbKvhbKGUwhy5]: 
Confirm Cyrus Administrator password: 

#Please supply a Kolab Service account password. This account is used by various services such as Postfix, and Roundcube, as anonymous binds to the LDAP server
#will not be allowed.

Kolab Service password [KhHTzhSYh4w11Vw]: 
Confirm Kolab Service password: 

What MySQL server are we setting up?
 - 1: Existing MySQL server (with root password already set).
 - 2: New MySQL server (needs to be initialized).
Choice:  - 1: Existing MySQL server (with root password already set).
 - 2: New MySQL server (needs to be initialized).
Choice:  - 1: Existing MySQL server (with root password already set).
 - 2: New MySQL server (needs to be initialized).
Choice: 2

#Please supply the root password for MySQL, so we can set up user accounts for other components that use MySQL.

MySQL root password: 

#Please supply a password for the MySQL user 'kolab'. This password will be used by Kolab services, such as the Web Administration Panel.

MySQL kolab password [2-Zz7j_AjGI8QF0]: 
Confirm MySQL kolab password: 

#Please supply the timezone PHP should be using. You have to use a Continent or Country / City locality name like 'Europe/Berlin', but not just 'CEST'.

Timezone ID [UTC]: Asia/Kolkata

#Please supply a password for the MySQL user 'roundcube'. This password will be used by the Roundcube webmail interface.

MySQL roundcube password [OVwJoKktzbOMAys]: 
Confirm MySQL roundcube password: 

Once the Kolab setup is complete, you can proceed to access Kolab web interface.

Access Kolab Web Interface

Open your web browser and type the URL http://mail.kolab.com/kolab-webadmin or http://192.168.0.190/kolab-webadmin. You will be redirected to the Kolab login page as shown below:

Kolab Web Admin

Provide username as cn=Directory Manager and password that you set in above step. Then click on the Login button. You should see the following screen:

Kolab admin dashboard

Next, Click on Users Icon in Web Interface and create a mail user as shown below:

Add user

Next, click on the Contact Tab to verify the user id:

contact management

Next, click on the System tab to set email user password:

Email user

Next, click on the Configuration tab to set the email Quota for user:

Email quota

Access Roundcube Webmail

Now, your mail user is created, it’s time to access your mail through Rouncube webmail.

Open your web browser and type the URL http://mail.kolab.com/roundcubemail. You should see the following screen:

RoundCube Webmail

Provide username as your primary email id and password that you set in above step. Then click on the Login button. You should see the Roundcube web interface in the following screen:

Kolab web client

Using this interface, you can easily access and send the email, manage address book, calendar, and tasks.

Congratulations! You have successfully installed Kolab Groupware on Ubuntu 16.04 server. You can now easily send and receive emails, manage contacts, task and address book.

v

Data Recovery Techniques on Linux

Data Recovery Techniques on Linux

When one of my friends called telling me that he had accidentally deleted some important files from his drive, his exasperation was understandable. It happens to everyone at some point of their computer-using lives. Unfortunately, in his case, those were some extremely important documents that, had he not recovered them, could have proven very costly.

Fortunately, I managed to guide him through the process of recovery, and now, I’m going to guide you too.

What happens when a file is deleted?

Data stored in files has a table of contents which indicates the storage location for each file on the drive. When we remove or delete a file the file goes into the trash. Files removed using rm command can be easily recovered.

Removal/Deletion of a file leads to the removal of only of the table of contents. This states that now the space from which the file is removed is ready for new data to be stored; so while in the case of new data having been written over that space the recovery of the old data becomes difficult. But, if there is no new data written there, we can still recover it.

First, let’s go through a few Dos and Don’ts .

DO’s and Don’ts when a file is lost

Don’ts:

  • Do not write any data on the device.
  • Do not mount or use any random recovery software
  • Do not use any software to recover the data if you don’t have a complete understanding of it.

Do’s:

  • Shutdown the system immediately.
  • Reboot the system with a CD or with a live version of Linux running on a thumb device.
  • Do use the below mentioned tools.

There are various tools which can be used for data-recovery.

Here are some trusted tools that can be used:

  • Extundelete
  • PhotoRec

Extundelete Utility:

The extundelete utility is used for the recovery of an ext3 and ext4 linux partition. The utility uses the information stored in the partition journal to recover the data.

Recovering the File :

Prerequisites : Install the binary and development packages for e2fsprogs and e2fslibs.

Download the latest version of extundelete.

Copy the package to the /opt .

tar –zxjf extundelete-version.tar.bz2
cd extundelete-version
./configure
make install

  • Steps how to use extundelete to recover a file :
  1. We need to recover a file /home/jack/important/file1.
  2. The output of the mount command shows the below output.

/dev/sda4 on /home type ext3 (rw)

  1. Now use the command as below

umount /dev/sda4

  1. Now run the below extundelete command as follows.

extundelete /dev/sda4 –restore-file jack/important/file1

PhotoRec Sotware :-

This software is used to restore files with extensions such as ZIP, Office, PDF, HTML, JPEG and 390 other file extensions. Photorec completely ignores the partition but it does focus on the underlying data. This states that it does work even if the device has been damaged . It works only with read only access.

While using photorec you may restore the data at the following locations.

  • Recovering files to a separate hard-drive.
  • Recovering data to a network drive
  • Recovering data to a separate partition on the same hard drive.

Installation of the PhotoRec Software:

  1. Download the software from the mentioned link http://www.cgsecurity.org/wiki/TestDisk_Download
  2. Unpack the software to the directory where it has copied to .
  3. Untar the software.
  4. Use the below command to install the software

sudo ./photorec_static

This will help you launch PhotoRec and retrieve the data then.

In the end, there are many data recovery tools. Various other companies have developed tools to recover the data. But you should use them only if have a good knowledge of how they work and the process of using them.

If you are novice please do your research, or consider getting some professional help (such as in the case of my friend) so that you may not lead into any other disasters with your system. Data recovery can be dangerous, and as with anything, prevention is the best cure ? so back-up!