立即注冊 找回密碼

QQ登錄

只需一步,快速開始

6步驟實(shí)現(xiàn)CentOS系統(tǒng)環(huán)境精簡優(yōu)化

2015-4-12 15:14| 發(fā)布者: 學(xué)習(xí)NO.1| 查看: 627| 評論: 0|原作者: 學(xué)習(xí)NO.1

摘要: 隨著VPS主機(jī)使用的深化,道勤小編從開始使用面板工具操作VPS,再到后來的一鍵安裝包,現(xiàn)在基本上能自學(xué)自用VPS管理網(wǎng)站/備份網(wǎng)站維護(hù)。但是需要深入的運(yùn)維還需要時(shí)日,比如剛才看到一篇CentOS系統(tǒng)環(huán)境精簡優(yōu)化的文章 ...

QQ截圖20150412151354.jpg

隨著vps主機(jī)使用的深化,道勤小編從開始使用面板工具操作VPS,再到后來的一鍵安裝包,現(xiàn)在基本上能自學(xué)自用VPS管理網(wǎng)站/備份網(wǎng)站維護(hù)。但是需要深入的運(yùn)維還需要時(shí)日,比如剛才看到一篇CentOS系統(tǒng)環(huán)境精簡優(yōu)化的文章還是值得分享的。但是在操作之前,最好建議在我們安裝系統(tǒng)之后操作,而不要在有網(wǎng)站運(yùn)行之后操作,以免系統(tǒng)出現(xiàn)問題。

第一步、刪除不必要的自帶軟件包

  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"
復(fù)制代碼

第二步、升級centos系統(tǒng)

  1. yum update #更新系統(tǒng)
  2. yum clean all #清理全部緩存文件
復(fù)制代碼

第三步、禁用seLinux

  1. sestatus #先執(zhí)行看seLinux狀態(tài),如果不是disabled,就需要執(zhí)行下面步驟,否則不要執(zhí)行
  2. vi /etc/selinux/config
  3. SELINUX=disabled #禁用SeLinux
  4. SELINUX=enforcing #使用SeLinux
復(fù)制代碼

第四步、禁止IPV6(執(zhí)行后需要reboot重啟)

  1. vi /etc/modprobe.conf #打開文件,把下面兩行加到最后
  2. alias net-pf-10 off
  3. alias ipv6 off
復(fù)制代碼

第五步、初始化防火墻

  1. touch /etc/sysconfig/iptables
  2. iptables -F
  3. iptables -X
  4. iptables -Z
  5. service iptables save
  6. service iptables restart
復(fù)制代碼

第六步、禁止無用服務(wù)

  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
復(fù)制代碼

這樣通過上述6步驟,就可以完成對centos精簡和優(yōu)化。



鮮花

握手

雷人

路過

雞蛋

最新評論

相關(guān)推薦
!jz_fbzt! !jz_lxwm! !jz_gfqqq!

關(guān)于我們|手機(jī)版|小黑屋|地圖|【道勤網(wǎng)】-bmrsportswear.com 軟件視頻自學(xué)教程|免費(fèi)教程|自學(xué)電腦|3D教程|平面教程|影視動畫教程|辦公教程|機(jī)械設(shè)計(jì)教程|網(wǎng)站設(shè)計(jì)教程【道勤網(wǎng)】 ( 皖I(lǐng)CP備15000319號-1 )

GMT+8, 2024-10-24 04:38

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

返回頂部