2021 cPanel/Plesk Pricing

Reading Time: 3 minutes

On October 1st, Oakley Capital, the parent company of cPanel and Plesk, announced a pricing increase to their current licensing structure which will take effect on January 1, 2021. While we understand that incremental price increases are expected from providers from time to time, Liquid Web does our very best to try and limit the costs we have to pass on to our customers. 

Continue reading “2021 cPanel/Plesk Pricing”

2021 New cPanel/Plesk Pricing Breakdown

Reading Time: 3 minutes

On October 1st, Oakley Capital, the parent company of cPanel and Plesk, announced a pricing increase to their current licensing structure which will take effect on January 1, 2021. While we understand that incremental price increases are expected from providers from time to time, Liquid Web does our very best to try and limit the costs we have to pass on to our customers. 

Continue reading “2021 New cPanel/Plesk Pricing Breakdown”

How to Install MongoDB on Ubuntu 18.04

Reading Time: 7 minutes

What is MongoDB?

mongodb logo

MongoDB is a documented database management system that does not require the description of the table scheme. It is an example of NoSQL systems (NoSQL – this is an approach to implement scalable db storage with a flexible data model), MongoDB uses JSON like documents and a database scheme. It is often used in web-development along with Big data. MongoDB is written in C++, C, and JavaScript. It is also cross-platform, which lets us deploy it on multiple platforms.  

One of the advantages of MongoDB over SQL-relational databases is that any relational database (e.g., MySQL) has a standard scheme that shows the number of tables and connections between them, and there is no such connection between tables in MongoDB.

MongoDB has a collection or a group of documents. The document is a collection of key-value pairs. Documents have a dynamic scheme. A dynamic scheme means that documents from the same collection do not have to have the same set of fields or structures; also, a common field of documents can include data of various types. 

This article will provide more information on MongoDB, what it is, and where it can be used, also look through its advantages and see how to install it. 

Advantages of MongoDB

  • Absence of a schema
  • Based on the collections of various documents
  • A clear structure of every object
  • Highly scalable
  • Internal memory is used to store data, which lets us get data faster.
  • Data is stored as JSON objects.
  • MongoDB supports document-based queries

MongoDB Use Cases

  • Storage of events
  • Content and documents management
  • Mobile apps database
  • Games database
  • Storing monitoring and sensor data
  • Storage of web-pages data

MongoDB’s Administration Tools

  • mongo – interactive administration shell
  • mongostat – command-line tool
  • mongotop – for monitoring
  • mongoimport and mongoexport – tools of export and import from and to JSON
  • mongodump and mongorestore – tools to create a backup copy and restore databases from it

Prerequisites 

  • A Ubuntu 18.04 Server
  • Be the root user
  • Access to sudo if not the root user

Installation on Ubuntu

First, let’s begin by updating our Ubuntu server.

root@host:~# apt update && apt -y upgrade
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@host:~#

At the time of writing the article, MongoDB 3.6 in the official repository in Ubuntu. We can check that by running the following command.

root@host:~# apt-cache show mongodb | grep -i version
Version: 1:3.6.3-0ubuntu1.1
Version: 1:3.6.3-0ubuntu1
root@host:~#

Latest Version

However, the latest official stable release of MongoDB is 4.4. To install and use the latest stable version, we need to introduce a special repository of MongoDB packages into the apt repository. We’re going to begin by importing the GPG key for the latest stable version of MongoDB.

 root@host:~# curl -fsSL https://www.mongodb.org/static/pgp/server-4.4.asc | apt-key add -
 OK
 root@host:~# 

In case the version has changed, and we need to add another key, the required key is found on the official server of MongoDB keys. You can find the file using the .asc extension. Here’s the link to use for that file.

We have used the curl tool — a command-line tool used to transfer data; It is commonly used in many OSes.

Let’s check whether the key was added properly running the following command: 

root@host:~# apt-key list
/etc/apt/trusted.gpg
--------------------
pub rsa4096 2019-05-28 [SC] [expires: 2024-05-26]
      2069 1EEC 3521 6C63 CAF6 6CE1 6564 08E3 90CF B1F5
uid [ unknown] MongoDB 4.4 Release Signing Key <packaging@mongodb.com>

root@host:~#

Download MongoDB

Now, we need to point the package installer where to find the MongoDB package to download and install, using the following command:  

root@host:~# echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-4.4.list
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse
root@host:~#

Run the Update

Next, we will update the package manager so that the new information will take effect, and apt can download and install MongoDB.

root@host:~# apt update
Hit:1 http://security.ubuntu.com/ubuntu bionic-security InRelease
Hit:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]
Ign:5 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 InRelease
Get:6 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 Release [5,391 B]
Get:7 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 Release.gpg [801 B]
Get:8 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse arm64 Packages [4,332 B]
Get:9 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 Packages [6,074 B]
Fetched 180 kB in 2s (101 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@host:~#

Install

Now we can install MongoDB using the following command.

root@host:~# apt install mongodb-org -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  mongodb-database-tools mongodb-org-database-tools-extra mongodb-org-mongos mongodb-org-server
  mongodb-org-shell mongodb-org-tools
The following NEW packages will be installed:
  mongodb-database-tools mongodb-org mongodb-org-database-tools-extra mongodb-org-mongos
  mongodb-org-server mongodb-org-shell mongodb-org-tools
0 upgraded, 7 newly installed, 0 to remove and 0 not upgraded.
Need to get 104 MB of archives.
After this operation, 200 MB of additional disk space will be used.
Get:1 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 mongodb-database-tools amd64 100.2.1 [54.5 MB]
Get:2 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 mongodb-org-shell amd64 4.4.1 [13.2 MB]
Get:3 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 mongodb-org-server amd64 4.4.1 [20.3 MB]
Get:4 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 mongodb-org-mongos amd64 4.4.1 [15.7 MB]
Get:5 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 mongodb-org-database-tools-extra amd64 4.4.1 [5,608 B]
Get:6 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 mongodb-org-tools amd64 4.4.1 [2,892 B]
Get:7 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 mongodb-org amd64 4.4.1 [3,520 B]
Fetched 104 MB in 10s (10.4 MB/s)
Selecting previously unselected package mongodb-database-tools.
(Reading database ... 105638 files and directories currently installed.)
Preparing to unpack .../0-mongodb-database-tools_100.2.1_amd64.deb ...
Unpacking mongodb-database-tools (100.2.1) ...
Selecting previously unselected package mongodb-org-shell.
Preparing to unpack .../1-mongodb-org-shell_4.4.1_amd64.deb ...
Unpacking mongodb-org-shell (4.4.1) ...
Selecting previously unselected package mongodb-org-server.
Preparing to unpack .../2-mongodb-org-server_4.4.1_amd64.deb ...
Unpacking mongodb-org-server (4.4.1) ...
Selecting previously unselected package mongodb-org-mongos.
Preparing to unpack .../3-mongodb-org-mongos_4.4.1_amd64.deb ...
Unpacking mongodb-org-mongos (4.4.1) ...
Selecting previously unselected package mongodb-org-database-tools-extra.
Preparing to unpack .../4-mongodb-org-database-tools-extra_4.4.1_amd64.deb ...
Unpacking mongodb-org-database-tools-extra (4.4.1) ...
Selecting previously unselected package mongodb-org-tools.
Preparing to unpack .../5-mongodb-org-tools_4.4.1_amd64.deb ...
Unpacking mongodb-org-tools (4.4.1) ...
Selecting previously unselected package mongodb-org.
Preparing to unpack .../6-mongodb-org_4.4.1_amd64.deb ...
Unpacking mongodb-org (4.4.1) ...
Setting up mongodb-org-shell (4.4.1) ...
Setting up mongodb-org-database-tools-extra (4.4.1) ...
Setting up mongodb-database-tools (100.2.1) ...
Setting up mongodb-org-mongos (4.4.1) ...
Setting up mongodb-org-tools (4.4.1) ...
Setting up mongodb-org-server (4.4.1) ...
Adding system user `mongodb’ (UID 111) ...
Adding new user `mongodb' (UID 111) with group `nogroup' ...
Not creating home directory `/home/mongodb'.
Adding group `mongodb’ (GID 117) ...
Done.
Adding user `mongodb’ to group `mongodb’...
Adding user mongodb to group mongodb
Done.
Setting up mongodb-org (4.4.1) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
root@host:~# 

Verify Installation

Next, let’s verify the installation using the version flag.

root@host:~# mongod --version
db version v4.4.1
Build Info: {
    "version": "4.4.1",
    "gitVersion": "ad91a93a5a31e175f5cbf8c69561e788bbc55ce1",
    "openSSLVersion": "OpenSSL 1.1.1 11 Sep 2018",
    "modules": [],
    "allocator": "tcmalloc",
    "environment": {
        "distmod": "ubuntu1804",
        "distarch": "x86_64",
        "target_arch": "x86_64"
    }
}
root@host:~#

Configure MongoDB

We have installed MongoDB, but it still needs to be configured for it to work properly. To accomplish this, we need to configure systemd to start MongoDB automatically to run in the background. Let’s run the systemctl command to start the MongoDB service.

root@host:~# systemctl start mongod.service
root@host:~#

Check Status

Now, let’s check the status of MongoDB

root@host:~# systemctl status mongod
● mongod.service - MongoDB Database Server
   Loaded: loaded (/lib/systemd/system/mongod.service; disabled; vendor preset: enabled)
   Active: active (running) since Mon 2020-11-16 14:55:31 UTC; 35s ago
     Docs: https://docs.mongodb.org/manual
 Main PID: 12274 (mongod)
   CGroup: /system.slice/mongod.service
           └─12274 /usr/bin/mongod --config /etc/mongod.conf

Nov 16 14:55:31 host systemd[1]: Started MongoDB Database Server.
root@host:~# 

Enable Service

Since the service is running, let’s enable it to start after a restart of the server.

root@host:~# systemctl enable mongod
Created symlink /etc/systemd/system/multi-user.target.wants/mongod.service → /lib/systemd/system/mongod.service.
root@host:~#

Run Diagnostics

Now let’s verify our settings by connecting to MongoDB and run a diagnostic command. This command will also enter the server address and port: 

root@host:~# mongo --eval 'db.runCommand({ connectionStatus: 1 })'
MongoDB shell version v4.4.1
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("6c138394-e3a4-43fb-9b56-c3e3720a228d") }
MongoDB server version: 4.4.1
{
        "authInfo" : {
                "authenticatedUsers" : [ ],
                "authenticatedUserRoles" : [ ]
        },
        "ok" : 1
}
root@host:~#

Because our command returned status “ok”: 1 – this means that the installation of MongoDB was completed successfully and is ready to work. Keep in mind that MongoDB uses port 27017 and local address 127.0.0.1. 

MongoDB Commands

It’s also essential to know some commands for managing MongoDB: 

systemctl status mongod - shows the status of MongoDB;

systemctl stop mongod - stops MongoDB;

systemctl start mongod - starts MongoDB; 

systemctl restart mongod - restarts MongoDB;

systemctl disable mongod - prevents MongoDB from starting automatically; 

systemctl enable mongod - enables MongoDB to start automatically.

Create Database

Next, let’s create a db. First, we need to switch to the mongo shell using the following command. 

root@host:~# mongo --shell
MongoDB shell version v4.4.1
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("8ff0cc20-9008-43b1-9942-ba256b3ca914") }
MongoDB server version: 4.4.1
type "help" for help
Welcome to the MongoDB shell.
For interactive help, type “help.”
For more comprehensive documentation, see
        https://docs.mongodb.com/
Questions? Try the MongoDB Developer Community Forums
        https://community.mongodb.com
---
The server generated these startup warnings when booting:
        2020-11-16T14:55:31.459+00:00: Using the XFS filesystem is strongly recommended with the WiredTiger storage engine. See http://dochub.mongodb.org/core/prodnotes-filesystem
        2020-11-16T14:55:31.865+00:00: Access control is not enabled for the database. Read and write access to data and configuration is unrestricted
---
---
        Enable MongoDB’s free cloud-based monitoring service, which will then receive and display
        metrics about your deployment (disk utilization, CPU, operation statistics, etc.).

        The monitoring data will be available on a MongoDB website with a unique URL accessible to you and anyone you share the URL with. MongoDB may use this information to make product improvements and to suggest MongoDB products and deployment options to you.

        To enable free monitoring, run the following command: db.enableFreeMonitoring()
        To permanently disable this reminder, run the following command: db.disableFreeMonitoring()
---
>

And running the use command, we will create a db, liquidwebTestDB


switched to db liquidwebTestDB
>
> use liquidwebTestDB

“Switched to” means that the db was created. To get the name of the current db, the db command is used. 

