[{"data":1,"prerenderedAt":61},["ShallowReactive",2],{"article-51":3},{"code":4,"msg":5,"data":6,"count":14},200,"查询成功",{"id":7,"title":8,"keywords":9,"description":10,"category_id":11,"content":12,"body_html":13,"thumb_up":14,"clicks":15,"sort":14,"remark":16,"status":17,"is_open":17,"is_deleted":14,"is_top":14,"is_recommend":14,"create_time":18,"update_time":19,"image_id":20,"url":13,"member_id":14,"cate_name":21,"prev":22,"next":25,"tags":28,"words":34,"read_time":35,"comments":14,"cover":36,"relevant":37},51,"Centos7安装后修改yum和epel源","centos7,Linux","本文介绍虚拟机安装Centos7后，修改yum和epel的源为国内yum源和epel源",4,"###### centos7安装后一系列的修改\n\n配置国内yum源和epel源\n\n1、新建repo_bak目录，将原来的repo文件移到新建目录中\n\n```bash\ncd \u002Fetc\u002Fyum.repos.d\u002F\nmkdir repo_bak\nmv *.repo repo_bak\u002F\n```\n\n2、配置使用网易和阿里的开源镜像\n\n```bash\nwget http:\u002F\u002Fmirrors.aliyun.com\u002Frepo\u002FCentos-7.repo\nwget http:\u002F\u002Fmirrors.163.com\u002F.help\u002FCentOS7-Base-163.repo\nls\n#结果显示\nCentos-7.repo  CentOS-Base-163.repo  repo.bak\n```\n\n3、清除yum缓存重新生成新的yum缓存\n\n```bash\nyum clean all #清除所有的缓存\n#结果显示\nLoaded plugins: fastestmirror\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nCleaning repos: base extras updates\nCleaning up list of fastest mirrors\nyum makecache #生成yum缓存\n```\n\n结果显示\n\n![9](https:\u002F\u002Ftp.myong.top\u002Fstorage\u002Fckeditor\u002F20190326\u002F89759497168734009d2994a6e30fd30c.jpg)\n\n4、安装epel源\n\n```bash\nyum list | grep epel-release\nRepository base is listed more than once in the configuration\nRepository updates is listed more than once in the configuration\nRepository extras is listed more than once in the configuration\nRepository centosplus is listed more than once in the configuration\nepel-release.noarch                       7-11                        extras \nyum install -y epel-release\n#结果显示\n```\n\n![10](https:\u002F\u002Ftp.myong.top\u002Fstorage\u002Fckeditor\u002F20190326\u002F06b03733613da29644555044b91d966c.jpg)\n\n5、配置阿里云epel源\n\n```bash\n# 下载阿里开源镜像的epel源文件\nwget -O \u002Fetc\u002Fyum.repos.d\u002Fepel-7.repo http:\u002F\u002Fmirrors.aliyun.com\u002Frepo\u002Fepel-7.repo \n```\n\n结果显示\n\n![11](https:\u002F\u002Ftp.myong.top\u002Fstorage\u002Fckeditor\u002F20190326\u002Fc9b9ad1adf15c1c8453e5055bafed035.jpg)\n\n6、再次清楚yum缓存，并重新生成yum缓存\n\n![12](https:\u002F\u002Ftp.myong.top\u002Fstorage\u002Fckeditor\u002F20190326\u002F22c3ef9b49df32bea5415826b3042cdb.jpg)\n\n7、查看系统可用的yum源以及所有yum源\n\n```bash\nyum repolist enabled #查询可用的源\nyum repolist all#查询所有的源\n```\n\n![13](https:\u002F\u002Ftp.myong.top\u002Fstorage\u002Fckeditor\u002F20190326\u002Fd661bcc50d3b3356fb03730c021eccb6.jpg)\n\n至此 配置yum和epel源结束\n\n###### 9 每天自动更新配置\n\n手动更新所有预先安装得软件\n\n```bash\nyum -y update\n```\n\n设定系统定时自动更新，确定服务器是否安装了自动执行指令得工具\n\n安装 cron和anacron\n\n```bash\nyum -y install cronie\nyum -y install yum-cron\n```\n\n完成后系统多了数个档案，比较重要的包括：\n\n```bash\n\u002Fetc\u002Fcron.daily\u002F0yum.cron\n#每天执行这个档案一次，它根据配置档案 \u002Fetc\u002Fyum\u002Fyum-cron.conf 来更新软件\n\u002Fetc\u002Fyum\u002Fyum-cron.conf\n#这是每天执行yum-cron的配置档案，默认只会下载更新的软件，并不安装，用意是让管理员检视yum-cron的输出，选取需要更新的软件进行手动安装。\n\n```\n\n10、修改配置\n\n```bash\nvim \u002Fetc\u002Fyum\u002Fyum-cron.conf\n\n```\n\n寻找：\n\n```bash\napply_updates=no \n#修改为\napply_updates=yes\n#确认一下参数一致\nupdate_messages=yes\ndownload_updates=yes\napply_updates=yes\n\n```\n\n启动crond和yum-cron\n\n```bash\nsystemctl start crond\nsystemctl start yum-cron\n\n```\n\n7、防火墙\n\n安装防火墙\n\n```bash\nyum install firewalld\n\n```\n\n查看防火墙启用的端口\n\n```bash\nfirewall-cmd --list-all\n\n```\n\n\n\n",null,0,482,"",1,"2019-03-26 20:46:36","2026-04-19 14:47:11",127,"Linux",{"id":23,"title":24},50,"虚拟机安装Centos7后配置网络",{"id":26,"title":27},52,"Python语言对MongoDB的相关操作",[29,32],{"id":30,"name":31},37,"Centos7",{"id":33,"name":21},39,2025,5,"https:\u002F\u002Ftp.myong.top\u002Fstorage\u002Farticle\u002Fde\u002F36593248f37397d88a6a0d873ebaad.jpg",[38,43,46,51,56],{"id":39,"title":40,"create_time":41,"description":42},53,"Linux环境下Apahce的调优","2019-05-21 14:04:03","整理了部分有关Apahce调优的配置说明，后续陆续的将所有调优方式更新。",{"id":23,"title":24,"create_time":44,"description":45},"2019-03-26 20:37:33","VMware虚拟机上安装min版的Centos7，并配置网络。虚拟机和centos7的安装在本文不做相关的介绍。",{"id":47,"title":48,"create_time":49,"description":50},85,"Linux环境PHP解压缩ZipArchive中的extractTo()方法，解压zip时文件丢失的问题","2020-04-30 17:17:44","在实际项目中要用ZipArchive解压ZIP文件，起初測试环境在Win环境中，測试通过，换到 LINUX 的环境中时  就出问题了（ZIP包中有文件和目录，包含带汉字的文件名称）\r\n\r\n问题的现象是：不带汉字的文件解压没有问题，另外有部分带汉字和数字字母的文件解压没有问题，然后其它纯文字的文件名称就丢失了，也没有报错，最后把问题定位到了extractTo()方法，这种方法是个封装的方法，看不到实际的源码。 \r\n\r\n经Google一番后，发现使用` getNameIndex `和` numFiles `",{"id":52,"title":53,"create_time":54,"description":55},78,"Centos7安装Docker","2019-12-28 14:17:23","### 安装docker\n\n安装命令\n\n``` bash\nyum install docker\n```\n\n启动docker并设置为开机启动\n\n``` bash\nservice docker start\nchkconfig docker on\n```\n\nLCTT 译注：此处采用了旧式的 sysv 语法，如采用CentOS 7中支持的新式 systemd 语法，如下：\n\n``` bash\nsystemcty start docker.service\nsystemcty enable docker.s",{"id":57,"title":58,"create_time":59,"description":60},21,"Cenos7.2下安装Apache2.4，MySQL5.7和PHP7.1","2019-01-17 22:48:15","一、主要软件：1、SecureCRT 5.1：是一款支持SSH（SSH1和SSH2）的终端仿真程序，简单地说是Windows下登录UNIX或Linux服务器主机的软件。2、WinSCP：是一个Windows环境下使用SSH的开源图形化SFTP客户端。同时支持SCP协议。它的主要功能就是在本地与远程计算机间安全的复制文件。winscp也可以链接其他系统,比如linux系统。以上两款软件的具体使用可以通过搜索引擎分分钟查到。",1783431664937]