Tag Archives: linux

How to Generate a CSR on CentOS 8

This video will show you how to generate a Certificate Signing Request CSR on CentOS 8.

A CSR is normally sent to a certificate provider who will supply you with a certificate based from the CSR.

This video uses CentOS 8 Linux however the process should be much the same on all Linux operating systems.

The commands in this video are:

  • sudo yum install openssl
  • openssl req -new -newkey rsa:2048 -nodes -keyout yourkeyname.key yourdomainname.csr

How to Install Nginx Web Server on CentOS 7

NGINX is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. It is a rival to the Apache web server and used extensively throughout the internet.

This tutorial will show you how to install Nginx on CentOS 7.

So to begin we’ll need to ensure that we have epel repository installed. We can do so by running the command:

  • sudo yum install epel-release

Next we can install Nginx using yum. The command to do so is:

  • sudo yum install nginx.

Next we’ll start the Nginx web server and insure it starts when the server is powered on. The two commands to do this are:

  • sudo service nginx start
  • sudo chkconfig nginx on

Now we need to navigate to our localhost. To do so open a browser window and type in localhost. You should see a screen similar to the one below:

Now that we know that Nginx is working as we expect, lets remove the default Index.html and enter our own. First delete the default index.html by running:

  • sudo rm /usr/share/nginx/html/index.html

Now create your own file using vi:

  • sudo vi /usr/share/nginx/html/index.html

Enter some test text into your file and save it. Now refresh your browser window. You should see the changes replicated. When we refreshed ours it looked like the image below:

 

A full video tutorial on how to install Nginx can be found here:

How to RDP (Remote Desktop) into CentOS 7

Hi There,

In this tutorial I will show you how to RDP into your CentOS 7 Server. This tutorial will also work on a Redhat 7 server. In order to follow this tutorial you will need to be sure that you have CentOS 7 installed with the GNOME Desktop. If you haven’t done this yet be sure to follow this tutorial to get up to speed.

The first thing that we need to do is to add two repos to our CentOS server. The two commands that you need to run are:

  1. sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm
  2. sudo rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm

Next we will install the xrdp software package and then start it as a service. The commands to do this are:

  1. sudo yum -y install xrdp tigervnc-server
  2. Sudo systemctl start xrdp.service

Now we need to allow the ports for xrdp through the firewall. After that we’ll need to restart the firewall service. This can be done by running these commands.

  1. sudo firewall-cmd –permanent –zone=public –add-port=3389/tcp
  2. sudo firewall-cmd –reload

Finally we need to configure SELinux. To do so run these two commands:

  1. sudo chcon –type=bin_t /usr/sbin/xrdp
  2. sudo chcon –type=bin_t /usr/sbin/xrdp-sesman

We can now try to RDP to our CentOS 7 server.

First open RDP and type in the IP address of you CentOS 7 Server.

If you get certificate warnings click yes to continue.

Now enter your CentOS username and password

You will now be brought to your CentOS Desktop.

 

 A full video of this tutorial can be seen here:

How to install Joomla 3 on CentOs 7 /Redhat 7 Linux.

This tutorial shows you how to install Joomla 3 on CentOS 7 / Redhat 7 Linux (RHEL).It shows you first how to download, unzip and move the Joomla files to the correct directory for apache.

 

Next it shows you how to download and install php including the php-mysqli extension that is needed by Joomla. You will then see how to configure Apache to see the Joomla files.

 

Next you will then configure permissions and set up your Joomla Database in MYSQL (MariaDB) Finally you will install Joomla.

 

 

The commands that you need to follow along with this tutorial are:

 

Downloading, Unzipping and Moving Joomla:

 

sudo Wget https://downloads.joomla.org/cms/joomla3/3-8-3/Joomla_3-8-3-Stable-Full_Package.zip?format=zip
Sudo mkdir Joomla
Sudo mv Joomla_3-8-3-Stable-Full_Package.zip\?format\=zip Joomla
Cd Joomla
Sudo unzip Joomla_3-8-3-Stable-Full_Package.zip\?format\=zip Joomla
Sudo rm Joomla_3-8-3-Stable-Full_Package.zip\?format\=zip
Sudo mv Joomla /var/www/html

 

Installing PHP

 

Sudo yum install php
Sudo yum install php-mysqli

 

Configuring Apache and Permissions  

 

Sudo vi /etc/httpd/conf/httpd.conf
Sudo service httpd restart
Sudo chown apache:apache -R /var/www/html/Joomla
Sudo chcon -Rv –type=httpd_sys_rw_content_t /var/www/html

Configuring MYSQL / MariaDB

 

Mysql -u root -p
Create database joomla;
grant all on joomla.* to ‘darren’@’localhost’ identified by ‘password123’;

 

 

How to Install Drupal 8 on CentOs 7 / Redhat (RHEL) 7

This video describes the process of installing Drupal 8 on CentOS 7. This tutorial takes place on a CentOS 7 machine but the commands will also work on a Redhat (RHEL) 7 Machine.

 

The commands that you need to follow along with this tutorial are:

 

  • sudo wget https://ftp.drupal.org/files/projects/drupal-8.4.2.tar.gz
  • sudo tar -zxvf drupal-8.4.2.tar.gz
  • sudo mv drupal-8.4.2 /var/www/html/
  • sudo mv drupal-8.4.2/ drupal
  • sudo chcon -R –type=httpd_sys_rw_content_t /var/www/html/
  • sudo chown apache:apache /var/www/html
  • sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  • sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
  • sudo yum install php70w
  • sudo service httpd restart
  • sudo yum install php70w-dom
  • sudo yum install php70w-gd
  • sudo yum install php70w-pdo
  • sudo service httpd restart

 

 

 

How to Install PHP 7 on CentOs 7 / Redhat 7 (RHEL)

This tutorial shows you how to install PHP 7 on CentOS 7.

 

This tutorial is on an CentOS 7 machine but the commands will also work on Redhat (RHEL) 7.

 

The commands that you need to follow along with this tutorial are:

 

  • sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  • sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
  • sudo yum install php70w
  • sudo yum install php70w-pdo

How to Connect To Linux (CentOs 7) Using SSH Keys (Password free authentication) from Windows

This video shows how to log into a CentOs 7 server from a Windows machine using SSH keys. The video will show you how to generate the keys using Putty and then how to configure your CentOS 7 Server to allow you to authenticate into the server.

Putty is available to download from www.putty.org.

The commands that you need to follow along with the tutorial are:

sudo mkdir ~/.ssh
sudo chmod 700 ~/.ssh
sudo vi ~/.ssh/authorized_keys
sudo chown YourUserName:YourUserName ~/.ssh -R
sudo chmod 600 ~/.ssh/authorized_keys

Vim: How to create, save and exit a file

Vim has a reputation as a difficult file editor. However it’s quite easy once you know how to use it. This quick tutorial steps through how to create, save and exit a file using Vim and it only takes 5 minutes to step through.

To create a new file using Vim, type the following into your terminal:

vi newfile

You will now see a screen similar to the one below.

The first thing we need to do is enter insert mode. This will allow us to enter text into our file. To enter insert mode press i

Notice at the bottom of the screen it now says insert.

We can now add some text into our file, type hello world.

Now we want to save our file but to do this we first need to exit insert mode. You can do this by pressing Esc.

Notice that the insert at the bottom of the screen is gone. Now type :wq!  (w is for write and q is to quit) and then click enter.

That’s it! You have now created, edited and saved a file using Vim.

 

 

How to install Centos on VirtualBox

Virtual box is a free, opensource Hypervisor, it allows you to run one operating system within another one. This post will detail how to install CentOS, an open source operating system  in Virtual Box.

 

To successfully follow this tutorial you will need to download and install Virtualbox. You will also need to download the 32 bit live CD of CentOS.

 

Virtual box can be downloaded from their download page https://www.virtualbox.org/wiki/Downloads and the CentOS live os can be downloaded from their download page http://isoredirect.centos.org/centos/6/isos/i386/

 

Once you have these two prerequisite steps completed you can start the tutorial below:

 

Part 1 – Creating the Virtual Machine

  1. Begin by opening VirtualBox, and click on new.

 

 

2. In the window that appears:

a. Type in CentOS.

b. Select Linux.

c. Select version 32 bit Red Hat.

 

 

3. Leave the memory size at the recommended and click next.

 

 

4. Select create a virtual hard disk now and click create.

 

 

5. Select VDI (VirtualBox Disk Image) and click next.

 

 

6. Select dynamically allocated and click next.

 

7. Leave the disk name as CentOS, the disk size as 8GB and click next.

 

Part Two – Mount the CentOS Live CD

 

1. You should now be returned to the VirtualBox main screen, and you should see your Virtual machine. Next you need to mount the CentOs ISO to install CentOs. Click on the CentOs Virtual Machine and then click settings.

 

 

2. Click Storage

 

 

 

3. Select Empty, and then select the CD icon and then click ‘choose Virtual Optical Disk File’.

 

 

4. Navigate to and select the CentOs ISO which you have downloaded. Select it and click open.

 

 

5.Click OK.

Part 3 – Install CentOs.

 

1.We can now start the CentOs virtual machine by clicking on it and then clicking start.

 

 

2. The Virtual Machine will boot into a live image of CentOs. Double click on install to disk.

 

 

3. Click Next.

 

4. Select Language and Click next.

 

5. Select basic storage device and select next.

 

6. Select discard any data.

 

7. Leave the hostname as default.

 

8. Select your time zone and click OK.

 

9. Enter a root password and click next.

 

10. Select ‘Use All Space’ and click next

 

11. Select write changes to disk.

 

12. CentoS will now install.

 

13. Once CentOs is installed you can click close.

 

14.Click system and Shut Down.

 

Part Four: Clean up

 

1. Now click the Centos Virtual Machine and click settings.

 

 

 

2.Click Storage.

 

 

3.Now select the CentOs ISO ,click the CD icon and select remove disk from virtual drive, then click OK.

4. Now start the Virtual Machine.

 

5. Move through the final steps which include setting up your user name and password. Once this is done you should see the log in screen.

 

Congratulations, you have just completed the installation of CentOs on a Virtual Machine.