> db
liquidwebTestDB
>

List Databases

To get a list of all the databases, the show dbs command should be used.

> show dbs
admin 0.000GB
config 0.000GB
local 0.000GB
>

Insert Record

As we can see, our db is not on the list. To see it there, we need to make at least one record in the new database. We can do that by running the insert command. This command adds records to a MongoDB database.

db.liquidwebTestDB.insert({“name”:”Katherine“})

> db.liquidwebTestDB.insert({"name":"Katherine"})
WriteResult({ "nInserted" : 1 })
>

Relist Databases

Now let’s check the database list once again.

> show dbs
admin 0.000GB
config 0.000GB
liquidwebTestDB 0.000GB
local 0.000GB
>

Done! The database was created successfully. 

Conclusion

In this article, we provided information on MongoDB, its advantages and uses, as well as the main command-line tools. Also, we learned how to add a repository, download, and install the latest version; configure the start of the service. 

Learn More

We pride ourselves on being The Most Helpful Humans In Hosting™!

Our Support Teams are filled with experienced Linux technicians and talented system administrators who have intimate knowledge of multiple web hosting technologies, especially those discussed in this article.

Should you have any questions regarding this information, we are always available to answer any inquiries with issues related to this article, 24 hours a day, 7 days a week 365 days a year.

If you are a Fully Managed VPS server, Cloud Dedicated, VMWare Private Cloud, Private Parent server, Managed Cloud Servers, or a Dedicated server owner and you are uncomfortable with performing any of the steps outlined, we can be reached via phone at @800.580.4985, a chat or support ticket to assisting you with this process.

How to Implement Zero Trust Security in 5 Steps

Reading Time: 6 minutes

What is Zero Trust Security?

Zero Trust security is the concept, methodology, and threat model that assumes no user, system, or service operating within a secured internal environment should be automatically trusted. It put forward that every interaction must be verified when trying to connect to a system before being granted access. This concept uses micro-segmentation, and granular edge controls based on user rights, application access levels, service usage, and relation to the location to determine whether to trust a user, machine, or application seeking to access a specific part of an organization.

Why is it Needed?

Due to the ongoing nature of nation-state level cybercrime, extensive utilization of malware, and the overall insecurity of an internal network, once the external firewall access has been breached, a more granular approach to security was needed to stem the tide of intrusions and bolster security across an organization, especially if there is a wide area network in place. The more access points that exist in an infrastructure, the weaker the overall security can become.

Why is it Useful? 

Zero Trust security begins with the concept that no access is trusted. Access is only allowed on a per-user/service/application basis. On top of this, we add in Two-Factor Authentication, IAM (Identity & Access Management) ongoing analytics, enforced encryption, security scoring, and file system permissions. This allows for continual monitoring that governs access and privileges within an infrastructure.

How is Zero Trust Defined?

In 2010, Google formed BeyondCorp, which helped to standardize the Zero Trust model. They stated:

BeyondCorp is a Zero Trust security framework modeled by Google that shifts access controls from the perimeter to individual devices and users. The end result allows employees to work securely from any location without the need for a traditional VPN.

Unlike the traditional perimeter security model, BeyondCorp dispels the notion of network segmentation as the primary mechanism for protecting sensitive resources. Instead, all applications are deployed to the public Internet, accessible through a user and device-centric authentication and authorization workflow.

The guiding principles set forth by Google help pave the path for other organizations to realize their own implementation of a Zero Trust network.

https://www.beyondcorp.com/

Additionally, in 2017, Garner presented their five Zero Trust ideas called the CARTA model (Continuous Adaptive Risk and Trust Assessment). The following ideals define this model.

  • Replaces single binary security decisions with more context-aware programs
  • Recommends using increased granular controls and micro-segmented control planes regulated by predetermined policy decisions
  • Continuous monitoring of assets that prioritize risk vs. trust proactively and reactively.
  • Advanced risk/trust assessments before policy implementation
  • Changing to a “Software-Defined Perimeter” (SDP). An SDP is a dynamically accessed, micro-segmented network pathway used to provide a one-to-one connection between users and a resource they need to access.

5 Steps to Implement Zero Trust

A Zero Trust model is realized using the following five steps.

  1. Define the goals and objectives of securing a network. This begins with these three ideas.
    • Never Trust, Always Validate
    • Every connection is possibly hostile
    • Always use the Principle of Least Privilege
  2. Determine the areas which require the most amount of security to the least amount of security.
  3. Outline the users who can access these areas and what security measures they will use to access them. These include Multi-factor Authentications (at least 2 of the following factors):
    • Username/Password
    • 2FA (Two-Factor Authentication)
    • Biometrics
    • Hardware or Software-based security tokens
    • Time-based security measures (e.g., daily passphrase)
    • Location-based specific security measures
  4. Plan, layout, and implement the methods used to enforce the Zero Trust Policy.
  5. Continued Monitoring, Observation, Testing, and Evaluation.

Below, we will go into each of the five factors above in more detail.

Step 1. Define the Target Objectives

In the first step, we begin by working from the idea of trusting nothing and no one with access to our network. Next, we should identify every access point, endpoint, service, and application we intend to include in our policy. We then work forward in each of these areas to determine who requires access and provide a minimal amount of rights needed to work in these planes.

Step 2. Establish the Protect Surface

Next, within each of these planes, we identify and compartmentalize each area from the most security needed to the least security needed. For example, the Finance department would need tighter security protocols in place than, say, the marketing department. By identifying each department, we can then offer the varying degrees of employee access needed for each level. So, our finance department’s directory would need a greater degree of autonomy and clearance than, say, an employee who handles invoicing or purchasing.

Step 3. Outline User Access Control Priorities

In this step, we implement the type of authentication required to access the area required to accommodate the position in question. A user with increased access to sensitive material would be required to provide additional authentication layers to access and work in their compartmentalized area.

So for the same director of finance, the use of a username and password, additional biometrics, as well as time (8:00 am-5:30 pm) and location-based (east coast region, west coast region, European division) security measures could be implemented. This compartmentalization level would deny access to that same user for a different division’s location or timeframe if UTC times were used.

Step 4. Implement the Plan

Typically, the executive management team, along with the major department heads, HR and Security department, would need to begin preparing the changeover to this new security paradigm. This would include new pieces of training, written and verbal information on why the change is needed, including examples of how this modification benefits the organization as a whole.

As a rule, changes this broad would need to be implemented from the institution’s top-down. The required explanation for the change and management buy-in would also be required as any failure in the chain of custody would tend to defeat this measure’s purpose, especially if this is a new policy. This measure would no doubt be met with an initial degree of pushback due to the nature of the restrictions to be implemented.

As with any major policy shift, company-wide as well as department-wide employee meetings would need to be held to answer any and all questions related to why such a policy shift is needed. A patient and thorough explanation will go a long way with employee buy-in and in the long run, provide a smoother transition of the new policy.

Step 5: MOVE: Monitor/Observe/Verify/Evaluate

Lastly, implementing a Zero Trust policy should include ongoing monitoring of the changes. The flexibility to modify areas of concern or where adjustments are required should not preclude the ability to mold the policy to fit the organization. Any changes to the policy should be granted only on a case by case basis and with the team’s input (s) involved and extensive documentation as to why a modification or exemption is needed. This continues the posit of influence in maintaining the lowest amount of access needed to accomplish a position’s required tasks.

Observation is then required to see if there are areas of lowered productivity, as this is expected due to the nature of the sweeping changes and employees’ adaptation of the model. If a major hindrance is noted, a full review of the specific areas involved is warranted and incremental changes can be applied and then evaluated over X amount of time to determine the effectiveness of the changes.

A period of verification should be done at the three months, six months, one year, and each subsequent year for the policy’s effectiveness. Again, modifications can be made by a steering committee if larger changes are required due to security failures at any point in the process. This also allows for a tightening of some areas and a loosening of other areas as needs dictated.

Finally, an agreed-upon timeframe should be utilized, using both an internal audit and external evaluation which should be completed by an independent auditor to gauge the effectiveness of the policy. This precludes the possibility of exploitable gaps not seen or experienced during the policy change period. This allows for the executive team to ascertain the effectiveness of the policy and shore up any areas of liabilities or deficits in the policy. By implementing this type of system, security can be improved, malicious intent prevented and losses deterred increasing the overall security of the corporation.

Conclusion

