Linux Resources
- Home
- Linux Resources
This article covers how to secure Apache with Let's Encrypt SSL on CentOS 7 using Certbot client. Also, you will learn how to set up a cronjob for automatic certificate renewal. Basically, A security certificate is critical for securing traffic sent from web browsers to web servers. Let's Encrypt certificate is a free, open and automated certificate authority that you can use to encrypt your site. The certificate expires after every 90 days and auto-renews at absolutely no cost.
To Install Certbot in CentOS 8.
Certbot is a client that automates the installation of the security certificate. It fetches the certificate from Let's encrypt authority and deploys it on your web server without much of a hassle.
1. Before downloading certbot, first, install packages that are necessary for the configuration of an encrypted connection:
$ sudo dnf install mod_ssl openssl
2. Download certbot using the curl command:
$ sudo curl -O https://dl.eff.org/certbot-auto
3. Next, move the certbot file to the /usr/local/bin directory and assign the execute file permissions:
$ sudo mv certbot-auto /usr/local/bin
$ sudo chmod 755 /usr/local/bin/certbot-auto
To Assign the permissions to the Document root of a domain:
$ sudo chown -R apache:apache /var/www/domain.com
For the changes to come into effect, restart the Apache service:
$ sudo systemctl restart httpd
This article covers how to successfully install Apache on your Ubuntu 18.04 server. 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 Ubuntu:
1. Update your local package index:
$ sudo apt update
2. Install the apache2 package:
$ sudo apt install apache2
This article covers how to install and secure a MySQL server on a CentOS 7 server. MySQL is one of the most widely used database management systems for websites and server applications.
To start the MySQL server daemon with the following command:
$ sudo systemctl start mysqld
systemctl doesn't display the outcome of all service management commands, so to be sure we succeeded, we'll use the following command:
$ sudo systemctl status mysqld
To configure MySQL, run the following command:
$ sudo mysql_secure_installation
To Current MySQL Version, run the command:
$ mysql -u root -p
Terms used in Managing MySQL User Permissions:
This article covers method to easily configure Apache virtual hosts. You repeat same procedure for multiple domain.
You can use yum to install Apache through CentOS's default software repositories:
$ sudo yum -y install httpd
Next, enable Apache as a CentOS service so that it will automatically start after a reboot:
$ sudo systemctl enable httpd.service
How to Set Up Local Hosts File ?
If you are on a Mac or Linux computer, edit your local hosts file with administrative privileges by typing:
$ sudo nano /etc/hosts
The details that you need to add are the public IP address of your VPS followed by the domain that you want to use to reach that VPS:
127.0.0.1 localhost
127.0.1.1 guest-desktop
server_ip_address example.com
server_ip_address example2.com
This will direct any requests for example.com and example2.com on our local computer and send them to our server at server_ip_address.
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
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