Installing Linux Software Via The Commandline

Reading Time: 7 minutes

Installing Linux software from the commandline can save you time, money, and make life easy – if you know what you’re doing! This article is a brief overview of how the commandline operates on Linux distributions.

Once we have learned how the commandline works, we will move on to installing, removing, and updating our software packages VIA the commandline with yum. To get started, let’s begin with making sure we understand what the commandline does.

What Is The Commandline?

The commandline is a text-based interface which can be used to input instructions on a computer. A program called the bash shell usually provides the Linux commandline. There have been multiple shells developed over time as Linux has grown. Red Hat Linux utilizes the GNU Bourne-Again Shell. This shell is also known as “bash.” Bash is an improved version of one of the most well-known shells used on UNIX like systems, the Bourne Shell (sh). When the bash shell is used to pass info between the user and the computer, it displays a symbol when it is awaiting a command from the user. This interface is called the shell prompt. When an average user starts a bash shell, the default prompt usually ends with a dollar sign $ character, but this can be modified to suit the user.

CLI1

The dollar sign $ is replaced by the pound sign # if the shell is running as the root user. This symbol makes it apparent that it is a superuser shell, which can help to avoid accidents and mistakes on the accounts with elevated privileges.

CLI2

Using bash to execute commands can be very robust. The bash shell also provides a useful scripting language that can support automation of tasks. The shell even has additional capabilities that can help simplify or make operations that seem difficult in a graphical user interface (GUI) as simple as a single command.

Users access the bash shell through a terminal. A terminal provides a keyboard for user input and a display for output. On text-based installations, this can be the Linux machines physical console, the hardware keyboard, and screen. Terminal access can also be configured through serial ports. Another way to access a shell is from a virtual console. A Linux machines physical console supports multiple virtual consoles which act as separate terminals. Each virtual console supports an independent login session. If a graphical environment is available, it will run on the first virtual console. With a GUI running, you may access a virtual console by pressing Ctrl+Alt+F1 to go to the first console. You may use this combination, changing the F1 key out for F2 through F6, each representing their console.

How To Use The Shell?

Commands entered at the shell prompt must have three basic parts:

  1. A command to run
  2. Options to adjust the behavior of the command
  3. Arguments, which are targets of the commands

The command is the name of the program to run. It is usually followed by one or more options, which adjust the behavior of the command. The command options will start with either one or two dashes (ex: -a or –all) to distinguish them from other arguments. Commands may also be followed by one or more arguments or flags, that often indicates a target that the command should affect. For example, the command

usermod -L ge 

has a command (usermod), an option (L), and argument flags (ge). The effect of this command is to lock the password on user Ge’s account.

To effectively use a command, you need to know what arguments, options, and flags it uses and in what order it expects them (the syntax of the command). Most commands have a –help option. This option causes the command to print a description of what it does, describes the command’s syntax, a list of the options it accepts, along with what they do. If you are unsure how to operate a program and –help option is not available, you may try the “man” page. A man page is also known as a manual page. This option provides an overview of the program, and it’s syntax. If we wanted to look at how the sudo command is used, we would type “man sudo” to get a manual page for the command sudo.

How To Access The Commandline In A Desktop Environment?

The desktop environment is the graphical user interface on a Linux system. The default desktop environment in RHEL is GNOME. It provides an integrated desktop for users and a unified development platform on top of a graphical framework provided by the X Window System. The GNOME Shell provides the core user interface functions for the GNOME desktop environment.

To get a shell prompt in GNOME, start a graphical terminal application.
We can select Applications → Utilities → Terminal
On the desktop, right-click or press the Menu key, and select “Open in Terminal” from the menu.
From the Activities Overview, select Terminal from the dash.

When a terminal window opens, a shell prompt displays for the user that started the graphical terminal program. The shell prompt and the terminal window’s title bar will indicate the current user name, hostname, and working directory.

RPM And Software Packages

Red Hat developed the RPM Package Manager software, which provides a standard way to package software for distribution. Managing software in the form of RPM packages is much simpler than working with software that is extracted into a file system from an archive. The RPM software allows administrators to track which files are, or have been installed. It also checks to ensure supporting packages are present when the software is installed. Lastly, it identifies which dependencies need to be removed if a software package is uninstalled.

Information about installed packages is stored in a local RPM database on each system. All of the software provided by Red Hat is implemented as an RPM package. RPM packages are usually named using a combination of the following info using this format: 

name-version-release.architecture

When installing software from repositories, only the software name is required. Additionally, the software with the highest version will be installed. If there are several files within the same version, the software with the highest release number will be installed.

Each RPM software package is an archive made up of three components:

  1. The files installed by the packages
  2. Information (metadata) about the package – name, version, release, architecture
  3. A script which usually runs when the package is installed, updated, or removed

RPM packages are generally signed digitally by the group that packaged them. All software packages that come from a specific source are all signed with the same private GPG key. This way, if the software package is altered or corrupted in some way, the signature will no longer be shown as valid. This key signing allows the system to verify the integrity of the package before the install begins.

The YUM Package Manager

The YUM command searches multiple repositories for software packages and any associated dependencies, so they can be installed together to reduce or eliminate and dependency issues.

The main configuration file for yum is located at /etc/yum.conf with additional repository configuration files located in the etc/yum.repos.d directory. The yum command is used to list repositories, packages, and package groups:

Once a software package is installed, updates are checked against a repository during the daily update check. This allows for the RPM command to be used to query, update, install, and remove any outdated RPM packages.

Unfortunately, this check does not resolve dependencies automatically, and all software packages must be listed. Tools like YUM are essentially front-end applications for the RPM software and can be used to install an individual package or a collection of packages.

Managing Software Updates With YUM

Yum is a powerful commandline tool that can be used to flexibly manage software packages.

Finding Software with YUM

yum help – display usage information
yum list – display installed and available packages.

cli5

Yum search KEYWORD – list packages by keywords found in the name and summary fields. To search for packages that have “web server” in their name, we can use search all:

yum info PACKAGENAME – gives detailed information about a package.

Yum provides PATHNAME – displays packages that match the path name specified. To find packages that provide /var/www/html directory use:

Before we begin to install a package, let’s first make sure our system is up-to-date by issuing the command “yum update”.

Now that we know our system is updated, let’s install our package.

yum install PACKAGENAME

obtains and installs a software package, including all dependencies.

Next, we are asked if we want to install the package and dependencies. Type in ‘Y’ for yes, ‘N’ for NO

Yum now installs our package, fail2ban.

yum update PACKAGENAME 

obtains and installs the newest version of the software package, including all dependencies. With no PACKAGENAME specified, it will install all relevant updates for the system.

Yum remove PACKAGENAM

removes an installed software package, including any supported packages:

Enabling YUM Software Repositories

Registering a system to the subscription management service automatically configures access to the software repositories based on the attached subscriptions. To view all of the available repositories, we can use

yum repolist all

To enable a repository use yum-config-manager. This will enable or disable the parameters located in the /etc/yum.repos.d/redhat.repo file.

Enabling Third Party Software Repositories

Third-party repositories are directories of software package files provided by non-Red Hat source, which can be accessed by yum from a website, FTP server, or locally. Yum repositories are used by non-Red Hat distributors of software, or for small collections of local packages. To enable third-party support, you must put the file in the /etc/yum.repos.d/ directory. If the URL for a yum repository is known, a configuration file can be created via

yum-config-manager

This will create a file in the /etc/yum.repos.d directory with the output shown above. This file can now be modified to provide a customized name and the location of the GPG key. Administrators should download the key to a local file rather than allowing yum to retrieve the key from an external source.

RPM Configuration For The Repository:

Some repositories provide a configuration file and GPG public key as part of an RPM package that can be downloaded and installed using yum localinstall.

Using YUM To Install Local Package Files

The command

yum install PACKAGEFILE.rpm 

can be used to install package files directly. It automatically downloads any dependencies the package has from any configured yum repositories.

In this example, we downloaded an rpm file and then used

yum localinstall 

to begin installing the file from our machine.

Get Started Today!

Contact us today at 1.800.580.4985 to speak to a knowledgeable Solutions Provider who can get you the info you need, to make an informed decision right away.

Too busy to talk? Click HERE to open a quick chat with us to find out more.

Want more info in an email you can review at your leisure? Email us today to get handy advice on which product would best suit your needs.

We look forward to hearing from you!

How To Install the LAMP Stack on CentOS 7

Reading Time: 4 minutesWhether you’re new to hosting websites or a seasoned developer, you’ve more than likely heard of a LAMP stack. The LAMP stack is the base set of applications that most websites running on a Linux server are served from and is commonly referred to as “Lamp”. Rather than a single program that interacts with the website being served, LAMP is actually a number of independent programs that operate in tandem: Linux, Apache, MySQL/MariaDB, and PHP. Throughout this article, we’ll walk through installing the LAMP stack on your CentOS 7 server so you can run a website from any Dedicated Server or Virtual Private Server. Although we’re focusing on installing LAMP on a CentOS 7 server, the steps that we’ll cover are very similar across multiple Linux distributions.

Continue reading “How To Install the LAMP Stack on CentOS 7”

How to Install and Configure Puppet on CentOS, Fedora, Ubuntu or Opensuse

Reading Time: 4 minutes

What is Puppet?

lookPuppet is an intuitive, task-controlling software which provides a straightforward method to manage Linux and Windows server functions from a central master server. It can perform administrative work across a wide array of systems that are primarily defined by a “manifest” file, for the group or type of server(s) being controlled.

Continue reading “How to Install and Configure Puppet on CentOS, Fedora, Ubuntu or Opensuse”

How to Install MySQL on Windows

Reading Time: 2 minutesIf you’re using a Windows-based server to host your content, you may using Microsoft’s database server product, MSSQL. However, licensing restrictions can make using MSSQL difficult, especially for small businesses. Microsoft offers a free version of MSSQL called MSSQL Express that will be suitable for many users, but this version does have limitations on database size and memory usage. If you need a more robust database solution but want to try something with a lower cost (like a free, open-source database server), you could try MySQL database server.

MySQL is a standard part of the typical Linux server build (or LAMP stack) but is also available for use on Windows operating systems. Depending on your needs, you could fully develop your database in MySQL. Many popular Content Management Systems (CMS) also use MySQL by default, so using MySQL to manage those applications may be beneficial. MySQL and MSSQL can be run on the same server at the same time, so you’re free to use both or to experiment as needed.

Installing MySQL on your Windows server is as simple as downloading an MSI Installer package and clicking through a few options.

  1. Download the MySQL Installer from dev.mysql.com. The two download options are a web-community version and a full version. The web-community version will only download the server, by default, but you can select other applications (like Workbench) as desired. The full installer will download the server and all the recommended additional applications. (You’ll also be asked to create a user account, but you skip this part by scrolling down to the bottom and clicking “No thanks, just start my download”.)

    mysql_installer_download

  2. Run the installer that you downloaded from its location on your server, generally by double-clicking.
     
    Note
    You can use this same MSI Installer to upgrade currently installed versions of MySQL as well! As is typical, the first step is accepting the license agreement, then click Next.

    license agreement

  3. Determine which setup type you would like to use for the installation:
    1. Developer Default: this is the full installation of MySQL Server and the other tools needed for development. If you are building your database from the ground up or will be managing the data directly in the database, you’ll want to use this setup type.
    2. Server Only: if you only need MySQL Server installed for use with a CMS or other application and will not be managing the database directly, you can install just the server (you can always install additional tools later).
    3. Custom: this setup type will allow you to customize every part of the installation from the server version to whichever additional tools you select.

      setup type

  4. Install the server instance and whichever additional products you selected. Then begin the configuration process by selecting the availability level (most users will use the default, standalone version).
  5. Complete the configuration process by following the on-screen instructions. You’ll want to make sure to install MySQL as a Service so that Windows can automatically start the service after a reboot or can restart the service if it fails. For additional, step-by-step instructions, see MySQL Server Configuration with MySQL Installer.

Have other thoughts or questions? Our Sales and Support teams are available 24 hours by phone or e-mail to assist. Reach out to us by opening a support ticket at support@liquidweb.com, giving us a call at 1-800-580-4985 or, open a chat with us and we’ll be happy to answer any questions you may have!

SSL Checker Tool

