How To Install PostgreSQL on Ubuntu 16.04

Install PostgreSQL on Ubuntu 16

PostgreSQL is a free, open-source object-relational database management system (object-RDBMS), similar to MySQL, and is standards-compliant and extensible. It is commonly used as a back-end for web and mobile applications. PostgreSQL, or ‘Postgres’ as it is nicknamed, adopts the ANSI/ISO SQL standards together, with the revisions.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation PostgreSQL on a Ubuntu 16.04 (Xenial Xerus) server.

Install PostgreSQL on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing PostgreSQL server.

PostgreSQL is available in the default repositories. So enter the following command from the Terminal to install it:

apt-get install postgresql postgresql-contrib phppgadmin

Step 3. Access PostgreSQL command prompt.

After installing PostgreSQL database server, by default it creates a user ‘postgres’ with role ‘postgres’. It also creates a system account with same name ‘postgres’. So to connect to postgres server, login to your system as user postgres and connect database:

su - postgres
psql

Now you are logged in to PostgreSQL database server. To check login info use following command from database command prompt:

postgres-# \conninfo

To disconnect from PostgreSQL database command prompt just type below command and press enter. It will return you back to Ubuntu command prompt:

postgres-# \q

Create new user and database:

### For example, let us create a new user called “wpcademy” with password “wpcademy.com”, and database called “wpcademydb”. ###
sudo -u postgres createuser -D -A -P wpcademy
sudo -u postgres createdb -O wpcademy wpcademydb

Step 4. Configure Apache2 for phpPgAdmin.

phpPgAdmin is a web-based administration tool for PostgreSQL. It is perfect for PostgreSQL DBAs, newbies, and hosting services. You need to configure apache for phpPgAdmin. Edit the file /etc/apache2/conf-available/phppgadmin.conf:

nano /etc/apache2/conf-available/phppgadmin.conf

Comment out the line #Require local by adding a # in front of the line and add below the line allow from all so that you can access from your browser:
phpPgAdmin-apache2-conf
Step 5. Configure phpPgAdmin.

Next, edit the file /etc/phppgadmin/config.inc.php:

nano /etc/phppgadmin/config.inc.php

Now change the following option:

$conf[‘extra_login_security'] = true;
to
$conf[‘extra_login_security'] = false;

Now, we can restart Apache and phpPgAdmin so that the changes take place:

systemctl restart postgresql
systemctl restart apache2
systemctl enable postgresql
systemctl enable apache2

Step 6. Accessing phpPgAdmin.

phpPgAdmin will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/phppgadmin or http://server-ip/phppgadmin. If you are using a firewall, please open port 80 to enable access to the control panel.
phppgadmin-ubuntu-16.04

Congratulation’s! You have successfully installed PostgreSQL Server. Thanks for using this tutorial for installing PostgreSQL in Ubuntu 16.04 (Xenial Xerus) systems. For additional help or useful information, we recommend you to check the official PostgreSQL web site.

How To Install Node.js on Ubuntu 16.04

Install Node.js on Ubuntu 16

Node.js is a Javascript platform for programming that enables users to build network applications very quickly. If you are using Javascript on both the front-end and the back-end, it means your development can be much more consistent and be designed within the same system.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Node.js on a Ubuntu 16.04 (Xenial Xerus) server.

Install Node.js on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing Node.js using repository.

The default Ubuntu repos do contain a version of Node.js. It is never the latest version but is usually known to be quite stable:

apt-get install nodejs

This will install Node.js, however we still need to install the package manager (NPM) so that 3rd party modules can be installed:

apt-get install npm

Verify the current version of Node.js installed:

node -v

Step 3. Installing Node.js using PPA repository for Ubuntu 16.04.

First you need to node.js ppa in our system provide by nodejs official website. We also need to install python-software-properties package if not installed already:

sudo apt-get install python-software-properties
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -

After adding required PPA file, lets install Nodejs package. NPM will also be installed with node.js. This command will also install many other dependent packages on your system:

apt-get install nodejs

Verify the current version of Node.js installed:

node -v

Step 4. Install Node.js using NVM (Node.js Version Manager).

Using nvm, you will be able to install multiple, self-contained versions of Node.js which will means you can control your environment much easier. It will give you on-demand access to the latest versions of Node.js, but it will also allow you to specify previous releases that your app may need. So, first we’ll want to update our local repository index and then install libssl-dev and build-essential . That can be done by running the below commands in a terminal or shell:

apt-get update
apt-get install build-essential libssl-dev

Once those are installed you need to download the setup script for NVM. Typically you can grab this from their github page. Though at the time of this writing the newest version is in the command below:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh

Verify that the script is indeed the one you want and then run:

bash install.sh

To begin the install of NVM. Once it finishes you will need to reload your profile to have your changes take effect without logging back in to your server again. Run the command:

source ~/.profile

Now as we have nvm installed, we can install isolated Node.js versions. To find out the versions of Node.js that are available for installation, we need to type:

[[email protected] ~]# nvm ls-remote
. . .
v5.8.0
v5.9.0
v5.9.1
v5.10.0
v5.10.1
v5.11.0
v6.0.0

Install the version you want with the command:

nvm install [your version]

Example:

nvm install 6.0.0

Configure nvm to use the version of Node.js that you just downloaded, the command is:

nvm use 6.0.0

To verify the current version of Node.js installed, the command is:

node -v

Congratulation’s! You have successfully installed Node.js. Thanks for using this tutorial for installing Node.js in Ubuntu 16.04 Xenial Xerus LTS system. For additional help or useful information, we recommend you to check the official Node.js web site.

How To Install OpenCart on Ubuntu 16.04

Install OpenCart on Ubuntu 16

OpenCart is a free open source ecommerce platform for online merchants. OpenCart provides a professional and reliable foundation from which to build a successful online store.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation OpenCart on a Ubuntu 16.04 (Xenial Xerus) server.

Install OpenCart on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB, PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 <code>php7.0-mcrypt
</code>

Step 3. Installing OpenCart.

First thing to do is to go to OpenCart’s download page and download the latest stable version of OpenCart, At the moment of writing this article it is version 2.3.0.2:

wget https://github.com/opencart/opencart/archive/2.3.0.2.zip
unzip 2.3.0.2.zip
mv opencart-2.3.0.2/upload/* /var/www/html/

Rename the file ‘config-dist.php’ to ‘config.php’:

mv config-dist.php config.php

We will need to change some folders permissions:

chown -R www-data.www-data /var/www/html
chmod -R 755 /var/www/html

Step 4. Configuring MariaDB for OpenCart.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- 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

Next we will need to log in to the MariaDB console and create a database for the OpenCart. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for OpenCart installation:

MariaDB [(none)]&gt; CREATE DATABASE opencart;
MariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON opencart.* TO 'opencartuser'@'localhost' IDENTIFIED BY 'opencartuser_passwd';
MariaDB [(none)]&gt; FLUSH PRIVILEGES;
MariaDB [(none)]&gt; \q

Step 5. Accessing OpenCart.

OpenCart will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://your-domain.com/ or http://server-ip and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed OpenCart. Thanks for using this tutorial for installing OpenCart e-commerce on Ubuntu 16.04 systems. For additional help or useful information, we recommend you to check the official OpenCart website.

How To Install Tor Browser on Ubuntu 16.04

Install Tor Browser on Ubuntu 16

Tor is free software and an open network that helps you defend against traffic analysis, a form of network surveillance that threatens personal freedom and privacy, confidential business activities and relationships, and state security. Tor protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world. it prevents somebody watching your Internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Tor Browser on a Ubuntu 16.04 (Xenial Xerus) server.

Install Tor Browser on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Intsalling Tor Browser.

Run the following commands in Terminal to install Tor Browser on Linux Ubuntu systems, via Webupd8 PPA:

sudo add-apt-repository ppa:webupd8team/tor-browser
sudo apt-get update
sudo apt-get install tor-browser

Once installed, open Tor from Ubuntu Dash or Terminal. Execute the start-tor-browser.desktop file in a terminal:

./start-tor-browser.desktop

This will launch Tor browser network setting. From here you can either configure or connect to Tor network. Click on connect button to enable Tor connection. Tor browser will then connect to the most secure connection. Once it’s done you can see “Welcome to Tor Browser” message.

Congratulation’s! You have successfully installed Tor Browser. Thanks for using this tutorial for installing Tor Browser on your Ubuntu 16.04 (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official Tor Browser web site.

How To Install Vsftpd on Ubuntu 16.04

Install Vsftpd on Ubuntu 16

FTP stands for “file transfer protocol”, and it allows you to transfer files to a remote computer. The most common FTP server software for Ubuntu is the vsftpd package, which stands for “very secure FTP daemon.” It’s the default FTP package for Ubuntu, and most other Linux distributions as well.

Features:

Despite being small for purposes of speed and security, many more complicated FTP setups are achievable with vsftpd! By no means an exclusive list, vsftpd will handle:

  • Virtual IP configurations
  • Virtual users
  • Standalone or inetd operation
  • Powerful per-user configurability
  • Bandwidth throttling
  • Per-source-IP configurability
  • Per-source-IP limits
  • IPv6
  • Encryption support through SSL integration
  • etc…

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation OpenLiteSpeed on a Ubuntu 16.04 (Xenial Xerus) server.

Install Vsftpd on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Installing VSFTPD.

To install VSFTPD, run the following command from your Terminal:

apt-get install vsftpd

Step 3. Configure VSFTPD.

After it is successfully installed, Let us go ahead and configure:

### nano /etc/vsftpd.conf

Controls whether anonymous logins are permitted or not.
anonymous_enable=NO

# Allow local users to login
local_enable=YES

# Set 'write_enable' to YES in order to allow changes to the filesystem
write_enable=YES

# to enable ASCII uploads (to prevent uploaded scripts etc. from breaking),
# without the DoS risk of SIZE and ASCII downloads. ASCII mangling should be
# on the client anyway..
ascii_upload_enable=YES
ascii_download_enable=YES

# You can set the root directory of the FTP users. if not specified, users' home directory equals FTP home directory
local_root=public_html

Save and close the file. Restart vsftpd service to take effect the changes:

sudo systemctl restart vsftpd
sudo systemctl enable vsftpd

Check if vsftpd service is running or not using command:

sudo systemctl status vsftpd

Sample output:

vsftpd.service - vsftpd FTP server
Loaded: loaded (/lib/systemd/system/vsftpd.service; enabled; vend
Active: active (running) since Thu 2016-08-16 17:28:31 IST; 31s a
Process: 2040 ExecStartPre=/bin/mkdir -p /var/run/vsftpd/empty (co
Main PID: 2043 (vsftpd)
Tasks: 1
Memory: 492.0K
CPU: 46ms
CGroup: /system.slice/vsftpd.service
└─2043 /usr/sbin/vsftpd /etc/vsftpd.conf

Aug 16 17:28:31 ubuntuserver systemd[1]: Starting vsftpd FTP server.
Aug 16 17:28:31 ubuntuserver systemd[1]: Started vsftpd FTP server.

Congratulation’s! You have successfully installed vsftpd. Thanks for using this tutorial for installing vsftpd in Ubuntu 16.04 (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official vsftpd web site.

How To Install OpenLiteSpeed on Ubuntu 16.04

Install OpenLiteSpeed on Ubuntu 16

OpenLiteSpeed is an open source HTTP server developed by LiteSpeed Technologies. OpenLiteSpeed is a high performance and lightweight HTTP server which comes with a Web Gui administration interface. As far as Linux web servers are concerned, OpenLiteSpeed has some interesting features that make it a solid choice for many installations. It features Apache compatible rewrite rules, a web administration interface, and customized PHP processing optimized for the server.

Features:

Event-Driven Architecture
Fewer processes, less overhead, and enormous scalability. Keep your existing hardware.

Understands Apache Rewrite Rules
OpenLiteSpeed is mod_rewrite compatible, with no new syntax to learn. Continue to use your existing rewrite rules.

Friendly Admin Interfaces
OLS comes with a built-in WebAdmin GUI. Control panel support is available with CyberPanel.

Built for Speed and Security
Features Anti-DDoS connection and bandwidth throttling, ModSecurity v3 integration, and more.

Intelligent Cache Acceleration
Built-in full-page cache module is highly-customizable and efficient for an exceptional user experience.

PageSpeed Optimization
Automatically implement Google’s PageSpeed optimization system with the mod_pagespeed module.

PHP LiteSpeed SAPI
Native SAPI for PHP allows external applications written in PHP to run up to 50% faster.

One-Click Installation
Install OpenLiteSpeed, MariaDB and WordPress on various operating systems with just one click.

WordPress Acceleration
Experience a measurable performance boost with OpenLiteSpeed and LSCache for WordPress.

 

To complete this tutorial you will need an Ubuntu 16.04 server with a sudo-enabled, non-root user.

Install OpenLiteSpeed on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Preparing your server, you need to install the following packages:

apt-get install build-essential libexpat1-dev libgeoip-dev libpng-dev libpcre3-dev libssl-dev libxml2-dev rcs zlib1g-dev

Step 2. Installing OpenLitespeed.

First thing to do is to go to OpenLitespeed’s download page and download the latest stable version of OpenLitespeed, At the moment of writing this article it is version 1.4.21:

wget http://open.litespeedtech.com/packages/openlitespeed-1.4.21.tgz

Unpack the OpenLitespeed archive to the document root directory on your server:

tar xzvf openlitespeed*
cd openlitespeed*

Then use the following command to configure the software and to compile it, This will install the entire OpenLiteSpeed system under the /usr/local/lsws location:

sudo ./configure
sudo make
sudo make install

Step 3. Configuring MariaDB for OpenLiteSpeed.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB.

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- 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

Step 4. Configure OpenLiteSpeed web server.

OpenLiteSpeed has an Admin Gui for management, so we will configure the admin password for the openLiteSpeed GUI, We will start by changing the administrative password using the following command:

sudo /usr/local/lsws/admin/misc/admpass.sh

You will be asked to optionally provide a username for the administrative user. If you just press ENTER, the username “admin” will be selected. Afterwards, you will be asked to select and confirm a new password for the account.

After changing the password and the username use the following command to start the web server:

sudo service lsws start

Step 5. Accessing OpenLiteSpeed.

OpenLiteSpeed will be available on HTTP port 8080 by default and admin login using port 7080. Open your favorite browser and navigate to http://yourdomain.com:8080 or https://server-ip:7080 and complete the required the steps to finish the installation. If you are using a firewall, please open port 7080 and 8080 to enable access to the control panel.

Congratulation’s! You have successfully installed OpenLiteSpeed. Thanks for using this tutorial for installing OpenLiteSpeed web server on your Ubuntu 16.04 (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official OpenLiteSpeed web site.

How To Install X2CRM on Ubuntu 16.04

Install X2CRM on Ubuntu 16

X2CRM is an open source marketing, sales, and customer service CRM application powered by an easy to use workflow engine and process management framework. Manage your clients with an endlessly customizable, powerful app, and boost your productivity like never before.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation X2CRM on a Ubuntu 16.04 (Xenial Xerus) server.

Install X2CRM on Ubuntu 16.04

Step 1. First make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.

sudo apt-get update
sudo apt-get upgrade

Step 2. Install LAMP (Linux, Apache, MariaDB and PHP) server.

A Ubuntu 16.04 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install all required PHP modules:

apt-get install php7.0-mysql php7.0-curl php7.0-json php7.0-cgi php7.0 libapache2-mod-php7.0 <code>php7.0-mcrypt php7.0-gd
</code>

Step 3. Installing X2CRM.

First thing to do is to go to X2CRM’s download page and download the latest stable version of X2CRM:

wget https://github.com/X2Engine/X2Engine/archive/master.zip

Unpack the Bludit archive to the document root directory on your server:

unzip master.zip
mv X2CRM-master/x2engine/ /var/www/html/x2cr

Set the file permissions for Bludit CMS:

chown -R www-data:www-data /var/www/html/x2crm/

Step 4. Configuring MariaDB for X2CRM.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- 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

Next we will need to log in to the MariaDB console and create a database for the X2CRM. Run the following command:

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for X2CRM installation:

MariaDB [(none)]&gt; CREATE DATABASE x2crm;
MariaDB [(none)]&gt; GRANT ALL PRIVILEGES ON x2crm.* TO 'x2crmuser'@'localhost' IDENTIFIED BY 'your-password';
MariaDB [(none)]&gt; FLUSH PRIVILEGES;
MariaDB [(none)]&gt; \q

Step 5. Configuring Apache web server for X2CRM.

Create a new virtual host directive in Apache. For example, create a new Apache configuration file named ‘x2crm.conf’ on your virtual server:

sudo a2enmod rewrite
touch /etc/apache2/sites-available/x2crm.conf
ln -s /etc/apache2/sites-available/x2crm.conf /etc/apache2/sites-enabled/x2crm.conf
nano /etc/apache2/sites-available/x2crm.conf

Add the following lines:

ServerAdmin [email protected]
DocumentRoot /var/www/html/x2crm/
ServerName your-domain.com
ServerAlias www.your-domain.com

Options FollowSymLinks
AllowOverride All
Order allow,deny
allow from all

ErrorLog /var/log/apache2/your-domain.com-error_log
CustomLog /var/log/apache2/your-domain.com-access_log common

Now, we can restart Apache web server so that the changes take place:

systemctl restart apache2.service

Step 6. Accessing X2CRM.

X2CRM will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://yourdomain.com/ or http://server-ip/ and complete the required the steps to finish the installation. If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulation’s! You have successfully installed X2CRM. Thanks for using this tutorial for installing X2CRM on your Ubuntu 16.04 (Xenial Xerus) system. For additional help or useful information, we recommend you to check the official X2CRM web site.