How To Configure Firewall on CentOS 7 Step by Step

Configure Firewall on CentOS 7

FirewallD is a complete firewall solution that manages the system’s iptables rules and provides a D-Bus interface for operating on them. Starting with CentOS 7, FirewallD replaces iptables as the default firewall management tool. In this tutorial we will learn how to Configure Firewall on CentOS 7.

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step, configure Firewall on CentOS 7 server.

Configure Firewall on CentOS 7

Step 1. First, let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing FirewallD on CentOS 7.

Firewalld is installed by default on CentOS 7, but if it is not installed on your system, you can execute the following command for its installation:

sudo yum install firewalld

After you install firewalld, you can enable the service and reboot your server. Keep in mind that enabling firewalld will cause the service to start up at boot:

sudo systemctl start firewalld
sudo systemctl enable firewal
sudo reboot

We can verify that the service is running and reachable by typing:

sudo firewall-cmd --state

Step 3. Setup and configuration of FirewallD on CentOS 7.

FirewallD uses services and zones instead of iptables rules and chains. By default the following zones are available:
drop – Drop all incoming network packets with no reply, only outgoing network connections are available.
block – Reject all incoming network packets with an icmp-host-prohibited message, only outgoing network connections are available.
public – Only selected incoming connections are accepted, for use in public areas
external For external networks with masquerading is enabled, only selected incoming connections are accepted.
dmz – DMZ demilitarized zone, publicly-accessible with limited access to the internal network, only selected incoming connections are accepted.
work – For computers in your home area, only selected incoming connections are accepted.
home – For computers in your home area, only selected incoming connections are accepted.
internal -For computers in your internal network, only selected incoming connections are accepted.
trusted – All network connections are accepted.

To list all available zones run:

firewall-cmd --get-zones
work drop internal external trusted home dmz public block

To list the default zone:

firewall-cmd --get-default-zone
public

To change the default zone:

firewall-cmd --set-default-zone=dmz
firewall-cmd --get-default-zone
dmz

Example, here is how you can configure your VPS firewall with FirewallD if you were running a web server, SSH on port 8888 and mail server.

First we will set the default zone to dmz.
firewall-cmd --set-default-zone=dmz
firewall-cmd --get-default-zone
dmz

To add permanent service rules for HTTP and HTTPS to the dmz zone, run:

firewall-cmd --zone=dmz --add-service=http --permanent
firewall-cmd --zone=dmz --add-service=https --permanent

Since the SSH port is changed to 7022, we will remove the ssh service (port 22) and open port 8888

firewall-cmd --remove-service=ssh --permanent 
firewall-cmd --add-port=8888/tcp --permanent

To implement the changes we need to reload the firewall with:

firewall-cmd --reload

Finally, you can list the rules with:

### firewall-cmd --list-all
 dmz
 target: default
 icmp-block-inversion: no
 interfaces:
 sources:
 services: http https imap imaps pop3 pop3s smtp smtps
 ports: 7022/tcp
 protocols:
 masquerade: no
 forward-ports:
 sourceports:
 icmp-blocks:
 rich rules:

Congratulation’s! You have successfully configure Firewall. Thanks for using this tutorial for installing firewalld on CentOS 7 system. For additional help or useful information, we recommend you to check the official firewalld website.

How To Install Gradle on CentOS 7 Step by Step

Install Gradle on CentOS 7

Gradle is a free and open source build automation toolset based on the concepts of Apache Ant and Apache Maven. Gradle provides a platform to support the entire development lifecycle of a software project. In this tutorial we will learn How To Install Gradle on CentOS 7 Step by Step.

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges.

Install Gradle on CentOS 7

Step 1. First, let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing OpenJDK.

Gradle requires Java Development Kit (JDK) 7 or higher in order to work. In this tutorial we will be installing JDK 8. Run the following command to install JDK 8 on your server:

sudo yum install java-1.8.0-openjdk-devel

Verify the Java version by running the following command:

java -version

Step 3. Installing Gradle on CentOS.

Run the commands below to download Gradle, At the time of this writing, the version is 5.1:

wget https://services.gradle.org/distributions/gradle-5.1-bin.zip -P /tmp

Now unzip downloaded zip file using following command:

sudo unzip -d /opt/gradle /tmp/gradle-5.1.zip

Step 4. Setup environment variables.

PATH Environment variable should include Gradle directory. So we should create gradle.sh file inside /etc/profile.d/ directory. To create file run following command:

sudo nano /etc/profile.d/gradle.sh

Now paste following code inside above file:

export GRADLE_HOME=/opt/gradle/gradle-5.1
export PATH=${GRADLE_HOME}/bin:${PATH}

Then, make script file executable using following command:

sudo chmod +x /etc/profile.d/gradle.sh

Load the environment variables using following command:

source /etc/profile.d/gradle.sh

Step 5. Verify the Gradle installation.

You can run the following command to check if the Gradle install was successful:

gradle -v

You should see the following output:

Welcome to Gradle 5.1!

Here are the highlights of this release:
 - Kotlin DSL 1.0
 - Task timeouts
 - Dependency alignment aka BOM support
 - Interactive `gradle init`

For more details see https://docs.gradle.org/5.1/release-notes.html

------------------------------------------------------------
Gradle 5.1
------------------------------------------------------------

Build time:   2018-12-16 11:48:43 UTC
Revision:     e0824aec8a0f5462fc5fd9872664dbc7fc6e5abf

Kotlin DSL:   1.0.4
Kotlin:       1.3.10
Groovy:       2.5.4
Ant:          Apache Ant(TM) version 1.9.13 compiled on January 29 2019
JVM:          1.8.0_181 (Oracle Corporation 25.181-b13)
OS:           Linux 4.15.0-36-generic amd64

Congratulation’s! You have successfully install Gradle. Thanks for using this tutorial for installing Gradle on CentOS 7 system. For additional help or useful information, we recommend you to check the official Gradle website.

How To Install PyCharm on CentOS 7 Step by Step

Install PyCharm on CentOS 7

PyCharm is an IDE for Python development and has been considered as one of the best Python IDE by the experts. The IDE comes with professional and community edition. The community edition is free of cost, but professional edition has more features. In this tutorial we will learn how To Install PyCharm on CentOS 7.

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation PyCharm on a CentOS 7 server.

Install PyCharm on CentOS 7

Step 1. First, let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing PyCharm on CentOS.

Now we will download PyCharm using official PyCharm download page using wget command:

sudo wget https://download-cf.jetbrains.com/python/pycharm-professional-2018.3.2.tar.gz
tar -xvf pycharm-professional-2018.3.2.tar.gz
cd pycharm-professional-2018.3.2

Now to run PyCharm like normal programs you should create symbolic link using the following command:

sudo ln -s ./pycharm-community-2018.3.2/bin/pycharm.sh /usr/bin/pycharm

Step 3. Start PyCharm.

You can launch PyCharm using following command:

pycharm

Congratulation’s! You have successfully installed PyCharm. Thanks for using this tutorial for installing PyCharm on CentOS 7 system. For additional help or useful information, we recommend you to check the official PyCharm web site.

How to Install PhpStorm on CentOS 7 Step by Step

Install PhpStorm on CentOS 7

PhpStorm is an intelligent and fully featured IDE for PHP developed by JetBrains. It also provides support for Javascript, Typescript, and CSS etc. You can also extend PhpStorm features by using plugins. By using PhpStorm plugins you can also get support for frameworks like Laravel, CodeIgniter. We can also use PhpStrom for other programming languages like HTML, SQL, Javascript, CSS and more. In this tutorial we will learn how to Install PhpStorm on CentOS 7.

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation PhpStorm on a CentOS 7 server.

Install PhpStorm on CentOS 7

Step 1. First, let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing PhpStorm on CentOS.

Now, we will download PhpStorm using official PhpStorm download page using wget command:

sudo wget https://download-cf.jetbrains.com/webide/PhpStorm-2018.3.2.tar.gz
tar -xvf PhpStorm-2018.3.2.tar.gz
cd PhpStorm-2018.3.2

Now to run PhpStorm like normal programs you should create symbolic link using the following command:

sudo ln -s ./PhpStorm-2018.3.2/bin/phpstorm.sh /usr/bin/phpstorm

Step 3. Start PhpStorm.

You can launch PhpStorm using following command:

phpstorm

Congratulation’s! You have successfully installed PhpStorm. Thanks for using this tutorial for installing PhpStorm on CentOS 7 system. For additional help or useful information, we recommend you to check the official PhpStorm web site.

How to Install Linux Kernel 5.0 on CentOS 7

Install Linux Kernel 5.0 on CentOS 7

Linus Torvalds the creator and the principal developer of the Linux kernel announced the release of Linux kernel version 5.0. This release increases the major kernel version number to 5. from 4.x. The new change does not mean anything and does not affect programs in any way. In this tutorial we will learn how to Install Linux Kernel 5.0 on CentOS 7.

Prerequisites

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Linux Kernel 5.0 on a CentOS 7 server.

Install Linux Kernel 5.0 on CentOS 7

Step 1. First, let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing Linux Kernel 5.0 on CentOS.

ElRepo is a third-party repository for CentOS that allows upgrades to the latest kernel version from kernel.org. Add ELRepo repository to your CentOS 7 by running the commands below:

sudo yum install https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

Once the repository has been enabled, you can use the following command to list the available kernel.related packages:

yum --disablerepo="*" --enablerepo="elrepo-kernel" list available
kernel-ml.x86_64                        5.0.0-1.el7.elrepo         elrepo-kernel
 kernel-ml-devel.x86_64                  5.0.0-1.el7.elrepo         elrepo-kernel
 kernel-ml-doc.noarch                    5.0.0-1.el7.elrepo         elrepo-kernel
 kernel-ml-headers.x86_64                5.0.0-1.el7.elrepo         elrepo-kernel
 kernel-ml-tools.x86_64                  5.0.0-1.el7.elrepo         elrepo-kernel
 kernel-ml-tools-libs.x86_64             5.0.0-1.el7.elrepo         elrepo-kernel
 kernel-ml-tools-libs-devel.x86_64       5.0.0-1.el7.elrepo         elrepo-kernel

Now that we have confirmed availability of Linux Kernel 5.0, we can proceed to install it:

sudo yum --enablerepo=elrepo-kernel install kernel-ml

Also install kernel-ml-devel,kernel-ml-headers,kernel-ml-tools,perf:

sudo yum -y --enablerepo=elrepo-kernel install kernel-ml-{devel,headers,perf}

Finally, reboot your machine to apply the latest kernel, and then select latest kernel from the menu as shown:

sudo reboot

Congratulation’s! You have successfully installed Linux Kernel. Thanks for using this tutorial for installing Linux Kernel on CentOS 7 system. For additional help or useful information, we recommend you to check the official Linux Kernel website.

How To Install RubyMine on CentOS 7 Step by Step

Install RubyMine on CentOS 7

RubyMine is an all-new IDE for Ruby and Rails developers, developed by JetBrains (best known for Java IDE IntelliJ IDEA). RubyMine build upon the IntelliJ IDEA platform and brings together all of the essential features you expect of an IDE (editor, debugging tools, source control integration, code completion, and so forth) along with lots of extra goodies specific to Ruby, such as GUI-based support for RSpec and Test. In this tutorial we will learn how To Install RubyMine on CentOS 7.

Prerequisites: This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation RubyMine on a CentOS 7 server.

Install RubyMine on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing RubyMine on CentOS.

