CentOS系统环境精简优化

2023-03-22 08:18:08 0 127

提示:在操作这些步骤最好是在我们刚重装系统,而不是在已经运行网站中优化机器,以免出现机器问题。

删除不必要的自带软件包

yum remove Deployment_Guide-en-US finger cups-libs cups ypbind
yum remove bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utils
yum remove sendmail* samba* talk-server finger-server bind* xinetd
yum remove nfs-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtools
yum remove syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-tools
yum 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/config
SELINUX=disabled #禁用SeLinux
SELINUX=enforcing #使用SeLinux

禁止IPV6(执行后需要reboot重启)

vi /etc/modprobe.conf #打开文件,把下面两行加到最后
alias net-pf-10 off
alias ipv6 off

初始化防火墙

touch /etc/sysconfig/iptables
iptables -F
iptables -X
iptables -Z
service iptables save
service iptables restart

禁止无用服务

#! /bin/bash
service acpid off
service atd stop
service auditd stop
service avahi-daemon stop
service avahi-dnsconfd stop
service bluetooth stop
service conman stop
service cpuspeed stop
service cups stop
service dnsmasq stop
service dund stop
service firstboot stop
service hidd stop
service httpd stop
service ibmasm stop
service ip6tables stop
service irda stop
service kdump stop
service lm_sensors stop
service mcstrans stop
service messagebus stop
service microcode_ctl stop
service netconsole stop
service netfs stop
service netplugd stop
service nfs stop
service nfslock stop
service nscd stop
service ntpd stop
service oddjobd stop
service pand stop
service pcscd stop
service portmap stop
service psacct stop
service rdisc stop
service restorecond stop
service rpcgssd stop
service rpcidmapd stop
service rpcsvcgssd stop
service saslauthd stop
service sendmail stop
service setroubleshoot stop
service smb stop
service vncserver stop
service winbind stop
service wpa_supplicant stop
service xfs stop
service ypbind stop
service yum-updatesd stop
chkconfig acpid off
chkconfig atd off
chkconfig auditd off
chkconfig avahi-daemon off
chkconfig avahi-dnsconfd off
chkconfig bluetooth off
chkconfig conman off
chkconfig cpuspeed off
chkconfig cups off
chkconfig dnsmasq off
chkconfig dund off
chkconfig firstboot off
chkconfig hidd off
chkconfig httpd off
chkconfig ibmasm off
chkconfig ip6tables off
chkconfig irda off
chkconfig kdump off
chkconfig lm_sensors off
chkconfig mcstrans off
chkconfig messagebus off
chkconfig microcode_ctl off
chkconfig netconsole off
chkconfig netfs off
chkconfig netplugd off
chkconfig nfs off
chkconfig nfslock off
chkconfig nscd off
chkconfig ntpd off
chkconfig oddjobd off
chkconfig pand off
chkconfig pcscd off
chkconfig portmap off
chkconfig psacct off
chkconfig rdisc off
chkconfig restorecond off
chkconfig rpcgssd off
chkconfig rpcidmapd off
chkconfig rpcsvcgssd off
chkconfig saslauthd off
chkconfig sendmail off
chkconfig setroubleshoot off
chkconfig smb off
chkconfig vncserver off
chkconfig winbind off
chkconfig wpa_supplicant off
chkconfig xfs off
chkconfig ypbind off
chkconfig yum-updatesd off

这样通过上述6步骤,就可以完成对centos精简和优化。

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

免责声明:内容来自用户上传发布或新闻客户端自媒体,本站仅提供信息存储空间服务,如违规请联系删除。

玩技资源 网站部署 CentOS系统环境精简优化 https://www.52diyhome.com/2023/03/242098.html

如遇资源失效请马上联系微信进行退款

常见问题
  • 答:资源大部分来源于网络和本站作者若有侵权请您联系管理员删除2523030730
查看详情
  • 玩技平台的主要负责内容是提供给作者售卖资源的平台,买家有对作者投诉的权利,投诉成功后会获取相应的补偿机制。官方唯一投诉通道客服QQ:2523030730转接人工服务,投诉专属客服工号【2】
查看详情
  • 本站已开启了作者实名认证,在购买商品时请尽量选择已认证的作者,不用担心跑路和无人售后的问题。如果出现问题,本站将采取报警的方式来指正作者进行诈骗行为,并将其身份资料提供给警方处理。
查看详情
  • 本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习用,请勿直接商用。若由于商用引起版权纠纷,一切责任均由使用者承担。更多说明请参考 VIP介绍。
查看详情

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 工作日在线 专业服务

  • 0 +

    访问总数

  • 0 +

    会员总数

  • 0 +

    资源总数

  • 0 +

    今日发布

  • 0 +

    本周发布

  • 0 +

    运行天数

资源在于分享,创作来源想象