How to Configure and Deploy CloudLinux’s Node.js Selector

Why Node.js for CloudLinux?

In the last few years, the stability and ease of use of Node.js has lead to heavy adoption in application development.  However, deploying and configuring a Node.js application to work with cPanel presents a number of hurdles. CloudLinux’s recently released Node.js Selector is a great solution that includes a graphical interface to make deployment go more smoothly. To use this utility, you will need to have CloudLinux installed along with the LVE Manager plugin. In this configuration, your Node.js application will also benefit from the resource usage monitoring that comes with the CloudLinux LVE Manager.

Step 1 – Installation of Phusion Passenger

We’ll need to enable Phusion Passenger for EasyApache. In Web Host Manager, navigate to EasyApache.  From there, in the upper left corner of the screen type in “EasyApache 4”.  Select “Customize” in the menu that follows and then “Apache Modules”. In the list of Apache modules searching for “Passenger” will bring up the option to install mod-alt-passenger as shown below:

After selecting mod-alt-passenger, all that needs to be done is to skip to the “Review” step on the left sidebar and click “Provision” on the review menu to apply the changes.

Step 2 – Installation of CloudLinux Node.js Selector

To start the installation of Node.js Selector for your users, proceed to the LVE Manager page in Web Host Manager. Under the Options tab, click on the Node.js line to expand the section containing the install menu for the various Node.js versions:

Only the Node.js versions installed here will be available for each cPanel user. So for each Node.js version, first click “Install” to put in place the needed packages. Then, select the “Enable” switch for each version of Node to make it available. Once each version you would like to use is installed and enabled, be sure to also enable the overall toggle switch where it says “Node.js” to make the system available for your users.

 Post-installation,  with everything in place, the install menu should look like this:

Step 3 – Web Host Manager (WHM) Configuration:

At this point, you’ll have the LVE Manager configured, as well as Node.js setup for your cPanel users. However, the default cPanel memory limit is sometimes insufficient to install Node.js packages using NPM.  It is recommended to increase this memory limit to avoid issues during deployment. To make the change in WHM, proceed to the “Tweak Settings” page, and search for “Max cPanel process memory”.  Increase this from the default of 768MB to at least 1024MB to avoid issues with the NPM installer.  This setting does not affect the memory allocated to a Node.js application, but it does allow for the initial installation of Node.js packages to make use of additional memory needed for dependency resolution. Once the change is made, the Tweak Settings page will show the updated limit in the System section:

Step 4 – Version Control with Git

Before we can configure your Node.js application, the first step is getting that application on your server. There are a few options. You can use FTP to upload the copy of your application to your server, or you can use cPanel’s native Git support to clone the repository onto your server and deploy from there. Either method meets the requirement to get the application onto the server. In this example, we’ll be using cPanel’s native Git support to clone the application onto your server and then deploy it.

Within the cPanel user account that you’d like to host the application on, under the “Files” tab, select the “Git Version Control” option. This will bring you to a page where you can create a Git repository. In this example, we’ll be using the https://github.com/socketio/chat-example repository to deploy a simple chat application.

To keep your application data secure be sure not to clone or upload into the public_html folder since this makes the code itself potentially accessible from the web. CloudLinux strives to keep your data safe, and during deployment, it’s not a requirement that your application data be publicly accessible.

Here’s an example of the Git page, before the clone is completed.

Once you click on “Create” this will bring you back to the repository page showing the full path of the application being deployed. This page is important, so save that path for later.

Step 5 – Application Configuration

With the application files in place on the server, we are ready to configure Node.js to launch that application from the web.  From cPanel on the same account under the “Software” tab, select “Setup Node.js App”. On this setup screen, you’ll select “Create Application” to bring up the options for choosing the Node.js version as well as whether to use a Development or Production environment.

Notes on Choosing Development vs. Production:
Development generally has different application hooks in the code of the application, depending on how this environment variable is set. As a general rule, Production is going to have more levels of caching, as well as minimal logging. So, for a Development environment set, you can expect the inverse, with fewer levels of application caching, and more verbose logging and error message output.

Example: In production, you may only see an error page, but in development, you may see a full stack trace on an application error, letting you know exactly where the error took place inside the code.

Here’s an example of an application that’s ready to be saved:

Node.js applications, in general, depend on several environment variables. These can be added by using the “Add Variable” button near the bottom right of the page. Your Node.js production or development variable is already set separately in the top section using the “Application Mode”, so it is not necessary to set it again in the Environment variables section.

This same menu is where you can select the version of Node.js that you’d like to use as well as the application’s startup file. This might be index.js, app.js or any number of variations; it depends on the application.

Once you’ve saved your application, you’ll need to resolve its package dependencies.  The NPM package manager does this automatically based on the package.json file packaged with the application, so all that you’ll need to do here is click on the ‘NPM Install” button.  (This step will require your domain to resolve to an IP address, or the installation script will have an error) . NPM will read the contents of the package.json file and install the needed packages into a virtual environment specific to the application.

If you are familiar with the command line, you can follow the instructions at the top of the page to gain access to the “npm” and “node” commands to make additional changes manually, allowing for a great deal of customization: 

Step 6 – Application Deployment

By this point, you’ll have your application configured and Node.js modules installed, so you’re ready to launch the application! CloudLinux makes this very easy: on the same page where you configured your application, click “Run JS Script”. This will execute the application startup file that you defined earlier during setup. As Node.js applications have several different options, this can bring up another menu with different options to select depending on the application that you’re running. In general, you’ll want to select the “Start” option next. Finally, you can select the “Open” option to visit your page, and see your application!

CloudLinux’s Node.js Selector has many advantages over manual deployment.  It allows for several different applications to be run under the same user, accessed under the “Setup Node.js App” page in your cPanel account. Phusion passenger is used for application handoffs, so you won’t need to set up any .htaccess redirects to tell the web server to forward to the applications port.  With Node.js Selector this is all handled for you.

Node.js Selector and CloudLinux do not support Litespeed’s Web server, nor NGINX at this time. As always, if you’d like to have us configure and install this software on your Liquid Web server, please open a ticket or a chat with our Heroic support team!

Install and Configure Git on Ubuntu 18.04

What is the purpose of Git?

Git gives you a way to not only track changes in source code, but it can also be used to track changes in files.  It then stores the data in what is called a repository, also known as a repo. In short, Git is a tool used as a version control system (VCS), allowing you to distribute changes from your local machine to the repo and vice versa.  In this tutorial, we’ll be instructing on how to install and configure git onto an Ubuntu 18.04 server.

 

Install Git on Ubuntu 18.04

Step 1: Update our System

This step ensures that general updates are performed on the server.

apt-get update

 

Step 2: Install Git

Install Git with the command below and proceed through the installation with y, when prompted.

apt-get install git-core

 

Step 3: Confirm Git Installation

We will be able to tell if the installation was successful by running the following command:

git --version

 

Configuring Git per User in Ubuntu 18.04

After installing Git, configurations are needed to commit messages to be sent out.  Without setting the name and email address, you’ll see warnings when making commitments to git. If you have multiple users who utilize git, create an entry for each user. You can easily set these details for a user with two commands:

git config --global user.name "Your_Name"

git config --global user.email "email_address@domain.com"

Note:
If you already have a github.com account you can use the associated username and email.

If you need to access the information set, you can find it in the .gitconfig file.

Thanks for reading our introductory article on How to Install Git.  Continue your education by reading our other Git related articles, Creating a Repo in Github and Committing/Pushing to Git.

How to Replace MySQL with Percona on Plesk CentOS 7

This article outlines the procedure for replacing the native MySQL®️ or MariaDB®️ service that is preinstalled on any typical Plesk Onyx 11 CentOS 7 server. The procedure outlines removal of the existing MySQL related binaries and replaces them with an adequate version of the Percona binaries. Once these Percona binaries are in place, a typical multistage MySQL Incremental version upgrade is processed to bring the existing databases and Percona binaries to the desired Percona 5.7 version.

Maintenance Expectations: Length & Downtime

Suggested Maintenance Duration:  90 minutes
Minimum Expected Downtime: ~30 minutes of service flapping

The expected MySQL service downtime for this procedure is less than 30 minutes of MySQL service availability going up and down repeatedly (flapping). This figure assumes that all goes smoothly and no unforeseen errors are encountered. The suggested maintenance length allows time for troubleshooting should error arise as well as an extra 30 minutes in the unlikely event that all changes need to be reverted and the maintenance plan aborted.

 

Maintenance Stages Overview

The plan is broken up into preparation tasks and stages. Preparation tasks should be completed prior to the start time of your maintenance window. Stages are conducted throughout the maintenance event window and walk through the entire procedure for accomplishing each important stage of the outline.

Preparation – Pre Maintenance Tasks

These two important tasks must be completed prior to the scheduled start time of your maintenance window:

  • Copy existing MySQL config file
  • Stage backup of MySQL database data

We use stage zero in this plan to help expedite the backup process of the MySQL data. Since the amount of data MySQL will hold varies wildly per server, it is a good practice to run an incremental backup solution, like rsync, prior to the maintenance event window. Rsync will backup the majority of static data while MySQL is still running and then will backup the incremental difference once MySQL is shut down for maintenance.

Copy existing MySQL config file:
1) Make a backup copy of the existing myself config file.

cp -pv /etc/my.cnf{,.pre-percona.bak}

Stage backup of MySQL database data:

2) Run the following rsync to clone the MySQL data. [IMPORTANT: trailing slash required]

rsync -vaH /var/lib/mysql{,.pre-percona}/

Note:
Very Large databases will take considerably longer to complete so plan accordingly.

3) Wait for step 1 to complete before starting Stage 1.

 

Stage 1 – Shutdown MySQL & Rerun Rsync Final Sync

The purpose of stage one is to ensure a pristine backup of the MySQL data is in place before proceeding. To accomplish this, it is necessary to completely stop MySQL services so all buffers are written and no additional changes are being written to the database. Once stopped, rsync is executed again to copy the differences between the now stopped pristine data and the target backup data.

1) Shutdown MySQL/MariaDB Service

systemctl stop mysql

2) Rerun the following rsync to finalize the cloned data. [IMPORTANT: trailing slash required]

rsync -vaH /var/lib/mysql{,.pre-percona}/

3) Wait for rsync to complete before moving on to Stage 3.

 

Stage 2 – Replace MariaDB 5.5 Binaries With Percona 5.5

NOTE:
MariaDB 5.5 is the version installed with Onyx 11 CentOS 7, so this is the starting point.

Replacing the existing binaries involves removing the necessary binary packages from the system using the RPM command line tool instead of yum. This allows the packages to be removed without touching any of the dependencies linking to other system packages. Since Percona, like MariaDB, is a drop-in replacement for MySQL, once the new binaries are in place the linked dependencies won’t know the difference and will function normally.

1) Remove MariaDB packages without dependencies:

rpm -e --nodeps mariadb mariadb-libs mariadb-server

2) Remove mariadb-devel package (do this as a separate command from above to avoid removal failure do to missing package)

rpm -e --nodeps mariadb-devel

3) Install Percona repository:

yum install https://www.percona.com/redir/downloads/percona-release/redhat/percona-release-0.1-4.noarch.rpm

4) Install Percona DB server:

yum install Percona-Server-client-55 Percona-Server-server-55 Percona-Server-shared-55

5) Execute the following commands (allows InnoDB plugin to load correctly)

mv /var/lib/mysql/ibdata1 /var/lib/mysql/ibdata1.bak
cp -a /var/lib/mysql/ibdata1.bak /var/lib/mysql/ibdata1
mv /var/lib/mysql/ib_logfile0 /var/lib/mysql/ib_logfile0.bak
cp -a /var/lib/mysql/ib_logfile0.bak /var/lib/mysql/ib_logfile0
mv /var/lib/mysql/ib_logfile1 /var/lib/mysql/ib_logfile1.bak
cp -a /var/lib/mysql/ib_logfile1.bak /var/lib/mysql/ib_logfile1

6) Make sure that there are no processes listening on port 3306 and kill the process if any.

netstat -tulpn | grep 3306

7) Start MySQL (now Percona 5.5)

service mysql start

8) Run mysql_upgrade script

mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`

9) [Optional]  Enable Percona XtraDB Cluster UDF from Percona Toolkit:

plesk db -e "CREATE FUNCTION fnv1a_64 RETURNS INTEGER SONAME 'libfnv1a_udf.so'"
plesk db -e "CREATE FUNCTION fnv_64 RETURNS INTEGER SONAME 'libfnv_udf.so'"
plesk db -e "CREATE FUNCTION murmur_hash RETURNS INTEGER SONAME 'libmurmur_udf.so'"

10) Restart MySQL to complete upgrade procedure

systemctl start mysql

 

Stage 3 – Switch Plesk MySQL Package over to the Plesk MySQL Community package

Running Percona on Plesk is an unsupported configuration. For this reason, to satisfy dependency connections between the Plesk MySQL package and the new Percona binaries, it is necessary to switch the Plesk MySQL release over to using the Plesk MySQL Community release instead. The change is necessary to facilitate upgrading and downgrading Percona versions.

1) Create the necessary repo config file:

printf '[PLESK_17_8_11-dist] %s\nname=PLESK_17_5_3 dist %s\nbaseurl=http://autoinstall.plesk.com/PSA_17.8.11/dist-rpm-CentOS-7-x86_64/ %s\nenabled=1 %s\ngpgcheck=1 %s\n' > /etc/yum.repos.d/plesk178.repo

2) Install “plesk-mysql-server-community” package from the new repository:

yum install plesk-mysql-server-community

3) Disable /etc/yum.repos.d/plesk178.repo file as it’s no longer needed:

mv /etc/yum.repos.d/plesk178.repo{,.disabled}

4) Remove ”plesk-mysql-server” package without touching dependencies.

rpm -e --nodeps plesk-mysql-server

 

Percona should now be installed and working on the base 5.5 version. The next stages are identical to the typical MySQL upgrade process where binaries are upgraded, and then the schema updates are made manually using the mysql_upgrade tool.

Upgrade Percona 5.5 to 5.6

1) Stop MySQL service:

service mysql stop

2) Remove Percona 55 packages without dependencies:

rpm -e --nodeps Percona-Server-shared-55 Percona-Server-client-55 Percona-Server-server-55

3) Install Percona 56 packages

yum install Percona-Server-shared-56 Percona-Server-client-56 Percona-Server-server-56

4) Make sure that there are no processes listening on port 3306 and kill the process if any.

netstat -tulpn | grep 3306

5) Start the MySQL service:

service mysql start

6) Upgrade MySQL tables:

mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`

 

Stage 4 – Upgrade Percona 5.6 to 5.7

1) Stop MySQL service:

service mysql stop

2) Remove Percona 56 packages without dependencies:

rpm -e --nodeps Percona-Server-shared-56 Percona-Server-client-56 Percona-Server-server-56

3) Install Percona 57 packages

yum install Percona-Server-shared-57 Percona-Server-client-57 Percona-Server-server-57

4)  Make sure that there are no processes listening on port 3306 and kill the process if any.

netstat -tulpn | grep 3306

5) Start the MySQL service:

service mysql start

6) Upgrade MySQL tables:

mysql_upgrade -uadmin -p`cat /etc/psa/.psa.shadow`

 

Stage 5 – Finalizing Upgrade

The system should now be running Percona 5.7 and be fully accessible by applications. At this stage, any sites or application using a database should be tested and any errors investigated.

Install Oracle Java 8 on Ubuntu 18.04

Java is a programming language used to build Android apps and real life web applications like Gmail and Google Docs. This ubiquitous language can be installed onto an Ubuntu server and its what we’ll be teaching in this tutorial today.

Pre-flight

  • Open the terminal and log in as root. If you are logged in as another user, you will need to add sudo before each command.
  • Working on a Linux Ubuntu 16.04 server
  • No installations of previous Java versions

Install Java

Step 1: Updating your system

apt-get update && apt-get upgrade

Step 2: Install the Repo

First, install the repository, its provided by a third party and you’ll need to press enter to continue downloading. The Oracle Java (JDK) Installer automatically downloads and installs Oracle JDK8.

add-apt-repository ppa:webupd8team/java

Update your system once more
apt-get update

Step 3: Install Java 8

Using the command below will kickstart the Java Installer which will assist in our task. Press Y when prompted to continue.

apt-get install oracle-java8-installer

Once you come to the Installer page click OK and Yes to agree to their licensing and terms.

Step 4: Verify the Installation of Java 8

java -version

Example Output:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

 

Set Java’s Home Environment

You may be looking to set Java’s home environment once we’ve installed it onto our server. To do that, lets first, let’s find Java’s path.

update-alternatives --config java

There is 1 choice for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 auto mode
* 1 /usr/lib/jvm/java-8-oracle/jre/bin/java 1081 manual mode

Take the highlighted path and add the variable into your /etc/environment file. Add the JAVA_HOME path after any line that is already present.

vim /etc/environment

Once you are in the file type i to insert the needed line:
JAVA_HOME=”/usr/lib/jvm/java-8-oracle/jre/bin/java”

Save and exit the file by typing ESC followed by :wq and press enter. Afterward, use the source command to have the system recognize the changes in your file.

source /etc/environment

You’ll know the variable has been set correctly by calling the variable.

echo $JAVA_HOME
Example Output:
root@1804:~# echo $JAVA_HOME
/usr/lib/jvm/java-8-oracle/jre/bin/java

Install Java 8 on CentOS 7

In this tutorial, we’ll be showing you how to install Oracle’s Java 8 programming language specifically onto a CentOS 7 server. This simple object-oriented language is used for many of the applications and websites you come across today.  Let’s jump right in!

Pre-flight

  1. Open the terminal and login as root.  If you are logged in as another user, you will need to add sudo before each command.
  2. Working on a Linux CentOS 7 server
  3. No installations of previous Java versions

Installing Java 8 on CentOS 7

Step 1: Update

As a matter of best practice we’ll update before installing any new programs:

yum -y update

Step 2: Install Java 8

yum install java-1.8.0-openjdk

Step 3:  Verify Java is Installed

java -version

Example Output:

java -version
openjdk version "1.8.0_191"
OpenJDK Runtime Environment (build 1.8.0_191-b12)
OpenJDK 64-Bit Server VM (build 25.191-b12, mixed mode)

Set Java’s Home Environment

Step 1: Find Java’s Path

Let’s set the JAVA_HOME variable, using the following command will give us a path so we can set the variable.

update-alternatives --config java

You’ll see a prompt to “Enter to keep the current selection[+], or type selection number:”, if you had multiple Java version you could set the default here, but all we need is the path of Java so we can exit pressing enter.  The highlighted area is the path we will need to copy/paste into our .bash_profile file.

Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java)</code?

Step 2: Setting Java’s Path in Your Environment

After copying your Java’s path, open the .bash_profile with your text editor.

vim .bash_profile

Export your Java path into the .bash_profile by adding the following to the bottom of the file. (Your path may look different from mine, and it’s not important that they vary.)

export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java

Refresh the File:

Source .bash_profile

When you use the JAVA_HOME variable you’ll now be able to see the path you set.

echo $JAVA_HOME

Example Output:

/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.191.b12-1.el7_6.x86_64/jre/bin/java

 

Update MariaDB from 10.0 to 10.3 on CentOS 7

We recently posted an article on Upgrading MariaDB 10.0 to 10.3.9 on Ubuntu 16.04. We are now going to provide insight on upgrading MariaDB 10.0.X to 10.3.X on a CentOS 7 server.

The article assumes that the administrator is already presently working with MariaDB 10.0.X. It is considered best practice to consult the official documentation from MariaDB prior to updating/upgrading the current version. This is pertinent in doing because it is vital in understanding what exactly is going to be changed, updated, and even removed from one version to the next.

We will start with upgrading from version 10.0.X to 10.1.X, as you’ll need to upgrade step-by -tep to reach MySQL’s 10.3 version(10.0 > 10.1 > 10.2 > 10.3). Please note that yum will automatically default you to the most recent stable version, unless a MariaDB repository is configured. More on that here.

If deciding to place all the version repos in one file, one must specify a differing bracket tag, so yum provides the option for the version of the package being searched for. This is what my /etc/yum.repos.d/MariaDB.repo file looks like:

When searching or looking for specific versions of MariaDB, generally speaking, one can start here. We’ll be upgrading to the most current stable version per their releases page. For the sake of this article, we will be installing 10.1.37.

Following this step, query the available packages:

yum list available –showduplicates MariaDB-Server.x86_64

After the specified repo has been configured, save the file and proceed on.

Step 1.  Set innodb_fast_shutdown to 0

mysql

--innodb_fast_shutdown = 0;

Step 2.  Shutdown MariaDB 10.0

Exit out of your MySQL database and stop your MySQL service.

systemctl stop mysql

Verify that MySQL has been stopped:

systemctl status mysql

Step 3. Make a Backup

You have the choice of backing up your MariaDB instance either through the cp or rysnc command. The best way to grab a pristine copy of any MySQL server is to stop the service completely ( i.e., Step 2 ) and make a copy of /var/lib/mysql.

cp -r /var/lib/mysql /var/lib/mysqlbackup

Step 4. Un-install MariaDB 10.0.X

yum remove mariadb-server

Step 5. Install MySQL 10.1

We found that the best way to install the specific version is to issue the following command:

yum --disablerepo=* --enablerepo=mariadb10.1 install mariadb-serverIf this isn’t specified, yum will automatically update you to the most up to date version of the package.  Once return/enter is selected you should then see a preview of what is going to be installed next:

Proceed to ‘y’ if all looks good and has been confirmed that the version being sought after will be installed. Allow the Packages to install. Once completed, it is time to move to Step 6.

Step 6. Run mysql_upgrade

We mentioned in our Ubuntu article that this was not needed on Debian based packages. However on RHEL, CentOS, and Fedora packages do not have this natively built into its update process. First, you’ll need to start the service.

systemctl start mysql

Next, run the following to ensure the service is up and running:

systemctl status mysql Once run, we should see a similar output, confirming that the service is up and running:

Now we can finally run mysql_upgrade:

mysql_upgrade

We should then see the different upgrades and fixes that are being done:

Once the ‘OK’ status has been seen, you’re free to continue working with the most current version or continue upgrading to the desired version. Follow the above steps to get to 10.2.x and 10.3.x! We hope this helps and as always check out our database hosting product for you high availibility needs.

Install Multiple PHP Versions Using EasyApache 4

EasyApache 4 installs, configures, updates, and validates your Apache, PHP and other services on your server. EasyApache 4 also supports multiple versions of PHP.  This allows you to assign different versions of PHP to each of your domains. There are great tools that have been implemented with EasyApache 4 that makes managing PHP versions simple. Two of these are the MultiPHP Manager and MultiPHP INI Editor. These can be found within the Web Host Manager, or “WHM” for short.  With the addition of these tools in cPanel/WHM, users can now complete most of these tasks from the Graphical User Interface. However, it is worth mentioning, attempting these tasks from the command line is recommended as we have seen better performance when compiling Apache builds.  

Note:
If you are still using EasyApache 3, please contact our support for assistance upgrading your server to EasyApache 4. EasyApache 3 is no longer being supported as of December 31st, 2018. This means there will be no further updates for this service. This can create security risks and should be addressed. Also, cPanel will not allow you to update to version 78 or newer using EasyApache 3. Before considering upgrading, please be sure you meet the following requirements.

EasyApache 4 requirements

  • Utilize Apache 2.4 or newer, updating Apache from 2.2 to 2.4 can be done from WHM using EasyApache 3, but it is recommended to run from the command line.  You can read more about this here.
  • It is recommended for the system to use suPHP as the default PHP handler.  More information on handlers can be found here.
  • CentOS 6, CloudLinux 6, Red Hat Linux 6 or higher

          

Note:
If you are still running CentOS 5 or older “due to the security risks” we would highly recommend migrating to a newer operating system as soon as possible. More than likely your current server’s hardware is also obsolete. Due to the complexities of our packages, we would recommend migrating to a new server. If you need any assistance choosing a new server, please reach out to us. Our team will gladly assist you in selecting the perfect package that will provide you with the best performance possible.

  • PHP versions 5.4 or higher. If your site is using PHP 5.3 or older, you will need to update and confirm your site is compatible with PHP Versions 5.4 or higher.  
  • MySQL/MariaDB are using updated hashes. The older versions of MySQL use an incompatible hashing algorithm.  Mysql 5.6 and later use an updated secured hash.  Since EasyApache 4 uses mysqlnd “the MySQL Native Driver” this will need to be addressed before upgrading since mysqlnd does not support older hash.  

Once you have met these requirements, your server is ready to upgrade EasyApache 3 to EasyApache 4.  When upgrading EasyApache we would recommend beginning this task at a time your server is not expecting much traffic as the process can take 20 minutes to a few hours.  This depends on your specific server’s performance and overhead. If you require any assistance with meeting the requirements needed to upgrade or would like to schedule an upgrade.  Please call, start a chat or submit a ticket with our support team.

Other than the requirements there are a few other obstacles you may need to check.

  1. Be sure the suPHP_ConfigPath directive is not being used in any .htaccess file as unexpected behavior may occur. You can correct this by removing or commenting this directive out within the .htaccess file. (The .htaccess can be found in /home/$cpaneluser/public_html  or /home/$cpaneluser/)
  1. Find any php.ini or .user.ini that will try to reference the old environment variable,  extension_dir, either the line will need to be removed or corrected. (The .php.ini/.user.ini can be found in /home/$cpaneluser/public_html  or /home/$cpaneluser/)

Upgrading EasyApache 3 to EasyApache 4 Script

Access your server via SSH and insert the following command:  

/scripts/migrate_ea3_to_ea4 –run 

To revert back to EasyApache 3

/scripts/migrate_ea3_to_ea4 –revert –run

Once EasyApache 4 is installed, please be sure to test your sites for any errors and confirm that WHM/cPanel is up to date.

 

Configuring Apache and PHP Using EasyApache 4 

1. Login to WHM and access EasyApache 4 by using the search bar.

       WHM >> Software >> EasyApache 4

2. Once you have navigated to EasyApache 4 you can view, customize and provision available EasyApache profiles.  Click the  button under Currently Installed Packages.

Note:
By default EasyApache 4 comes with additional profiles that help minimize setup up time as there are a few options tailored to the end users’ needs. If needed you still have the ability to create your own profiles for even further customization. For more information on EasyApache 4 profiles, you can view this documentation from cPanel.

3. From the “Apache MPMmenu you can select which MultiProcessing Module, or “MPM” you would like to use.  This will determine how Apache will handle incoming requests and how it processes them. You can select which MPM you would like to use by clicking the toggle button to the right of the module. If you are unsure on which MPM to use, check our tutorial to help you decide. Once selected click Next.

4. The “Apache Modules” section will allow you to select and install needed Apache Modules.  Once the needed modules are selected, click Next. Apache Modules can add extra functionality to Apache.  For example, the mod_ssl module can be selected from this interface.  This allows Apache to process traffic using the Secure Sockets Layer “SSL v2/3” and TLS “Transport Layer Security”. For more Information on Apache Modules visit this link, which details more specific information on Apache Modules.

5. From the PHP Versions menu, you can select which versions of PHP you wish to install.  WHM will automatically check for extensions currently being used by other versions of PHP on your server.  More than likely these extensions are currently being used by one of your domains, and because of this, we recommend selecting the PHP X.X and Extensions button when selecting a version.  After you have selected the versions you want to install, click Next.

Note:
If possible we would highly recommend using the most recent version of PHP as PHP version 5.6 and 7.0 will no longer have security updates as of January 1, 2019. For more information on supported PHP versions visit this link.

6. From the next menu, the PHP Extensions menu, you can select all PHP extensions you require.  PHP extensions enable particular functions used in your PHP code, an example of this would be if your PHP code communicates with MySQL you will need to utilize the mysqlnd extension.  EasyApache 4 has already selected recommended extensions that existed on previously installed versions of PHP on your server by default.   A good tip is to limit the selection view to only the version of PHP you are installing.  You can do so at the top of this page by deselecting the boxes next to Filter by PHP Version.  Once you have selected your PHP extensions click Next.

7.  The next two sections are not commonly used, however, they are included for those that require these functions.  Ruby via Passenger allows you to integrate Ruby, Node.js, and Python applications on your server.  Within this menu, you can install/select which Ruby modules you would like to use.  More information on this can be found in this link

Within the Additional Packages menu, you can select custom packages to be installed on your server.  Currently, by default, the only option available is Tomcat 8.5.  Tomcat is a Java Servlet Container that allows you to run Javabased application on your server. You can save the profile to be used for later by clicking Save as profile button on the bottom-right corner of the page.

Once you have finished your selections, click Next or Review.   You should see a notification like the one we have included below.  This can take a few minutes to complete so allow it some time to poll your results.

8.  Please be sure to review this next page to make sure you have selected the desired configuration. If you notice anything is missing or should be changed, you may return to the relevant menu to adjust the selections. Once reviewed, scroll down to the bottom of the page and click the Provision” button.Once you have begun provisioning, please allow EasyApache some time to finish.  You will be prompted once the process has finished.

Congratulations, you have selected an MPM, installed additional Apache Modules, PHP versions, and PHP extensions using EasyApache 4.

 

Using the MutliPHP Manager from WHM

cPanel’s MultiPHP Manager allows users to manage cPanel accounts PHP configuration on a per domain basis.  This feature is only available on EasyApache 4.  You can also set the systems default global PHP version for all accounts, enable PHP-FPM globally or per domain, and adjust PHP-FPM pool options.

Selecting System default PHP Version 

  1. Navigate to the MultiPHP Manager (WHM >> Software >> MultiPHP Manager)
    Note:
    Setting the system default PHP version will not change the PHP version for all domains. Your cPanel account “if not defined” is set to inherit by default. If the inherit option is enabled, the account will use the system’s default PHP version.
  1. Click Edit under System PHP Versions.
  1. Select the desired PHP version and click Apply. You should see a Success notification at the top right of the page if the change was successful.  It will also display any errors that may have occurred. 

Define PHP Versions per Domain

Within the MultiPHP Manager, you also can set the desired PHP version on a per domain basis.  

  1. Select the domain or accounts you wish to alter.
  2. Click the dropdown menu located in the PHP column.
  3. Select your desired PHP version. The interface will prompt you once the change has completed.

 

Changing PHP Versions on Multiple Accounts

  1. Select which accounts you would like to alter by clicking the check boxes next to the domain.
  2. Click the dropdown located in the type right.
  3. Select the desired PHP version and click Apply The interface will prompt you once the change has completed.

 

MultiPHP INI Editor

MultiPHP INI Editor is a great tool that allows you to manage PHP settings per version.  You can quickly edit the most commonly adjusted PHP directives from within the Basic Mode or for more advanced users you can edit the configuration files directly using the Editor Mode.   For information on directives, please read PHP’s documentation which can be found here.

To access the MultiPHP INI Editor login into WHM. (WHM >> Home >> Software >> MultiPHP INI Editor)

Basic Mode allows you to view and edit directive values for your selected PHP version.  WHM will save changes to the PHP configuration file.  Also, directives will only show if the version of PHP you are editing supports that directive. With WHM assistance this greatly helps minimize errors as the syntax within these files are sensitive.  

