CentOS 7 experience
First, let's talk about the original intention of writing this blog.
Because the company's products in this phase support CentOS 7, MySql 5.6, Java 8, Tomcat 8, and so on, and due to serious shortage of personnel, I added a lot of environmental verification work to my development task this month on the basis of the original one.
I would like to record the difficulties encountered in this environmental verification process.
Important: record the differences between CentOS 7 and the past
1. Disable ifconfig and use ip addr to view the ip address.
2. Replace iptables with firewalld.
3. The default encoding setting file is changed from/etc/sysconfig/i18n to/etc/locale. conf.
Because your computer is a combination of Windows 8.1 + Ubuntu 14, you are familiar with most Linux commands. However, in the face of CentOS 7, I found that the past Linux experience has become the biggest obstacle to me.
Let me spit out the evil CentOS 7:
First of all, I installed CentOS 7 on a CD as usual, and the progress seems to be smooth. The next step is the beginning of the pain. After installing the system, I am going to use XShell to remotely manage CentOS, but I need to know the IP address. So I use ifconfig to view the IP address,
※Here, because the company's products are mainly sold in Japan, the default language of the product runtime environment is Japanese.
I'm going. What's the situation? Did I make a mistake? I checked every letter carefully. That's right !!! After that, the longitude Niang was confused. CentOS 7 canceled ifconfig and changed it to ip addr to view the ip address. The command is as follows:
Because the system automatically obtains the network connection settings during installation, it is first changed to a static IP address. The configuration method is as follows:
Step 1: vi/etc/sysconfig/network-scripts/ifcfg-enp0s25;
Settings:
Explanation:
IPADDR0 --> ip
GATEWAY0 --> Gateway
DNS1 --> DNS
Step 2: restart the network service --> service network restart (especially important, do not forget .)
Step 3. Check the ipip addr and ping the network. The network configuration is complete.
It seems that the process is not difficult here. I began to configure the firewall. First, use iptables status to view the Firewall status,
I'm going, what? I typed it wrong? I checked every letter carefully once. That's all right !!! In any case, check whether the iptables script still exists.
The iptables script is missing. Don't think about it. CentOS 7 must have used a new firewall. Baidu immediately.
※Du Niang: CentOS 7 replaces iptables with firewalld. Use the command line tool firewalld-cmd to get the firewalld status, $ firwall-cmd -- state.
If the readers and friends do not know about FirewallD, please use Baidu, because I also learned about it when writing this blog.
Because I am not very familiar with FirewallD, I discuss in the group and decide whether to use iptables for the firewall.
※If you want to use iptables and ip6tables static firewall rules, install iptables-services and disable firewalld.
Disable firewalld commands:
Systemctlstartfirewalld. service # Start firewallsystemctlstopfirewalld. service # Stop firewallsystemctldisablefirewalld. service # disable firewall startup
Install iptables-services
yuminstalliptables-services
※Because there are already many tutorials for configuring iptables rules, we will not repeat them here. Readers can go to Baidu on their own.
Iptables rules: omitted
So far, I have been disgusted with CentOS 7, but it is not over yet.
Because of the time relationship, I wrote it here today, and I will make up the rest of the day.