A Zero Trust policy is the newest cost of doing business in a tech-savvy world. Approaching security measures in a smart way and being open to the possibility of the ever encroaching outlook of bad actors taking advantage of gaps in security. Policies like these can improve control over the access to internal resources reducing an organizations attack surface. This also prevents internal lateral attacks utilized by those seeking unauthorized access to resources that should be unreachable or even invisible to them. Zero Trust security enables greater visibility to deficits in shared access through activity monitoring and evaluation.

Join Us!

We pride ourselves on being The Most Helpful Humans In Hosting™!

Our Support Teams are filled with experienced Linux technicians and talented system administrators who have intimate knowledge of multiple web hosting technologies, especially those discussed in this article.

Should you have any questions regarding this information, we are always available to answer any inquiries with issues related to this article, 24 hours a day, 7 days a week 365 days a year.

If you are a Fully Managed VPS server, Cloud Dedicated, VMWare Private Cloud, Private Parent server, Managed Cloud Servers, or a Dedicated server owner and you are uncomfortable with performing any of the steps outlined, we can be reached via phone at @800.580.4985, a chat or support ticket to assisting you with this process.

How to Install lsyncd on Ubuntu 20.04 LTS

Reading Time: 4 minutes

What is lsyncd?

lsyncd is a rsync-based tool that monitors specified directories (including subdirectories) for updates and modifications, and then syncs those changes to a specified destination. It is a lightweight command application that is easy to install and configure using the popular Lua language.

It’s extremely useful in tracking data modification within a configured directory, and if changes are seen, it syncs the data between the directories which are frequently updated with new contents. By default, it is rsync only.

Continue reading “How to Install lsyncd on Ubuntu 20.04 LTS”

How to Install and Update Python to 3.9 in Ubuntu

Reading Time: 4 minutes

In this article, we will explore the newest methods to install or update to the latest version of Python on our Ubuntu system. 

What is Python?

python-logo

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. It’s high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development and use as a scripting or glue language to connect existing components together. Python’s simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse.

https://www.python.org/doc/essays/blurb/

Prerequisites

We begin as always, by running our updates. This ensures that all of our system software is up to date.

root@host:~# apt update

Next, we will add software-properties-common. This software provides some additional scripts that are useful for adding and removing a PPA.

root@host:~# apt install software-properties-common

Add Repository, Update, and Install

Now, we add the repository and then run another update to allow our system to recognize the changes.

root@host:~# add-apt-repository ppa:deadsnakes/ppa
root@host:~# apt update

Finally, we run the installation to add the latest version of Python. As an aside, we have opted to install the -dev and -venv features as well. This ensures we have Python 3.8, pip, and virtualenv. 

root@host:~# apt install python3.9 python3.9-venv python3.9-dev
Reading package lists… Done
 Building dependency tree
 Reading state information… Done
 The following additional packages will be installed:
   libpython3.9-minimal libpython3.9-stdlib python3.9-minimal
 Suggested packages:
   python3.9-venv python3.9-doc binfmt-support
 The following NEW packages will be installed:
   libpython3.9-minimal libpython3.9-stdlib python3.9 python3.9-minimal
 0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
 Need to get 4952 kB of archives.
 After this operation, 19.8 MB of additional disk space will be used.
 Do you want to continue? [Y/n] y
 Get:1 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libpython3.9-minimal amd64 3.9.0-5~20.04 [751 kB]
 Get:2 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 python3.9-minimal amd64 3.9.0-5~20.04 [2017 kB]
 Get:3 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 libpython3.9-stdlib amd64 3.9.0-5~20.04 [1776 kB]
 Get:4 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 python3.9 amd64 3.9.0-5~20.04 [408 kB]
 Fetched 4952 kB in 2s (2068 kB/s)
 Selecting previously unselected package libpython3.9-minimal:amd64.
 (Reading database … 92316 files and directories currently installed.)
 Preparing to unpack …/libpython3.9-minimal_3.9.0-5~20.04_amd64.deb …
 Unpacking libpython3.9-minimal:amd64 (3.9.0-5~20.04) …
 Selecting previously unselected package python3.9-minimal.
 Preparing to unpack …/python3.9-minimal_3.9.0-5~20.04_amd64.deb …
 Unpacking python3.9-minimal (3.9.0-5~20.04) …
 Selecting previously unselected package libpython3.9-stdlib:amd64.
 Preparing to unpack …/libpython3.9-stdlib_3.9.0-5~20.04_amd64.deb …
 Unpacking libpython3.9-stdlib:amd64 (3.9.0-5~20.04) …
 Selecting previously unselected package python3.9.
 Preparing to unpack …/python3.9_3.9.0-5~20.04_amd64.deb …
 Unpacking python3.9 (3.9.0-5~20.04) …
 Setting up libpython3.9-minimal:amd64 (3.9.0-5~20.04) …
 Setting up python3.9-minimal (3.9.0-5~20.04) …
 Setting up libpython3.9-stdlib:amd64 (3.9.0-5~20.04) …
 Setting up python3.9 (3.9.0-5~20.04) …
 Processing triggers for mime-support (3.64ubuntu1) …
 Processing triggers for gnome-menus (3.36.0-1ubuntu1) …
 Processing triggers for man-db (2.9.1-1) …
 Processing triggers for desktop-file-utils (0.24-1ubuntu3) …
root@host:~# 

Verify Installation

To verify our installation of the required version, use the -V flag to ensure the correct version is set up.

root@host:~# python3.9 -V
Python 3.9.0+
root@host:~#

Source Installation

Install Prerequisite

As you are going to install Python 3.8 from the source. You need to install some development libraries to compile Python source code. Use the following command to install prerequisites for Python:

Search for Latest Version

If by chance you try and update your system and apt returns no results, we can use the apt list command to locate the updates we need.

root@host:~# apt list | grep python3.9
 WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
 idle-python3.9/focal-updates 3.9.0-5~20.04 all
 libpython3.9-dbg/focal-updates 3.9.0-5~20.04 amd64
 libpython3.9-dev/focal-updates 3.9.0-5~20.04 amd64
 libpython3.9-minimal/focal-updates 3.9.0-5~20.04 amd64
 libpython3.9-stdlib/focal-updates 3.9.0-5~20.04 amd64
 libpython3.9-testsuite/focal-updates 3.9.0-5~20.04 all
 libpython3.9/focal-updates 3.9.0-5~20.04 amd64
 python3.9-dbg/focal-updates 3.9.0-5~20.04 amd64
 python3.9-dev/focal-updates 3.9.0-5~20.04 amd64
 python3.9-doc/focal-updates 3.9.0-5~20.04 all
 python3.9-examples/focal-updates 3.9.0-5~20.04 all
 python3.9-minimal/focal-updates 3.9.0-5~20.04 amd64
 python3.9-venv/focal-updates 3.9.0-5~20.04 amd64
 python3.9/focal-updates 3.9.0-5~20.04 amd64
root@host:~# 

Download and Setup

root@host:~# apt-get install build-essential checkinstall
root@host:~# apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
    libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev

root@host:~# cd /usr/src/
root@host:~# wget https://www.python.org/ftp/python/$version/Python-$version.tgz
root@host:~# wget https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tgz

root@host:~# tar zxf Python-$version.tgz
root@host:~# tar xzf Python-3.8.6.tgz

root@host:~# cd Python-$version
root@host:~# cd Python--3.8.6

root@host:~# ./configure --enable-optimizations --with-ensurepip=install
root@host:~# make -j8
root@host:~# make altinstall

Rationalize Command Usage

In the three commands above, we configured our installation to enable the optimizations within Python. This allows it to run about 10 percent faster. Adding this flag may add more time to the overall compilation period, but it is worth it if you often work in Python. Using the –with-ensurepip=install flag installs pip bundled with this deployment. 

Using the -j option tells make command to split the process into “parallel steps” to speed up the compilation process. Even with this option enabled for parallel builds, this step can take a while.

We also run the command make altinstall to prevent our installation from replacing the default python binary file in /usr/bin/python.

Test Python

We can also run the Python test suite to ensure the installation is working as expected on our system. To run the test suite, type in the following command.

root@host:~# python3.8 -m test

Our server will be running tests for some time, and if all the tests pass, we can be sure that our new Python build is working as expected!

Clean Up

After a successful installation, remove the downloaded archive to save disk space

 root@host:~# cd /usr/src/
 root@host:~# rm -f Python-3.8.6.tgz 

Add Python to the system PATH

(Optional Info)

We can also configure Python into the system PATH to allow users to run the pip command within a terminal to install packages into our home directory. The recommended method to add Python to the PATH is to append Python’s version that you installed to the system-wide PATH variable. For example, this can be defined by a script within the /etc/profile.d/ directory.

root@host:~# vim /etc/profile.d/python.sh

PATH=/opt/python/<PYTHON-VERSION>/bin/:$PATH
(<PYTHON-VERSION> is the actual version of Python that we installed earlier.) 

Remove Old Python Versions

Typically, there is no reason to remove older versions of python as there may be scripts on the operating system which require their presence. The most effective way to run an alternative version of Python is within a virtual environment (venv). We can, however, review what versions of Python we currently have installed on our system. 

root@host [~]# ls /usr/bin/python*
/usr/bin/python@   /usr/bin/python2.7* /usr/bin/python2-config@  /usr/bin/python3.6*   /usr/bin/python-config@ /usr/bin/python2@  /usr/bin/python2.7-config*  /usr/bin/python3@         /usr/bin/python3.6m*
 root@host [~]# 

Conclusion

We pride ourselves on being The Most Helpful Humans In Hosting™!

Our Support Teams are filled with experienced Linux technicians and talented system administrators who have intimate knowledge of multiple web hosting technologies, especially those discussed in this article.

Should you have any questions regarding this information, we are always available to answer any inquiries with issues related to this article, 24 hours a day, 7 days a week 365 days a year.

If you are a Fully Managed VPS server, Cloud Dedicated, VMWare Private Cloud, Private Parent server, Managed Cloud Servers, or a Dedicated server owner and you are uncomfortable with performing any of the steps outlined, we can be reached via phone at @800.580.4985, a chat or support ticket to assisting you with this process.

How to Repair the DNS DCV Error in cPanel

Reading Time: 5 minutes

How Using Cloudflare Affects AutoSSL in cPanel

We have provided information about Cloudflare, AutoSSL, and the advantages of utilizing those services in previous articles. In this article, we will focus on solving one of the specific issues seen when using Cloudflare and AutoSSL together on a cPanel/WHM server. These services function admirably in almost every setting and can be relied upon to deliver the service they advertise. However, in certain situations, services can clash through no fault of their own. 

Continue reading “How to Repair the DNS DCV Error in cPanel”

What are Inodes in Linux?

Reading Time: 6 minutes

As you are probably already aware, everything is considered to be a file in Linux. That includes hardware devices, processes, directories, regular files, sockets, links, and so on. Generally, the file system is divided into data blocks and inodes. With that being said, you can think about inodes as a basis of the Linux file system. To explain it more clearly, an Inode is a data structure that stores metadata about every single file on your computer system. 

Continue reading “What are Inodes in Linux?”

How Was My Website Compromised? 

Reading Time: 7 minutes

In this tutorial, we will look at several methods that are used to compromise a website. In today’s world, websites use multiple procedures that represent the core functions of a modern business. Whether you have an eCommerce site or a business card site, a website is essential for driving business growth. We can safely state that a website is a unique image of your respective business. 

Continue reading “How Was My Website Compromised? “

How to Benchmark a Website Using Apache Bench

Reading Time: 5 minutes

What is Apache Bench? 

Apache Bench is a benchmarking tool that is included with the Apache web server software. It is designed to provide an impression of how our Apache installation will perform under different circumstances. Specifically, it shows us how many requests per second our Apache installation can serve.

Continue reading “How to Benchmark a Website Using Apache Bench”

DevOps: A New Perspective on Shared Automation

Reading Time: 9 minutes

What is DevOps?

DevOps is a set of various tools, practices, and ideals that combine software development (Dev) and IT Operations (Ops) into a single unifying force. It allows for better collaboration between developers, operations teams, system administrators, and system engineers. Their streamlined goal is to continually provide a high-value software product to the customer at high speed while monitoring and improving the overall process than using traditional software and infrastructure management. 

Continue reading “DevOps: A New Perspective on Shared Automation”

How to Install PyCharm on Ubuntu

Reading Time: 5 minutes

What is PyCharm?

PyCharm is an Integrated Development Environment (or IDE) for the Python programming language. It is a cross-platform development environment that is compatible with Windows, macOS, and Linux. It provides a tool that integrates code analysis, graphical debugging, unit testing, and an integrated terminal that supports development on remote hosts and virtual machines. 

Continue reading “How to Install PyCharm on Ubuntu”