博客
关于我
centos初始化配置工作
阅读量:203 次
发布时间:2019-02-28

本文共 919 字,大约阅读时间需要 3 分钟。

centos 配置网卡

  1. 进入网卡文件夹
    cd /etc/sysconfig/network-scripts
    我的网卡信息
  2. 查看网卡名称,我这里网卡名称是 ifcfg-ens33
  3. vim ifcfg-ens33 编辑该网卡
  4. BOOTPROTO=DHCP改为BOOTPROTO=static
  5. ONBOOT=no改为ONBOOT=yes
  6. 增加IP地址IPADDR=192.168.1.80
  7. 增加子网掩码NETMASK=255.255.255.0
  8. 增加网关GATEWAY=192.168.1.1
  9. 增加DNSDNS1=114.114.114.114
  10. 也可再增加一个DNSDNS2=8.8.8.8
  11. 配置如图我的网卡配置

centos 配置yum源

一条命令完成yum源配置
  • \cp -r /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup && curl -fsSL 'http://mirrors.163.com/.help/CentOS7-Base-163.repo' -o /etc/yum.repos.d/CentOS-Base.repo && yum clean all && yum makecache
也可使用以下方式逐步配置yum源
  1. 访问163域名配置yum源
    http://mirrors.163.com/.help/centos.html
  2. 首先备份 /etc/yum.repos.d/CentOS-Base.repo
    mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
  3. 下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
  4. 运行以下命令生成缓存
    yum clean all
    yum makecache
流程如图:

在这里插入图片描述

关闭selinux

  • sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config 使用命令关闭防火墙
  • reboot 重启主机

转载地址:http://hasi.baihongyu.com/

你可能感兴趣的文章
nginx+uwsgi+django
查看>>
nginx+vsftp搭建图片服务器
查看>>
Nginx-http-flv-module流媒体服务器搭建+模拟推流+flv.js在前端html和Vue中播放HTTP-FLV视频流
查看>>
nginx-vts + prometheus 监控nginx
查看>>
Nginx/Apache反向代理
查看>>
Nginx: 413 – Request Entity Too Large Error and Solution
查看>>
nginx: [emerg] getpwnam(“www”) failed 错误处理方法
查看>>
nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /usr/local/nginx/conf/nginx.conf:
查看>>
nginx: [error] open() “/usr/local/nginx/logs/nginx.pid“ failed (2: No such file or directory)
查看>>
nginx:Error ./configure: error: the HTTP rewrite module requires the PCRE library
查看>>
Nginx:objs/Makefile:432: recipe for target ‘objs/src/core/ngx_murmurhash.o‘解决方法
查看>>
nginxWebUI runCmd RCE漏洞复现
查看>>
nginx_rtmp
查看>>
Nginx、HAProxy、LVS
查看>>
nginx一些重要配置说明
查看>>
Nginx下配置codeigniter框架方法
查看>>
Nginx与Tengine安装和使用以及配置健康节点检测
查看>>
Nginx中使用expires指令实现配置浏览器缓存
查看>>
Nginx中使用keepalive实现保持上游长连接实现提高吞吐量示例与测试
查看>>
Nginx中实现流量控制(限制给定时间内HTTP请求的数量)示例
查看>>