Rhel/centos 7 Minimum of 30 things to do after installation

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

Guide CentOS is an industry-standard Linux distribution and is a derivative version of Red Hat Enterprise Linux. You can use it immediately after installation, but in order to better use your system, you need to do some upgrades, install new packages, configure specific services and applications, and so on.

When reading a post, please complete the Rhel/centos minimum installation, which is the preferred enterprise and production environment. If not yet, you can follow the guidelines below and it will show you the minimum installation method for both.

    • Minimal installation of CentOS 7
    • Minimize installation of RHEL 7

We will describe these important tasks listed below based on the requirements of industry standards. We hope these things will help you when you configure the server.

    1. Register and enable Red Hat subscriptions
    2. Configure a network with a static IP address
    3. Set the host name of the server
    4. Update or upgrade a minimized installation of CentOS
    5. Install the command line Web browser
    6. Install Apache HTTP Server
    7. Install PHP
    8. Installing the MARIADB Database
    9. Installing and configuring the SSH server
    10. Installing GCC (GNU compiler Set)
    11. Installing Java
    12. Installing Apache Tomcat
    13. Install Nmap Check open port
    14. Configuring firewalls
    15. Installing Wget
    16. Install Telnet
    17. Installing Webmin
    18. Enable third-party libraries
    19. Installing the 7-zip tool
    20. Installing the NTFS-3G Drive
    21. Installing the VSFTPD FTP server
    22. Installing and configuring sudo
    23. Install and enable SELinux
    24. Installing Rootkit Hunter
    25. Install Linux Malware Detect (LMD)
    26. Testing server bandwidth with SPEEDTEST-CLI
    27. Configure Cron Jobs
    28. Installing Owncloud
    29. Enable VirtualBox Virtualization
    30. Protect GRUB with a password
1. Register and enable Red Hat subscriptions

After the RHEL 7 mini-Setup is complete, you should register and enable the system Red Hat subscription library and perform a full system update. This is only useful if you have a Red Hat subscription available. You need to register to enable the official Red Hat system library and occasionally perform operating system updates. (LCTT: Subscription service is chargeable)
Note : This step applies only to Red Hat Enterprise Linux, which has a valid subscription. If you are using a CentOS server, see the sections that follow.

2. Configure the network with a static IP address

The first thing you need to do is configure a static IP address, routing, 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.

# yum Install Net-tools [it provides ifconfig tools, if you are not accustomed to IP commands, you can also use it]

But as I said before, we use IP commands to configure static IP addresses. So, confirm that you first checked the current IP address.

# IP Addr Show

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

# VI/ETC/SYSCONFIG/NETWORK-SCRIPTS/IFCFG-ENP0S3

We will edit four places in the file. Pay attention to the following four places and make sure you don't touch anything else. Also keep double quotes, and enter your data in the middle of them.

ipaddr = "[Enter your static IP here]" gateway = "[Enter your default gateway]" DNS1 = "[Your DNS 1]" DNS2 = "[Your DNS 2]"

After changing the ' ifcfg-enp0s3 ', it looks like the picture below. Note that your IP, gateway and DNS may change, please check with your ISP (translator Note: Internet service provider, which provides you with access to the service of telecommunications or IDC). Save and exit.

Restart the network service and check that the IP is the same as assigned. If everything goes well, check the network status with Ping.

# Service Network Restart

After restarting the network, verify that the IP address and network status are checked.

# IP Addr show# ping-c4 google.com

3. Set the host name of the server

The next step is to change the host name of the CentOS server. View the currently assigned host name.

# echo $HOSTNAME

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

After you have set the host name, be sure to log off and re-login to confirm the host name. Check the new host name after logging in.

$ echo $HOSTNAME

You can also use the ' hostname ' command to view your current hostname.

$ hostname
4. Update or upgrade a minimized installation of CentOS

This does not install any new software except for updates to the latest version of the software installed and for security upgrades. In general, updates (update) and upgrades (upgrade) are the same, except for the fact that the upgrade = update + update is deprecated.

# Yum update && yum upgrade

Important : You can also run the following command, which does not prompt for software updates, and you do not need to enter ' Y ' to accept the changes.
However, it is always a good idea to look at the changes that occur on the server, especially in production. So using the commands below can be automatically updated and upgraded for you, but not recommended.

# yum-y update && yum-y upgrade
5. Install the command line Web browser

In most cases, especially in production environments, we usually install CentOS with a command line without a GUI, in which case we must have a command-line browse tool that can view the site through the terminal. To achieve this, we intend to install the famous tool called ' Links '.

# Yum Install links

6. Install Apache HTTP Server

Regardless of why you use the server, in most cases you will need an HTTP server to run Web sites, multimedia, user-side scripts, and many other things.

# yum Install httpd

If you want to change the Apache HTTP server's default port number (80) to a different port, you need to edit the configuration file '/etc/httpd/conf/httpd.conf ' and look for the line starting with the following:

LISTEN 80

Change the port number ' 80 ' to any other port (for example, 3221), Save and exit.

Add the port that you just assigned 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 No. 3221 to pass through the firewall (permanent).

# FIREWALL-CMD–PERMANENT–ADD-PORT=3221/TCP

Reload the firewall.

# Firewall-cmd–reload

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

# systemctl Restart Httpd.service

Now add the Apache service to the system layer so that it starts automatically with the system.

# Systemctl start httpd.service# systemctl enable Httpd.service

As shown, verify the Apache HTTP server with the Links command-line tool.

# links 127.0.0.1

Rhel/centos 7 Minimum of 30 things to do after installation

Related Article

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.