Edit PHP Configuration Using MultiPHP INI Editor in Basic Mode

  1. Select a PHP version from the dropdown menu.
  2. Adjust directives as needed.  For example, you can increase upload_max_filesize by editing the field to the right of the directive.
  3.  Click Apply to submit changes.  If the edit was submitted successfully WHM will notify you at the top right of the page.  It will also inform you if any errors have occurred.
  4. Adjust directives as needed.  For example, you can increase upload_max_filesize by editing the field to the right of the directive. 
  5.  Click Apply to submit changes.  If the edit was submitted successfully WHM will notify you at the top right of the page.  It will also inform you if any errors have occurred.

 

Edit PHP Configuration Using MultiPHP INI Editor in Editor Mode

Editor Mode allows you to modify additional directives and PHP configurations that are not available in Basic Mode.  Please note, errors within this interface can result in errors causing PHP scripts not to function correctly.  Unlike Basic Mode which loads directives available to that version of PHP, Editor Mode loads the contents from the .ini file for the selected PHP version.  If the file does not exist then, the interface will load a blank editor.  When saving values or configurations to a blank editor, the systems will create a new file. 

  1. From within MultiPHP INI Editor click the Editor Mode tab. 
  2. Click the dropdown menu to select PHP Version.
  3. The Editor will open the file as a text document. From here you can simply edit the configuration to your needs.
  1. Click Save to submit your changes.  If the changes were successful WHM will display a success notification in the top right of the screen as well as any errors that may have occurred.  

EasyApache 4 makes adjustments and server tuning a breeze.  However, there is still a chance the end user can make a fatal mistake.  A quick call to our support staff could bring a quick resolution to your issue.  There are some cases where the best solution possible, is the fastest the end user can apply themselves.  For cases such as these, we would highly recommend utilizing our Cloud Backups.  Cloud Backups offer an extra layer of protection as your backups are stored on a remote device we manage here at Liquid Web.  This ensures full restoration in the unlikely event of a total system failure. The end user can manage and restore easily from our manage page.  For more information on how Cloud Backups can work for you visit products page

Installing Libreoffice on Ubuntu 16.04

If you are looking to collaborate with your coworkers or employees and create and share documents on your Ubuntu server without taking up space on your local computer system, LibreOffice is the perfect tool for you. Formerly known as OpenOffice (based on StarOffice) this tool has evolved largely from the vast community of developers that contribute to its success daily. This powerful tool is currently in use by millions around the world as a free and open source alternative to the Microsoft Office Suite of tools.

  Continue reading “Installing Libreoffice on Ubuntu 16.04”

Creating a Bucket using DragonDisk for Object Storage

DragonDisk is a client for S3 compatible storage, meaning that you can connect this client to many storage services including our very own Liquid Web Object Storage solution. The scope of our article will focus on how to install and create a bucket specifically connected to our Cloud Object Storage.

Pre-flight

Create a Cloud Object Storage,  to do so, follow these instructions.

Installing and Configuring DragonDisk

Step 1: Download the DragonDisk Client

Go to DragonDisk’s website and download the version appropriate for your computer’s OS. For our example, we will be working on Dragon Disk for Mac OS X.

Step 2: Create an Account

Once you download the program, open DragonDisk and choose My Computer from the first Root box. From the File tab, select the Accounts>>>New.

Enter in the following sections and select OK:

  • Provider: From the drop-down select the appropriate Object Storage provider, we’ll choose Other S3 Compatible Service.
  • Service Endpoint: Enter in the URL for our Storage Object (objects.liquidweb.services)
  • Account: Type in the name of which to identify your account, we simply named ours as Object.
  • Access Key: Copy your unique Access Key from your Liquid Web control panel.
  • Private Key: Copy your unique Private Key from your Liquid Web control panel.

Step 3: Create a Bucket

After creating this account you can then go back to your DragonDisk interface and select this newly made account from the second Root drop-down box.

You can then right-click on your account name to select Create Bucket, in our example we named ours superbucket. (Its necessary for your bucket name to be unique so if a bucket name is already in existence try adding numbers to the end to create a unique bucket name).

Install Poweradmin on Ubuntu 16.04

What is Poweradmin?

Poweradmin is a web-based graphical user interface to interact with PowerDNS. It is released under the open source GPL license. It makes it easy to create and edit zone files and interacts directly with the SQL server. Poweradmin has full support for most PowerDNS features, including all zone types (master, native and slave), supermasters, for automatic provisioning of slave zones and full support for A, AAAA, CNAME, HINFO, MX, NS, PTR, SOA, SRV and TXT record types, validation against RFC’s. It also has user and permission management setup for controlling user permissions with templates.  In this tutorial, we’ll be showing you how to install and configure Poweradmin as well as some records.

Continue reading “Install Poweradmin on Ubuntu 16.04”