Download RubyMine using official RubyMine download page using wget command:

sudo wget https://download-cf.jetbrains.com/ruby/RubyMine-2018.3.2.tar.gz
tar -xvf RubyMine-2018.3.2.tar.gz
cd RubyMine-2018.3.2

Next, run RubyMine like normal programs you should create symbolic link using the following command:

sudo ln -s ./RubyMine-2018.3.2/bin/rubymine.sh /usr/bin/rubymine

After successful installation to start RubyMine via terminal run following command:

rubymine

Congratulation’s! You have successfully installed RubyMine. Thanks for using this tutorial for installing RubyMine on CentOS 7 systems. For additional help or useful information, we recommend you to check the official RubyMine website.

How To Install Jira on CentOS 7 Step by Step

Jira on CentOS 7 Step by Step

Jira is a tool used for defect/issue/bug tracking and project management purpose. JIRA Core is the JIRA application that has both system and application functionalities. It helps an administrator to create a project, user, workflow, issue etc. In this tutorial we will learn how To Install Jira on CentOS 7.

Prerequisites: This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root accge of Linount, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Jira on a CentOS 7 server.

Install Jira on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

yum clean all
yum -y update

Step 2. Installing Java.

JAVA is the first requirement for JIRA establishment. Verify you have JAVA SE 6 or Later form introduced in your framework:

sudo yum install java-1.8.0-openjdk
sudo yum install java-1.8.0-openjdk-devel

If installation is success, you see the following output:

$ java -version
openjdk version "1.8.0_201"
OpenJDK Runtime Environment (build 1.8.0_281-b09)
OpenJDK 64-Bit Server VM (build 28.201-b09, mixed mode)

Step 3. Installing Jira on CentOS.

Download the latest JIRA Installer (.bin) file from the JIRA official page or given link to directory /opt:

cd /opt
wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-7.3.0-x64.bin

Then, give the execute permission to .bin file and install JIRA:

chmod +a atlassian-jira-software-7.3.0-x64.bin
./atlassian-jira-software-7.3.0-x64.bin

Step 4. Install MySQL.

The latest version of MySQL is version 8.0. To install it on your CentOS 7 server follow the steps below:

sudo yum localinstall https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm

Install MySQL 8.0 package with yum:

sudo yum install mysql-community-server

Once the installation is completed, start the MySQL service and enable it to automatically start on boot with:

sudo systemctl enable mysqld
sudo systemctl start mysqld

Run the mysql_secure_installation command to improve the security of your MySQL installation:

sudo mysql_secure_installation

Step 5. Connectivity to JIRA with MySQL.

Create a database user for JIRA using following command:

$ mysql -u root -p
CREATE DATABASE jiradb CHARACTER SET utf8 COLLATE utf8_bin;
grant all privileges on jiradb.* to 'jira'@'%' identified by '';
flush privileges;
exit

After you installing the JIRA, you require MySQL Connector driver. You can download either the .tar.gz or the .zip file from official site. Otherwise, you can use the following command:

cd /opt
wget http://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.35.tar.gz
tar -zxvf mysql-connector-java-5.1.35.tar.gz

Copy the MySQL JDBC driver jar file to the JIRA installation directory /opt/atlassian/jira/lib/:

cd /opt/mysql-connector-java-5.1.35
cp mysql-connector-java-5.1.35-bin.jar /opt/atlassian/jira/lib/

To restart Jira service:

cd /opt/atlassian/jira/bin/
./shutdown.sh
./startup.sh

Step 6. Configure firewall.

By default, it will be port 8080:

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

Step 7. Accessing JIRA.

After you successful installation Jira, login URL is displayed and use it to login:

http://server-ip:8080
or
http://server-hostname:8080

Congratulation’s! You have successfully installed Jira. Thanks for using this tutorial for installing Jira on CentOS 7 systems. For additional help or useful information, we recommend you to check the official Jira website.