zoukankan      html  css  js  c++  java
  • 系统初始化操作

    都是根据自己实际情况选择,没有什么好与不好,所有的yum操作可能会因为网络跟解析问题失败,需要多试几次,都是可行的

    1.增加history时间显示

    vim /etc/bashrc最后追加

    export HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " 
    export HISTSIZE=9999

    2.ssh禁止DNS反解

    vim /etc/ssh/sshd_config
    UseDNS no

    3.关火墙跟selinux

    service iptables stop
    chkconfig iptables off

    iptables -F

    service ip6tables stop
    chkconfig ip6tables off

    ip6tables -F

    systemctl stop firewalld(7)
    chkconfig firewalld off

    vim /etc/sysconfig/selinux
    selinux=disabled

    4.yum源

    这个其实自己有源镜像传上去用是最好的,但是可能只是想封装下一些常用软件进去所以想暂时指向下网络源,6.4的源163的用不了了我用的阿里的,剩下的应该没问题

    sed -i s/gpgcheck=1/gpgcheck=0/g /etc/yum.repos.d/*

    6.4阿里源repo,能联网直接复制就可用

    # CentOS-Base.repo
    #
    # The mirror system uses the connecting IP address of the client and the
    # update status of each mirror to pick mirrors that are updated to and
    # geographically close to the client. You should use this for CentOS updates
    # unless you are manually picking other mirrors.
    #
    # If the mirrorlist= does not work for you, as a fall back you can try the
    # remarked out baseurl= line instead.
    #
    #

    [base]
    name=CentOS-$releasever - Base - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
    http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
    gpgcheck=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

    #released updates
    [updates]
    name=CentOS-$releasever - Updates - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
    http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
    gpgcheck=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

    #additional packages that may be useful
    [extras]
    name=CentOS-$releasever - Extras - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
    http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
    gpgcheck=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

    #additional packages that extend functionality of existing packages
    [centosplus]
    name=CentOS-$releasever - Plus - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
    http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
    gpgcheck=0
    enabled=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

    #contrib - packages by Centos Users
    [contrib]
    name=CentOS-$releasever - Contrib - mirrors.aliyun.com
    failovermethod=priority
    baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
    http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
    #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
    gpgcheck=0
    enabled=0
    gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

    5.gcc

    yum install gcc gcc-c++ -y(总会失败,因为解析的问题,多弄几次,这个是可以直接安装的)

    6.sar

    yum install sysstat -y(里面会带有sar)

    7.nmon

    去https://pkgs.org/search/?query=nmon&type=smart找自己对应版本的rpm扔上去直接rpm -ivh XXXX即可

    8.安装中文字符集,重启后才有用

    yum -y groupinstall chinese-support

    vim /etc/sysconfig/i18n修改成

    LANG="zh_CN.UTF-8"
    SUPPORTED="zh_CN:zh:en_US.UTF-8:en_US:en:zh_CN.GB18030"
    SYSFONT="latarcyrheb-sun16"

    9.把语言切换成英语

    localectl set-locale LANG=en_US.UTF-8

  • 相关阅读:
    推荐谷歌浏览器12款常用的扩展
    推荐谷歌浏览器12款常用的扩展
    推荐VSCode12个比较实用的插件
    推荐VSCode12个比较实用的插件
    Linux中Shell循环结构for用法笔记
    django之上传图片
    django之中间件设置
    django之admin站点
    django之管理静态文件
    django之设置分页
  • 原文地址:https://www.cnblogs.com/bfmq/p/6047524.html
Copyright © 2011-2022 走看看