Category Archives: CentOS

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 ensure a service or program starts on boot on Centos Linux

This Video will show you how to ensure that a service or program starts on boot on Linux. This video was recorded on CentOS 8 but the method shoudl work on most Linux Distros including Ubuntu.

The command that you need to run is:

sudo chkconfig servicename on

This command will ensure that the service starts on boot on Linux

Can’t SSH into VirtualBox Machine

This video will show you how to SSH into a VirtualBox Machine. This video is using CentOS although the concepts should be much the same for other Linux Distros. This Linux Tutorial shows you what do to when you can’t SSH into VirtualBox Machine. First you will need to power off your VM. Next you will need to right click, settings, click network, select adopter 2 and enable VirtualBox host only adapter. Once done you will need to power on the machine. Next you will need to make sure that this new connection has an IP address. In CentOS this is done by creating a new network connection in the /etc/sysconfig/network-scripts folder. We then configure this network have a DHCP IP address and restart the network connection. Once done we restart the network, and SSH in to our machine.

 

How to Install CentOS 8 on VirtualBox 2020

This CentOS 8 tutorial will show you how to install CentOS 8 on VirtualBox. To begin you will see how to create a Virtual machine on VirtualBox. Next you will see how to download CentOS 8 to windows. Next you will see the CentOS 8 installation process. You will mount the CentOS 8 installation media into VirtualBox. Next you will see the CentOS 8 installation process step by step.7 Finally you will log into CentOS 8 server. This installation of CentOS 8 on VirtualBox take place on windows, in affect showing you how to run CentOS 8 on windows 10. The Install process will be the same if you are running on a physical machine.

How to install apache (httpd) on CentOS 8

This tutorial will show you how to install the Apache web server on CentOS 8.

You will need to log into your CentOS 8 server and run the following commands:

  • sudo yum install httpd
    • When prompted press y to confirm the installation.
  • sudo service httpd start
    • This starts the apache service
  • sudo service httpd status
    • This insures that the service is running, your output should look similar to the output below.

  • sudo chkconfig httpd on
    • This insures that the apache service is powered on when the server boots.
  • Next create a file called index.html in the apache root directory by running the following command
    • sudo vi /var/www/html/index.html
  • Press i to go into insert mode and add the following text
    • <html> this is my web serer </html>
  • press esc and then type wq! to quit and save the file.
  • You can now navigate to your servers ip address or dns name, you should now see a screen similar to the one below.

 

A full video can be seen here:

Solved firewall-cmd command not found

This short video will show you how to correct the error:

This error is actually cased by not having firewalld installed on your system.

In this video you will see how to install firewalld

To fix this issue you need to run the following commands:

sudo yum install firewalld sudo

systemctl start firewalld sudo systemctl

enable firewalld sudo systemctl status firewalld

Once these commands are run you can then start using firewall-cmd command.

How to check MariaDB version

“MariaDB is a community-developed fork of the MySQL relational database management system intended to remain free under the GNU GPL. Development is led by some of the original developers of MySQL, who forked it due to concerns over its acquisition by Oracle Corporation”

This short MariaDB tutorial will show you how to check the version of MariaDB you are running. We are running MariaDB on CentOS 7 but the process should be much the same for other operating systems.

Step 1 

Log into your MariaDB instance, in our case we log in using the command:

mysql -u root -p

Step 2

After you log in you can see your version in the welcome text – highlighted in the screen-grab below:

Step 3

If you cannot see your version here you can also run the following command to see it:

SELECT VERSION();

A full video tutorial on the process can be found here:

 

 

How to Setup CentOS 7 on AWS

This tutorial will show you how to create a CentOS 7 instance on AWS. We assume that you already have you AWS account created and that you are logged in already.

Step 1

Click Services and then EC2

Step 2

Click Launch Instance

Step 3

  • Click AWS Marketplace
  • Search for CentOS
  • Select the top result – CentOS7

Step 4

Click Continue

Step 5

Select your machine type and click Next Configure Instance details. In our case we will select the t2.micro instance as it is free tier eligible.

Step 6

Change Auto-assign public IP to Enable and click Next: Add storage.

Step 7

Leave the defaults and click Next:Add Tags

Step 8

Click Next: Configure Security Group

Step 9

Click review and Launch.

Step 10

Review your settings and then click Launch.

Step 11

In the drop down menu select create a new key pair, give the key pair a name and Download the Key Pair, then click launch Instances.

Step 12

Click your instance ID to see the instance.

You should now see your instance.

Step 13

To connect to our instance we will need to convert the key we downloaded, to do so we will use putty and puttygen they can be downloaded form here: https://www.putty.org/

Open puttygen and click Load

Step 14

Navigate to where you downloaded your key, click all files, click on your key and click open.

Step 15

Now click Save Private key, when prompted click yes you want to save without a passphrase.

Step 16

Now open putty and enter your public IP into the host name or IP address field, then expand SSH on the left had side.

Step 17

Click auth and then browse, navigate to where you saved your key and select it.

Step 18

Now click open

Step 19

Click Yes

Step 20

Enter centos as the username and click enter.

You will now be logged in

A full video tutorial can be found here:

How to Run Wildfly on CentOS 7

WildFly, formerly known as JBoss AS, or simply JBoss, is an application server authored by JBoss, now developed by Red Hat. WildFly is written in Java and implements the Java Platform, Enterprise Edition (Java EE) specification. It runs on multiple platforms.

WildFly is free and open-source software, subject to the requirements of the GNU Lesser General Public License (LGPL), version 2.1.

This tutorial will show you how to install Wildfly on Centos 7.

Step 1

To run Wildfly you need Java, so we will download it now, run the command:

yum -y install java-1.8.0-openjdk

Confirm that it is installed correctly by running:

java -version

Step 2

Let’s get the firewall ready, there are two ports we need open, lets open them now, run the following commands:

sudo firewall-cmd –zone=public –add-port=8080/tcp –permanent
sudo firewall-cmd –zone=public –add-port=9990/tcp –permanent

Now reload the firewall to ensure the changes take effect:

sudo firewall-cmd –reload

Step 3

Now lets download wildfly, run the command:

wget http://download.jboss.org/wildfly/14.0.1.Final/wildfly-14.0.1.Final.tar.gz

Step 4

Now lets un-pack the tar file, run:

sudo tar -zxf wildfly-14.0.1.Final.tar.gz

Step 5

Now let’s edit some config files first we need to move to the relevant directory, run the command.

cd wildfly-14.0.1.Final/standalone/configuration

We need to edit the standalone.xml file.

We will use vi for this, run:

vi standalone.xml

look for the section:

<interfaces>
<interface name=”management”>
<inet-address value=”${jboss.bind.address.management:127.0.0.1}”/>
</interface>
<interface name=”public”>
<inet-address value=”${jboss.bind.address:127.0.0.1}”/>
</interface>
</interfaces>

Note the 127.0.0.1 we will change this to 0.0.0.0, the block of text should look like so:

<interfaces>
<interface name=”management”>
<inet-address value=”${jboss.bind.address.management:0.0.0.0}”/>
</interface>
<interface name=”public”>
<inet-address value=”${jboss.bind.address:0.0.0.0}”/>
</interface>
</interfaces>

Step 6

Now lets add a management user. First run:

cd wildfly-14.0.1.Final/bin

Next run the command:

./add-user.sh

You will be greeted with a series of prompts:

a) Management User (mgmt-users.properties)
b) Application User (application-users.properties)
(a):

  • Press enter for the default.

Enter the details of the new user to add.
Using realm ‘ManagementRealm’ as discovered from the existing property files.
Username:

  • Enter a Username

Password recommendations are listed below. To modify these restrictions edit the add-user.properties configuration file.
– The password should be different from the username
– The password should not be one of the following restricted values {root, admin, administrator}
– The password should contain at least 8 characters, 1 alphabetic character(s), 1 digit(s), 1 non-alphanumeric symbol(s)
Password :

  • Enter a password.

What groups do you want this user to belong to? (Please enter a comma separated list, or leave blank for none)[ ]:
About to add user ‘wildfly’ for realm ‘ManagementRealm’
Is this correct yes/no

  • Type yes.

Is this new user going to be used for one AS process to connect to another AS process?
e.g. for a slave host controller connecting to the master or for a Remoting connection for server to server EJB calls.
yes/no?

  • Type no.

Step 7

Now we will start Wildfly, ensure that you are still in the bin directory and run the following command:

./standalone.sh

If the command is successful output should like so (You can ignore any ssl warnings):

Step 8

Lets confirm wildfly is up, open and web browser and navigate to the IP address of your CentOS server and append the port 8080 to the address, in our case it looks like so:

http://192.168.125.3:8080

You should see a screen that looks like so:

Step 9

Now let’s ensure the management interface is working, navigate to

http://192.168.125.3:9990

You should be prompted for a login, enter the username and password you set in step 6.

You should then see the Wildfly management interface.

A full video tutorial can be found here:

How to change the hostname in CentOS 7

First edit the hostname file by typing:

sudo vi /etc/hostname

Delete the line that you see in the file so it our case we deleted:

localhost.localdomain

Now  enter your hostname, in our case we called it darrens centos.

 

We then typed

esc wq!

to write and save the file.

 

We then restart the machine by typing

sudo init 6

When the machine has re-booted type in

hostname

to see the new hostname.

A video tutorial can be found here: