Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Installation and configuration of centos

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

When you first install CentOs, there are a few more things you need to do to make better use of the operating system.

Close selinux

Selinux is indeed very powerful software, but it is too complex, and it is also above root, root can not break through his limitations. So, he usually goes to shut him down. The way to shut him down is very simple. Find the configuration file.

Vi / etc/sysconfig/selinux

Change enforcing to disabled.

Turn off the firewall

It is generally recommended to turn off the firewall function when learning to use centOS. Of course, if you know how to use a firewall, it's a different matter. If the firewall is not turned off, the external ports of the server, such as 80,443, will not be open. Turning off the firewall is also very simple, as long as the following commands are needed:

Systemctl stop firewalldsystemctl disable firewalldsystemctl stop iptablessystemctl disable iptables

The disable option means to turn off the software the next time you restart it.

Configure static IP

First find the configuration file. CentOS is usually found in / etc/sysconfit/network-scripts/ifcfg-etho.

DEVICE=eth0HWADDR=00:0C:29:F5:1D:6ATYPE=EthernetUUID=8f49ebc2-5b1b-4135-863b-6acb0c84453fONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=static IPADDR=192.168.179.13 NETMASK=255.255.255.0GATEWAY=192.168.179.2DNS1=192.168.179.2

There are a few points to pay attention to

BOOTPROTO should be set to static, which means static ip

ONBOOT needs to be set to ON, which means to enable it.

IPADDR represents the ip address

NETMASK represents the subnet mask

GATEWAY represents the gateway address

DNS, if you want to connect to the public network, you need to set up DNS.

After setting up, restart the network card and test whether it is normal or not.

/ etc/init.d/network restart

Use the ping command to ping the gateway address and the public network address to see if it is normal.

Set up the language family

Sometimes after installing the linux system, the language family may be Chinese, it is recommended to change to English, many Chinese explanations are not accurate. In addition, it may have an impact on you writing shell scripts.

Check which languages are supported by the system

# locale-aaa_DJaa_DJ.iso88591aa_DJ.utf8aa_ERaa_ER@saahoaa_ER.utf8.

View the current language family

# echo $LANGen_US.UTF-8

As you can see, the language family currently used on my server is en_US.UTF-8. This is also the language family I recommend.

Revise the language family at 00:00

LANG=zh_CN.UTF-8

Permanently modify the language family and find the configuration file

Vim / etc/locale.conf

Then, change to the language family you want.

Install gcc, wget and other softwar

In Centos, you use yum to install software online, but only if there is no problem with your yum source. Generally speaking, the yum of the newly installed system is normal, and the common yum sources are Ali and NetEase. With the tool yum, it is very easy to install the software.

Yum install gcc wget git

And then keep typing y and we're done.

These are the details of installing centos for some basic configuration for the first time, please pay attention to other related articles for more!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report