×


Blog


Install PHP 7.4, 7.3, 7.2, 7.1 on CentOS 7 & CentOS 8 - Step by Step Process ?

This article covers how to install specific version of PHP 7 on CentOS 7 Linux server. PHP is a programming language often used to automate server tasks. It is part of the LAMP (Linux, Apache, MySQL, PHP) stack, which is a bundle of software used for running internet servers and services. PHP handles dynamic content, database requests, and processing and displaying data.


To Verify PHP Version:

You can Check which version of PHP you are running with the command:

$ php –v


To Install PHP with Apache on CentOS:

1. Start by installing the yum-utils package by entering the following command in a terminal window:

$ sudo yum install yum-utils –y

2. Then, enable the epel-release repository by entering the following:

$ sudo yum install epel-release –y

3. Finally, add the following software repositories that contain the PHP packages:

$ sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm

4. For PHP 7.3, you can enable PHP 7.3. Install the release with the following commands:

$ sudo yum-config-manager ––enable remi–php73
$ sudo yum install php php-common php-opcache php-mcrypt php-cli php-gd php-curl php-mysql –y


Install Apache on CentOS 7 Server - Step by Step Process ?

This article covers how to install Apache on your CentOS 7 system. You can now ready to start deploying your applications and use Apache as a web server.

Basically, The Apache HTTP server is the most widely-used web server in the world. It provides many powerful features including dynamically loadable modules, robust media support, and extensive integration with other popular software.


To Install Apache on CentOS:

1. Update the local Apache httpd package index to reflect the latest upstream changes:

$ sudo yum update httpd

2. Once the packages are updated, install the Apache package:

$ sudo yum install httpd

3. Enable firewalld's http service with the following command:

$ sudo firewall-cmd --permanent --add-service=http

4. Configure Apache to serve content over HTTPS, you will also want to open up port 443 by enabling the https service:

$ sudo firewall-cmd --permanent --add-service=https

5. Finally, reload the firewall to put these new rules into effect:

$ sudo firewall-cmd --reload


Create a Sudo User on CentOS - How to do it ?

This article covers how to create a user with sudo privileges. You can now log in to your CentOS server with this user account and use sudo to run administrative commands.

Performing server administration as a non-root user is a best practice.

For security, your first task when deploying a CentOS instance is to create a non-root user with sudo access.


How to Add a New User Account on CentOS Linux System ?

1. To Create a new user account with the adduser command:

# adduser example_user

2. Set a strong password for the new user (new_user) with passwd.

# passwd new_user


Install MariaDB on Debian 9 Server - Step by Step Process ?

This article covers how to install MariaDB version on a Debian 10 server, and verify that it is running and has a safe initial configuration.


How To Install MariaDB on Debian 10 ?

1. To install MariaDB, update the package index on your server with apt:

$ sudo apt update

2. Then install the package:

$ sudo apt install mariadb-server

3. To Configure MariaDB, Run the security script:

$ sudo mysql_secure_installation


Configure Apache Virtual Hosts on Debian 9 - Step by Step Process ?

This article covers how to Configure up Apache Virtual Hosts on a Debian 10 server. Using Apache Virtual Hosts you can host multiple domains on a single server. 

Apache will break its functionality and components into individual units so you can customize independently. The basic unit that describes an individual site or domain is called a virtual host.


How to configure Apache Virtual Hosts on Debian ?

Apache is a free and open source web server used web server in the world, and it is commonly used in Linux servers.

To install Apache:

1. Check whether apache is already installed and running on your server. You can do this with the following command:

$ dpkg -l apache2

2. If apache is not installed, you can do this by running the following commands. First, make sure that the system repositories are up to date:

$ apt-get update

3. To install the Apache web server, execute the following:

$ apt-get install apache2

4. After the installation is complete, you should enable Apache to start automatically upon server reboot with:

$ systemctl enable apache2

5. You can also check the status of your Apache service with the following command:

$ systemctl status apache2

If you want to secure your website with an SSL certificate, you can generate and Install a free Letsencrypt SSL certificate.


Secure Apache with Let's Encrypt on Debian 9 - Step by Step Process ?

This article covers how to use certbot client of Let’s Encrypt to obtain SSL certificate for you domain.

To set these up DNS records for your server, you can follow these instructions for adding domains and then these instructions for creating DNS records:

  • An A record with your_domain pointing to your server’s public IP address.
  • An A record with www.your_domain pointing to your server’s public IP address.


To install Certbot as a snap on Debian

You must first have snapd installed on your server. 

snapd is a daemon required to install, use, and manage snaps. 

Installing the snapd package will also install the snap command on your server.

1. To install snapd, update your local package index if you've not done so recently:

$ sudo apt update

2. Then install the snapd package:

$ sudo apt install snapd

After running this command, you'll be prompted to confirm that you want to install snapd and its dependencies.

Do so by pressing Y and then ENTER.

3. Next, use the snap command to install the core snap. This will install some dependencies on your server that are needed for any snap you install, including the Certbot snap:

$ sudo snap install core

4. Then refresh the core snap. Doing so will ensure that you have the latest versions of snapd and its dependencies installed:

$ sudo snap refresh core

Following that, you can install the certbot snap with the following command.

5. Because Certbot must be allowed to edit certain configuration files in order to correctly set up certificates, this command includes the --classic option. This confinement level allows any snaps installed under it the same access to system resources as traditional packages:

$ sudo snap install --classic certbot

6. Create a symbolic link to this file in the /usr/bin/ directory to ensure that you can run the certbot command anywhere on your system:

$ sudo ln -s /snap/bin/certbot /usr/bin/certbot