Reading Time: 4 minutesThe security of your website is vital to the success of your Internet business. One way you can protect your data (and your customers) is through the use of encrypted communication protocols. Secure Socket Layer (or SSL) was the original method of providing for basic encryption between servers and clients. The industry mostly uses Transport Layer Security (or TLS) protocols now, but the process is basically the same, and most users refer to this kind of encryption by the old name: SSL.  As part of our Web Hosting Toolkit, Liquid Web provides and SSL Tool to help you verify that your SSL is installed correctly and up-to-date.  Below is an insight on how to use this tool and as well as some core concepts and certificates types to know when dealing with SSL.

 

SSL Certificate Checker

You’ll want to confirm that everything is functioning correctly on the server once you’ve successfully ordered and installed your SSL. At this time, you’ll want to check on your domain SSL’s to confirm expiration dates, covered subdomains, or other information. While you can use various third-party SSL checkers on the Internet, Liquid Web makes gathering this information about your domain simple. Just go to the Liquid Web Internet Webhosting Toolkit page and click on SSL Tool.

 lw-sslchecker

How Do I Check If My SSL Certificate is Valid?

Enter your domain name in the box provided and click on Submit. You can enter either your primary domain name (like mydomain.com) or any of the subdomains you may have created SSL certificates for (like blog.mydomain.com). If an SSL certificate is installed on the server for the domain, the page will display the status of the certificate and additional information.

lw sslchecker details

In this example, you can see that the certificate is valid and trusted by browsers and that the tested domain matches the certificate.

lw sslchecker valid test

You can also see which Certificate Authority issued the certificate and the dates for which the certificate is valid.

lw sslchecker certificate authority

Finally, you can see which signing algorithm was used to generate the certificate (indicating how complex and secure the certificate is) and which domains and subdomains are covered by the certificate.

lw sslchecker san details

How SSLs Work

SSL connections work through a series of tools that exist on your server and on a client’s web browser. At the simplest level, the server and a client computer exchange information and agree on a secret “handshake” that allows each computer to trust the other computer. This handshake is established through the use of private and public SSL certificate keys. The private key resides on the server, and the public key is available to a client computer. All information passed between the computers is encoded and can only be decoded if the keys match. These keys are generated by a Certificate Authority (like GlobalSign) and can vary in complexity and expiration date. These matched keys exist to prevent what are known as “man in the middle” attacks when a third-party intercepts the Internet traffic for the purpose of stealing valuable data (like passwords or credit card information). Because the third-party doesn’t possess the matching keys, they will be unable to read any of the intercepted information.

By using a trusted certificate, your website users can enter their information with full confidence that their data is safe. Certificate Authorities only grant SSL certificates to operators who can prove that they are the legitimate owner of a domain and that the domain is hosted on the server for which the certificate is being issued. This proof is usually obtained by modifying the DNS records for a domain during the verification process of the certificate ordering transaction. To learn more about how to order an SSL through your Liquid Web account, see How To Order or Renew an SSL Certificate in Manage.

 

Types of SSL Certificates

While SSL certificates all provide the same essential functions, there are several different types of certificates to choose from. You’ll want to establish which certificate meets your needs before you decide to order one for your domain. The types we’ll discuss here are Self-Signed Certificates, Standard Domain Certificates, Wildcard Certificates, Extended Validation Certificates.

Self-Signed Certificates

Most servers have the capability of generating a Self-Signed SSL certificate. These certificates provide the same kinds of encrypted communication that certificate provided by Certificate Authorities provide. However, because they are self-signed, there is no proof that the server is the “real” server associated with a website. Many control panels use self-signed certificates because the owner of the server knows the IP address of the server and can trust that they are connecting to the correct site when using that IP address. The advantage of self-signed certificates is that they are easy to generate and are free to use for as long as you want to use them.

Standard Domain Certificates

If you only need to secure a single domain or subdomain, a standard domain SSL certificate is appropriate. Standard certificates are generally the least expensive option from Certificate Authorities and are designed to cover one domain or subdomain (generally both domain.com and www.domain.com are covered by a standard certificate).

Wildcard Certificates

If you have multiple subdomains, you may be able to save time and money by getting a wildcard SSL certificate. Wildcard certificates cover a domain and all of its subdomains. For instance, if you have a domain website that also has a mail subdomain, a blog, a news site, and a staging site that you want to be protected by SSL communication, a single wildcard would protect all of the sites.

