30 things to be done after minimal RHEL/CentOS 7 installation (1)

Source: Internet
Author: User
Tags line web centos server linux malware detect ssh server

30 things to be done after minimal RHEL/CentOS 7 installation (1)

CentOS is an industrial standard Linux release and a derivative version of Red Hat Enterprise Edition Linux. You can use it immediately after installation. However, to make better use of your system, you need to perform operations such as upgrading, installing new software packages, and configuring specific services and applications.

This article introduces 30 things to be done after installing RHEL/CentOS 7 ". When reading this post, complete the RHEL/CentOS minimal installation. This is the preferred enterprise and production environment. If you do not have one, follow the instructions below and it will tell you how to minimize the installation of the two.

  • Minimal installation of CentOS 7
  • Minimal RHEL 7 Installation

We will introduce these important tasks listed below based on the requirements of industrial standards. We hope these things will be helpful when you configure the server.

  1. Register and enable Red Hat subscription
  2. Use a static IP address to configure the network
  3. Set the Host Name of the server
  4. Update or upgrade CentOS to minimize Installation
  5. Install the command line Web browser
  6. Install Apache HTTP Server
  7. Install PHP
  8. Install MariaDB Database
  9. Install and configure the SSH server
  10. Install GCC (GNU Compiler set)
  11. Install Java
  12. Install Apache Tomcat
  13. Install Nmap to check open ports
  14. Configure Firewall
  15. Install Wget
  16. Install Telnet
  17. Install Webmin
  18. Enable third-party library
  19. Install the 7-zip Tool
  20. Install NTFS-3G driver
  21. Install Vsftpd FTP Server
  22. Install and configure sudo
  23. Install and enable SELinux
  24. Install Rootkit Hunter
  25. Install Linux Malware Detect (LMD)
  26. Use Speedtest-cli to test server bandwidth
  27. Configure a Cron job
  28. Install Owncloud
  29. Enable VirtualBox Virtualization
  30. Use password to protect GRUB

For more information about CentOS/RHEL 7, refer to the topic :)

But as I said before, we will use ip commands to configure static IP addresses. Therefore, check the current IP address first.

  1. # ip addr show

Now open and edit the file/etc/sysconfig/network-scripts/ifcfg-enp0s3 in your editor (LCTT Note: Your Nic name may be different if you want to change to an older NIC name, reference :). Here, I use the vi editor, and make sure that you are the root user to save the changes.

  1. # vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

We will edit four parts in the file. Pay attention to the following four places and never touch anything else. Double quotation marks are also retained to input your data among them.

  1. IPADDR = "[enter your static IP address here]"
  2. GATEWAY = "[enter your default GATEWAY]"
  3. DNS1 = "[your DNS 1]"
  4. DNS2 = "[your DNS 2]"

After 'ifcfg-enp0s3' is changed, it looks like the image below. Note that your IP address, gateway, and DNS may change. Please confirm with your ISP (Internet Service Provider, that is, the telecom or IDC that provides you with the Access Service. Save and exit.

Network details

Restart the network service and check whether the IP address is the same as that allocated. If everything goes smoothly, use Ping to view the network status.

  1. # service network restart


After the network is restarted, check the IP address and network status.

  1. # ip addr show
  2. # ping -c4 google.com

Verify IP Address

Check Network Status

For more information about setting static IP addresses, see :)


3. Set the Host Name of the server

The next step is to change the Host Name of the CentOS server. View the name of the currently allocated host.

  1. # echo $HOSTNAME

View system Host Name

To set a new host name, we need to edit the '/etc/hostsname' file and replace the old host name with the desired name.

  1. # vi /etc/hostname

Set host name in CentOS

After the host name is set, log out and log on again to confirm the host name. Check the new host name after logging on.

  1. $ echo $HOSTNAME

Confirm Host Name

You can also run the 'hostname' command to view your current host name.

  1. $ hostname

For more information about setting static, transient, and flexible host names, see :)


4. Update or upgrade CentOS to minimize Installation

In addition to updating and installing the latest software version and security upgrade, no new software will be installed. In general, the update and upgrade are the same, except for the actual upgrade = update + update for disposal.

  1. # yum update && yum upgrade

Update CentOS servers with minimal installation

Important: You can also run the following command. This does not prompt software updates, and you do not need to enter 'y' to accept the changes.

However, it is always a good idea to view changes on the server, especially in production. Therefore, the following command is not recommended although it can be automatically updated and upgraded for you.

  1. # yum -y update && yum -y upgrade


5. Install the command line Web browser

In most cases, especially in the production environment, we usually use command lines without a GUI to install CentOS, in this case, we must have a command line browser that can view the website through a terminal. To achieve this goal, we plan to install the famous tool named 'links.

  1. # yum install links

Links: Command Line Web Browser

Please refer to our article and use the links tool command line to browse the Web to understand the methods and examples of using the links tool to browse the web.


6. Install the Apache HTTP Server

No matter why you use the server, in most cases, you need an HTTP server to run websites, multimedia, client scripts, and many other things.

  1. # yum install httpd

Install the Apache server

If you want to change the default port number (80) of the Apache HTTP Server to another port, You need to edit the configuration file '/etc/httpd/conf/httpd. conf 'and find the rows starting from the following:

  1. LISTEN 80

Change the port '80' to any other port (such as 3221), save and exit.

Change Apache Port

Add the port allocated to Apache through the firewall and then reload the firewall.

Allow http Services to pass through the firewall (permanent ).

  1. # firewall-cmd –add-service=http

Allow port 3221 to pass through the firewall (permanent ).

  1. # firewall-cmd –permanent –add-port=3221/tcp

Reload the firewall.

  1. # firewall-cmd –reload

(LCTT: for further use of firewall, refer to: And)

After completing all the preceding operations, it is time to restart the Apache HTTP server and then the new port number will take effect.

  1. # systemctl restart httpd.service

Add the Apache service to the system layer so that it can be automatically started with the system.

  1. # systemctl start httpd.service
  2. # systemctl enable httpd.service

(LCTT: for further use of systemctl, refer to: And)

As shown in, use the links command line tool to verify the Apache HTTP Server.

  1. # links

Verify Apache status

This article permanently updates the link address:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.