系统优化方法(基础优化)了解系统环境
#两个命令
cat /etc/redhat-release 查看系统信息
uname -r 查看内核版本
lsb_release -a 查看发行版本
命令提示符优化(修改提示符颜色)
#设置环境变量:export PS1
export PS1=’[\e[32;1m][\u@\H\W]$[\e[0m]’
yum源下载的优化
#外网优化
ls /etc/yum.repos.d/
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
优化扩展yum源文件
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum repolist 检查可用的yam源文件
系统安全相关优化(将一些安全服务进行关闭)
centos6
cat /etc/init.d/iptables status 查看防火墙状态
service iptables stop 临时关闭防火墙服务
chkconfig iptables off 永久关闭防火墙
centos7
systemctl status firewalld
systemctl disable firewalld 永久关闭防火墙
systemctl stop firewalld 临时关闭防火墙
系统的selinux服务程序
永久关闭 : vi /etc/selinux/config
SELINUX=disabled
系统中字符编码设置方法
centos6
echo $LANG 设置字符编码信息
临时修改:LANG=en_US.GGG
永久修改:vi /etc/profile
加入:export LANG=‘en_US.UTF-8’
vi /etc/sysconfig/i18n
centos7
vi /etc/profile
export LANG=‘zh_.CN.UTF-8’
vi /etc/locale.conf
LANG= “zh__CN.UTF-8”
使xshell软件远程连接速度加快
vi /etc/ssh/sshd_config
:set nu
79改为 GSSAPIAuthentication no
115改为 UseDNS no
修改主机名称
hostnamectl set-hostname jackie
配置网卡文件
net.ifnames=0 biosdevname=0
#vi /etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR =10.0.0.200
DNS1=8.8.8.8
GATEWAY=10.0.0.2
NETMASK=255.255.255.0
#vi /etc/resolv.conf
nameserver 255.255.255.0
#nmtui