Note
A wildcard certificate will only protect one level of subdomains. So, blog.mydomain.com is covered, but new.blog.mydomain.com would not be covered.

Extended Validation Certificates

SSL certificates are generally issued to companies that can prove they have the right to use a domain name on the Internet (normally because they can modify the DNS records for that domain). While that level of verification is sufficient for most companies, you may need to have additional evidence that your company is a reliable entity for business purposes. Organizational SSL certificates require additional vetting by a Certificate Authority, including checks about the physical location of your company and your right to conduct business. Organizational SSL details can be visible on your website if you install a Secure Site Seal. Additional vetting is available for companies that choose Extended Validation SSL certificates. Extended Validation processes are often used by banks and financial institutions to provide extra reassurance to their customers that their website is legitimate. EV SSLs will turn the address bar of the client’s browser green and display the company’s name on the right side of the address bar.

If you need help determining which type of SSL is right for your business, chat with our Solutions team for additional information.

Now that you’ve checked the details of your SSL certificate and confirmed that all of the information is correct, you’ll be sure that the communications between your server and your customer’s computers are secure as that information travels over the Internet. For more information about improving the overall security of your server, see Best Practices: Protecting Your Website from Compromise.

 

How to Install Nextcloud 15 on Ubuntu 18.04

Reading Time: 2 minutesSimilar to Dropbox and Google Drive, Nextcloud is self-hosting software that allows you to share files, contacts, and calendars. But, unlike Dropbox and Google Drive, your files will be private and stored on your server instead of a third party server. Nextcloud is HIPAA and GDPR compliant, so your files will be encrypted along with the ability to audit. For this tutorial, we’ll be installing our Nextcloud instance on our Ubuntu 18.04 LTS server. Continue reading “How to Install Nextcloud 15 on Ubuntu 18.04”

How to Install phpMyAdmin on Ubuntu 18.04

Reading Time: < 1 minuteWorking with a database can be intimidating at times, but phpMyAdmin can simplify tasks by providing a control panel to view or edit your MySQL or MariaDB database.  In this quick tutorial, we’ll show you how to install phpMyAdmin on an Ubuntu 18.04 server. Continue reading “How to Install phpMyAdmin on Ubuntu 18.04”

How to Install React JS in Windows

Reading Time: 4 minutesReact.js (React) is an open-source JavaScript library useful in building user interfaces. React is a library so our main focus for this article is installing a JavaScript environment and a Package Manager so that we can download and install libraries including React.

When we are done, you will have a React environment you can use to start development on your Liquid Web server.

 

Install Node.js

The first step is to download the Node.js installer for Windows. Let’s use the latest Long Term Support (LTS) version for Windows and choose the 64-bit version, using the Windows Installer icon.

nodejs1

Once downloaded, we run the Node.js installer (.msi fuke) and follow the steps to complete the installation.

nodejs installationNow that we have Node.js installed, we can move on to the next step.

 

The Command Prompt Environment

We’ll need to use the command prompt (command line) to interact with Node.js and the Node Package Manager (NPM) to install React. Let’s take a few minutes to cover the commands we’ll need to use to get around. Here are the basic commands we will need to get around and create folders/directories:

nodejs_commands

 

Open a Command Prompt in Windows

Click the Start Menu (1), start typing the word command (2), then choose either Command Prompt or the Node.js command prompt (3) — either choice will work.

nodejs_commandprompt

A command prompt window will open with the path showing as C:\Users\<username> where the <username> on your system will be the user you are logged in as.

nodejs_commandprompt2

To execute a command, we type the command and any required options, then press Enter to execute it and see the results. Let’s walk through each of the commands listed above to see what happens:

dir

nodejs_commandprompt3

Let’s look at the contents of the downloads folder with this command:

dir downloads

nodejs_commandprompt4

The path shows we are still in the directory C:\Users\ReactUser>, however, we are looking at the contents of C:\Users\ReactUser\downloads and we see that it has one file. Let’s move to the downloads directory with this command:

cd downloads

nodejs_commandprompt5

We’ve changed to the downloads folder as the command prompt shows C:\Users\ReactUser\Downloads>. You can use the dir command to see the contents of this directory/folder. Next, let’s go back to the previous directory with this command:

cd..

nodejs_commandprompt6

Now we are back to where we started. Let’s create a new directory for our first project and name it reactproject1. We’ll use the command:

mkdir reactproject1

nodejs_commandprompt7

Again, we use the dir command to list the files within our current folder.

dir

nodejs_commandprompt8

If you want to learn more about commands, please check out these links:

 

Install React on Windows

There are two ways to install React for your projects. Let’s look at each approach so that you can decide which one you prefer to use.

 Option 1 

  • Create a project folder
  • Change to the project folder
  • Create a package.json file
  • Install React and other modules you choose

This install option allows you to full control over everything that is installed and defined as dependencies.

Step 1: To get started, we need to open a command prompt.

Step 2: Create a project folder named reactproject1:

mkdir reactproject1

Press Enter to execute the command, and we get a new directory called reactproject1. If you did this as part of the Command Prompt examples, you could skip this step as it will tell you that it already exists.

Step 3: Move to the project folder, using cd reactproject1, so we can install React into it.

cd reactproject1

At this point, you will see your prompt indicate C:\Users\ReactUser\reactproject1.

Step 4: Create a package.json file, the following command will walk you through creating a package.json file.

npm init

nodejs_commandprompt9

Step 5: Install React and other modules using npm install — save react, thiswill install React into your project and update the package.json file with dependencies.

npm install --save react

We can install additional packages using npm install — save and the name of the package we want to install. Here we are installing react-dom: npm install — save react-dom

npm install --save react-dom

 

 Option 2 

  • Install Create-React-App package to simplify the process of creating and installing React into your projects

 

 

Step 1: To get started, we need to open a command prompt and type npm install -g create-react-app. This installs the Create-React-App module which makes it very easy to create and deploy React into projects with a single command.

Note
When using create-react-app ensure you are in the desired directory/folder location as this command will create the project folder in the current path.

npm install -g create-react-appCreate-React-App is installed in the following location: C:\Users\<username>\AppData\Roaming\npm\node_modules\create-react-app\

Once Create-React-App is installed, we can use it to create a project folder and install React and dependencies automatically.

To make sure you are in the desired directory when creating a new project, you can use dir to see where you are, and cd <directory_name> or cd.. to get to the desired location.

Step 2: To create a new project and deploy React into it, we run create-react-app <project_name>. Let’s do this to create reactproject2.

create-react-app reactproject2

The entire process is automated and begins with creating a new React app folder for the project, then installs packages and dependencies. The default packages include react, react-dom, and react-scripts. The installation will take a few minutes.

nodejs_commandprompt10

Run a React Project Application

To run our new project, we need to use the command prompt to change to the project folder, then start it. The cd reactproject2  command will take us to the reactproject2 folder.

cd reactproject2

And npm start will run the project application.

nodejs_commandprompt11

The default browser will open and load the project:

localhostTo learn more about React, you may find these links helpful:

You now have your environment set for building out projects!  If you are running our lightning fast servers, our support team is at your disposal for any questions you may have.

How to Install MariaDB on Ubuntu 18.04

Reading Time: < 1 minuteMariaDB is a drop in replacement for MySQL, and its popularity makes for several other applications to work in conjunction with it. If you’re interested in a MariaDB server without the maintenance, then check out our high-availability platform. Otherwise, we’ll be installing MariaDB 10 onto our Liquid Web Ubuntu server, let’s get started! Continue reading “How to Install MariaDB on Ubuntu 18.04”

How to Install Squid Proxy Server on Ubuntu 16.04

Reading Time: 6 minutesA Squid Proxy Server is a feature rich web server application that provides both reverse proxy services and caching options for websites. This provides a noticeable speedup of sites and allows for reduced load times when being utilized.

Squids reverse proxy is a service that sits between the Internet and the webserver (usually within a private network) that redirects inbound client requests to a server where data is stored for easier retrieval. If the caching server (proxy) does not have the cached data, it then forwards the request on to the webserver where the data is actually stored. This type of caching allows for the collection of data and reproducing the original data values stored in a different location to provide for easier access.

Continue reading “How to Install Squid Proxy Server on Ubuntu 16.04”