30 things to be done after CentOS 7

Source: Internet
Author: User

30 things to be done after CentOS 7

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

1. Register and enable Red Hat subscription

After the RHEL 7 minimal installation is complete, you should register and enable the system Red Hat subscription library and execute a complete system update. This is only useful when you have an available Red Hat subscription. You must register to enable the official Red Hat system library and update the operating system from time to time. (LCTT: The subscription service is charged)

The following guide describes how to register and activate a red hat subscription.

  • Register and enable Red Hat subscription in RHEL 7

Note: This step is only applicable to a Red Hat Enterprise Edition Linux with a valid subscription. If you are using a CentOS server, see the following section.

2. Use a static IP address to configure the network

The first thing you need to do is configure static IP addresses, routes, and DNS for your CentOS server. We will use the ip command instead of the ifconfig command. Of course, the ifconfig command is still available for most Linux distributions and can be installed from the default library.

# Yuminstallnet-tools [It provides ifconfig tool. If you are not familiar with ip commands, you can also use it]

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

#ipaddrshow

Now open and edit the file/etc/sysconfig/network-scripts/ifcfg-enp0s3 in your editor. Here, I use the vi editor, and make sure that you are the root user to save the changes.

#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.

IPADDR = "[enter your static IP here]" GATEWAY = "[enter your default GATEWAY]" DNS1 = "[Your DNS1]" DNS2 = "[Your DNS2]"

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.

#servicenetworkrestart

Restart NETWORK SERVICE

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

#ipaddrshow#ping-c4google.com

Verify IP Address

Check Network Status

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.

#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.

#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.

$echo$HOSTNAME

Confirm Host Name

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

$hostname
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.

#yumupdate&&yumupgrade

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.

#yum-yupdate&&yum-yupgrade
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.

#yuminstalllinks

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.

#yuminstallhttpd

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:

LISTEN80

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 ).

#firewall-cmd–add-service=http

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

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

Reload the firewall.

#firewall-cmd–reload

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

#systemctlrestarthttpd.service

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

#systemctlstarthttpd.service#systemctlenablehttpd.service

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

#links127.0.0.1

Reprinted please keep a fixed link: http://www.linuxeye.com/Linux/2459.html

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.