6步骤实现CentOS系统环境精简优化
![]() | ![]() | ![]() | ![]() |
| 【性价之王】 | 【线路之王】 | 【价格之王】 | 【配置之王】 |
| 【免费之王】 | 【香港首推】 | 【梯子之王】 | 【独服之王】 |

随着VPS主机使用的深化,蜗牛从开始使用面板工具操作VPS,再到后来的一键安装包,现在基本上能自学自用VPS管理网站/备份网站维护。但是需要深入的运维还需要时日,比如刚才看到一篇CentOS系统环境精简优化的文章还是值得分享的。但是在操作之前,最好建议在我们安装系统之后操作,而不要在有网站运行之后操作,以免系统出现问题。
第一步、删除不必要的自带软件包
yum remove Deployment_Guide-en-US finger cups-libs cups ypbindyum remove bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utilsyum remove sendmail* samba* talk-server finger-server bind* xinetdyum remove nfs-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtoolsyum remove syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-toolsyum groupremove \\\"Mail Server\\\" \\\"Games and Entertainment\\\" \\\"X Window System\\\" \\\"X Software Development\\\"yum groupremove \\\"Development Libraries\\\" \\\"Dialup Networking Support\\\"yum groupremove \\\"Games and Entertainment\\\" \\\"Sound and Video\\\" \\\"Graphics\\\" \\\"Editors\\\"yum groupremove \\\"Text-based Internet\\\" \\\"GNOME Desktop Environment\\\" \\\"GNOME Software Development\\\"第二步、升级centos系统
yum update #更新系统yum clean all #清理全部缓存文件第三步、禁用seLinux
sestatus #先执行看seLinux状态,如果不是disabled,就需要执行下面步骤,否则不要执行vi /etc/selinux/configSELINUX=disabled #禁用SeLinuxSELINUX=enforcing #使用SeLinux第四步、禁止IPV6(执行后需要reboot重启)
vi /etc/modprobe.conf #打开文件,把下面两行加到最后alias net-pf-10 offalias ipv6 off第五步、初始化防火墙
touch /etc/sysconfig/iptablesiptables -Fiptables -Xiptables -Zservice iptables saveservice iptables restart第六步、禁止无用服务
#! /bin/bashservice acpid offservice atd stopservice auditd stopservice avahi-daemon stopservice avahi-dnsconfd stopservice bluetooth stopservice conman stopservice cpuspeed stopservice cups stopservice dnsmasq stopservice dund stopservice firstboot stopservice hidd stopservice httpd stopservice ibmasm stopservice ip6tables stopservice irda stopservice kdump stopservice lm_sensors stopservice mcstrans stopservice messagebus stopservice microcode_ctl stopservice netconsole stopservice netfs stopservice netplugd stopservice nfs stopservice nfslock stopservice nscd stopservice ntpd stopservice oddjobd stopservice pand stopservice pcscd stopservice portmap stopservice psacct stopservice rdisc stopservice restorecond stopservice rpcgssd stopservice rpcidmapd stopservice rpcsvcgssd stopservice saslauthd stopservice sendmail stopservice setroubleshoot stopservice smb stopservice vncserver stopservice winbind stopservice wpa_supplicant stopservice xfs stopservice ypbind stopservice yum-updatesd stopchkconfig acpid offchkconfig atd offchkconfig auditd offchkconfig avahi-daemon offchkconfig avahi-dnsconfd offchkconfig bluetooth offchkconfig conman offchkconfig cpuspeed offchkconfig cups offchkconfig dnsmasq offchkconfig dund offchkconfig firstboot offchkconfig hidd offchkconfig httpd offchkconfig ibmasm offchkconfig ip6tables offchkconfig irda offchkconfig kdump offchkconfig lm_sensors offchkconfig mcstrans offchkconfig messagebus offchkconfig microcode_ctl offchkconfig netconsole offchkconfig netfs offchkconfig netplugd offchkconfig nfs offchkconfig nfslock offchkconfig nscd offchkconfig ntpd offchkconfig oddjobd offchkconfig pand offchkconfig pcscd offchkconfig portmap offchkconfig psacct offchkconfig rdisc offchkconfig restorecond offchkconfig rpcgssd offchkconfig rpcidmapd offchkconfig rpcsvcgssd offchkconfig saslauthd offchkconfig sendmail offchkconfig setroubleshoot offchkconfig smb offchkconfig vncserver offchkconfig winbind offchkconfig wpa_supplicant offchkconfig xfs offchkconfig ypbind offchkconfig yum-updatesd off这样通过上述6步骤,就可以完成对centos精简和优化。
猜你可能想看的VPS
- 樊云→40 元 月 2GB 内存 30GB SSD 空间 不限流量 10虚拟空间(主机)
- 两个官字是什么成语?全球[VPS测评]
- HostPapa→.com 域名 首年 0.99 美金 每账户限 5 个全球[VPS测评]
- UEditor 报错→Uncaught ReferenceError: 全球[VPS测评]
- 特价 桔子 VPS→洛杉矶 CN2 VPS 三网直连 回程 CN2 月付全球[VPS测评]
- 优惠 Hosteons→美国 1G 内存不限流量 VPS 三年付低至 8美国VPS[主机]
- 华为云→国内 香港云服务器秒杀 CPU 独享 1 核 2G 起 最高 1香港VPS[主机]
- servaRICA→$7 月 4 核 6GB 内存 80GB NVMe 虚拟空间(主机)
- Buyvm - 512M 内存 10G SSD 不限流量 KVM VPS全球[VPS测评]
- 新商家慎重-伏羲主机(6le)香港 cera 机房便宜 VPS 主机 1香港VPS[主机]
- Centos 下使用 find 命令查找指定时间内修改过的指定文件全球[VPS测评]
- 促销 恒创科技→香港虚拟主机 168 年起 新用户购买香港服务器最高减 香港VPS[主机]
- HostYun→9.9 元 月 512MB 内存 5GB SSD 空间 虚拟空间(主机)
- ExCloud→296 元 月 2G 内存 20GB SSD 空间 6T虚拟空间(主机)
- EGIHosting→圣何塞服务器每月 60 美元起 1G 无限流量服务全球[VPS测评]
- phoenixNAP→$90 月 E-2186G 32GB 内存 480全球[VPS测评]
- 限时 edgeNAT 愚人节专用套餐→8 核 8G 40G SSD 4M韩国VPS[主机]
- AkkoCloud上新圣何塞CN2GIA VPS 512M内存/10G硬全球[VPS测评]
- 【黑五】UltraVPS.eu-特价 vps 存储型 大硬盘全球[VPS测评]
- justhost-俄罗斯新西伯利亚-200Mbps 不限流量 8.5rm全球[VPS测评]
- Linux chown -R 指令介绍与使用全球[VPS测评]
- 性价比最高的VPS网络评测全球[VPS测评]
- 快速云:怎么连接vps?VPS的用途有哪些?全球[VPS测评]
- 麻花云:香港CN2VPS月付19元起,安徽移动8核/16G/20M独服2香港VPS[主机]
- 腾讯云限时秒杀改版:轻量应用服务器2核4G8M仅598元/年,增香港/新香港VPS[主机]
- 2020畅行云双11活动:海内外云服务器超低1.5折,2核2G5M云主机全球[VPS测评]
- 速云互联:香港/美国CN2 GIA线路/BGP/10Mbps/全场八折,美国VPS[主机]
- 极光KVM:美国香港vps CN2 GIA专线高速稳定,BGP服务器低至美国VPS[主机]
- 六六云:1核1GB/15GB空间/1T流量/100Mbps/KVM/香港虚拟空间(主机)
- 跨境电商平台首选香港服务器香港VPS[主机]
转载请注明原文地址:http://140.238.13.167:12355/read-143758.html











