立即注册 找回密码

QQ登录

只需一步,快速开始

查看: 3847|回复: 0

[Linux主机系统教程] 6步骤实现CentOS系统环境精简优化

[复制链接]
发表于 2015-4-12 15:12:33 | 显示全部楼层 |阅读模式
道勤网-数据www.daoqin.net

亲注册登录道勤网-可以查看更多帖子内容哦!(包涵精彩图片、文字详情等)请您及时注册登录-www.daoqin.net

您需要 登录 才可以下载或查看,没有账号?立即注册

x
本帖最后由 学习NO.1 于 2015-4-12 15:13 编辑


QQ截图20150412151354.jpg

随着vps主机使用的深化,道勤小编从开始使用面板工具操作VPS,再到后来的一键安装包,现在基本上能自学自用VPS管理网站/备份网站维护。但是需要深入的运维还需要时日,比如刚才看到一篇CentOS系统环境精简优化的文章还是值得分享的。但是在操作之前,最好建议在我们安装系统之后操作,而不要在有网站运行之后操作,以免系统出现问题。

第一步、删除不必要的自带软件包

  1. yum remove Deployment_Guide-en-US finger cups-libs cups ypbind
  2. yum remove bluez-libs desktop-file-utils ppp rp-pppoe wireless-tools irda-utils
  3. yum remove sendmail* samba* talk-server finger-server bind* xinetd
  4. yum remove nfs-utils nfs-utils-lib rdate fetchmail eject ksh mkbootdisk mtools
  5. yum remove syslinux tcsh startup-notification talk apmd rmt dump setserial portmap yp-tools
  6. yum groupremove "Mail Server" "Games and Entertainment" "X Window System" "X Software Development"
  7. yum groupremove "Development Libraries" "Dialup Networking Support"
  8. yum groupremove "Games and Entertainment" "Sound and Video" "Graphics" "Editors"
  9. yum groupremove "Text-based Internet" "GNOME Desktop Environment" "GNOME Software Development"
复制代码

第二步、升级centos系统

  1. yum update #更新系统
  2. yum clean all #清理全部缓存文件
复制代码

第三步、禁用seLinux

  1. sestatus #先执行看seLinux状态,如果不是disabled,就需要执行下面步骤,否则不要执行
  2. vi /etc/selinux/config
  3. SELINUX=disabled #禁用SeLinux
  4. SELINUX=enforcing #使用SeLinux
复制代码

第四步、禁止IPV6(执行后需要reboot重启)

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

第五步、初始化防火墙

  1. touch /etc/sysconfig/iptables
  2. iptables -F
  3. iptables -X
  4. iptables -Z
  5. service iptables save
  6. service iptables restart
复制代码

第六步、禁止无用服务

  1. #! /bin/bash
  2. service acpid off
  3. service atd stop
  4. service auditd stop
  5. service avahi-daemon stop
  6. service avahi-dnsconfd stop
  7. service bluetooth stop
  8. service conman stop
  9. service cpuspeed stop
  10. service cups stop
  11. service dnsmasq stop
  12. service dund stop
  13. service firstboot stop
  14. service hidd stop
  15. service httpd stop
  16. service ibmasm stop
  17. service ip6tables stop
  18. service irda stop
  19. service kdump stop
  20. service lm_sensors stop
  21. service mcstrans stop
  22. service messagebus stop
  23. service microcode_ctl stop
  24. service netconsole stop
  25. service netfs stop
  26. service netplugd stop
  27. service nfs stop
  28. service nfslock stop
  29. service nscd stop
  30. service ntpd stop
  31. service oddjobd stop
  32. service pand stop
  33. service pcscd stop
  34. service portmap stop
  35. service psacct stop
  36. service rdisc stop
  37. service restorecond stop
  38. service rpcgssd stop
  39. service rpcidmapd stop
  40. service rpcsvcgssd stop
  41. service saslauthd stop
  42. service sendmail stop
  43. service setroubleshoot stop
  44. service smb stop
  45. service vncserver stop
  46. service winbind stop
  47. service wpa_supplicant stop
  48. service xfs stop
  49. service ypbind stop
  50. service yum-updatesd stop
  51. chkconfig acpid off
  52. chkconfig atd off
  53. chkconfig auditd off
  54. chkconfig avahi-daemon off
  55. chkconfig avahi-dnsconfd off
  56. chkconfig bluetooth off
  57. chkconfig conman off
  58. chkconfig cpuspeed off
  59. chkconfig cups off
  60. chkconfig dnsmasq off
  61. chkconfig dund off
  62. chkconfig firstboot off
  63. chkconfig hidd off
  64. chkconfig httpd off
  65. chkconfig ibmasm off
  66. chkconfig ip6tables off
  67. chkconfig irda off
  68. chkconfig kdump off
  69. chkconfig lm_sensors off
  70. chkconfig mcstrans off
  71. chkconfig messagebus off
  72. chkconfig microcode_ctl off
  73. chkconfig netconsole off
  74. chkconfig netfs off
  75. chkconfig netplugd off
  76. chkconfig nfs off
  77. chkconfig nfslock off
  78. chkconfig nscd off
  79. chkconfig ntpd off
  80. chkconfig oddjobd off
  81. chkconfig pand off
  82. chkconfig pcscd off
  83. chkconfig portmap off
  84. chkconfig psacct off
  85. chkconfig rdisc off
  86. chkconfig restorecond off
  87. chkconfig rpcgssd off
  88. chkconfig rpcidmapd off
  89. chkconfig rpcsvcgssd off
  90. chkconfig saslauthd off
  91. chkconfig sendmail off
  92. chkconfig setroubleshoot off
  93. chkconfig smb off
  94. chkconfig vncserver off
  95. chkconfig winbind off
  96. chkconfig wpa_supplicant off
  97. chkconfig xfs off
  98. chkconfig ypbind off
  99. chkconfig yum-updatesd off
复制代码

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


道勤主机提供365天*24小时全年全天无休、实时在线、零等待的售后技术支持。竭力为您免费处理您在使用道勤主机过程中所遇到的一切问题! 如果您是道勤主机用户,那么您可以通过QQ【792472177】、售后QQ【59133755】、旺旺【诠释意念】、微信:q792472177免费电话、后台提交工单这些方式联系道勤主机客服! 如果您不是我们的客户也没问题,点击页面最右边的企业QQ在线咨询图标联系我们并购买后,我们为您免费进行无缝搬家服务,让您享受网站零访问延迟的迁移到道勤主机的服务!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

道勤网- 推荐内容!上一条 /2 下一条

!jz_fbzt! !jz_sgzt! !jz_xgzt! 快速回复 !jz_fhlb! !jz_lxwm! !jz_gfqqq!

关于我们|手机版|小黑屋|地图|【道勤网】-www.daoqin.net 软件视频自学教程|免费教程|自学电脑|3D教程|平面教程|影视动画教程|办公教程|机械设计教程|网站设计教程【道勤网】 ( 皖ICP备15000319号-1 )

GMT+8, 2024-5-15 21:33

Powered by DaoQin! X3.4 © 2016-2063 Dao Qin & 道勤科技

快速回复 返回顶部 返回列表