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.
- Register and enable Red Hat subscription
- Use a static IP address to configure the network
- Set the Host Name of the server
- Update or upgrade CentOS to minimize Installation
- Install the command line Web browser
- Install Apache HTTP Server
- Install PHP
- Install MariaDB Database
- Install and configure the SSH server
- Install GCC (GNU Compiler set)
- Install Java
- Install Apache Tomcat
- Install Nmap to check open ports
- Configure Firewall
- Install Wget
- Install Telnet
- Install Webmin
- Enable third-party library
- Install the 7-zip Tool
- Install NTFS-3G driver
- Install Vsftpd FTP Server
- Install and configure sudo
- Install and enable SELinux
- Install Rootkit Hunter
- Install Linux Malware Detect (LMD)
- Use Speedtest-cli to test server bandwidth
- Configure a Cron job
- Install Owncloud
- Enable VirtualBox Virtualization
- 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.
# 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.
# 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 address here]"
GATEWAY = "[enter your default GATEWAY]"
DNS1 = "[your DNS 1]"
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.
# service network restart
Restart NETWORK SERVICE
After the network is restarted, check the IP address and network status.
# ip addr show
# 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.
# 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
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.
# 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.
# 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.
# 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.
# 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:
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 ).
# 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
(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.
# systemctl restart httpd.service
Add the Apache service to the system layer so that it can be automatically started with the system.
# systemctl start httpd.service
# 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.
# links 127.0.0.1
Verify Apache status
This article permanently updates the link address: