Basic Optimization after CentOS 6.x system installation

Source: Internet
Author: User

Basic Optimization after CentOS 6.x system installation

Basic Optimization after CentOS 5.6 Linux is installed

(1) view the system version information:

[Root @ localhost ~] # Cat/etc/RedHat-release

CentOS release 6.4 (Final)

(2) Add an epel source for centos6.4:

[Root @ localhost ~] # Wget http://ftp.riken.jp/Linux/Fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm

[Root @ localhost ~] # Rpm-ivh epel-release-6-8.noarch.rpm

Warning:/var/tmp/rpm-tmp.mgMNYU: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY

Preparing... ######################################## ### [100%]

1: epel-release ##################################### ###### [100%]

(3) modify the character set to English to avoid unnecessary errors during installation, which results in a waste of Compilation Time and affects work efficiency: After modification, log on again to take effect.

Or use the following command to take effect immediately

[Root @ localhost ~] # Source/etc/sysconfig/i18n

[Root @ localhost ~] # Vim/etc/sysconfig/i18n

LANG = "en_US.UTF-8"

SYSFONT = "latarcyrheb-sun16"

Temporarily change to [root @ localhost ~] # Export LANG = en

(4) install the Yum acceleration component

[Root @ localhost ~] # Yum-y install yum-fastestmirror

[Root @ localhost ~] # Yum repolist

[Root @ localhost ~] # Yum clean all

Loaded plugins: fastestmirror, security

Cleaning repos: base epel extras updates

Cleaning up Everything

Cleaning up list of fastest mirrors

[Root @ localhost ~] # Yum makecache # regenerate metadata to prevent dependency corruption

 

(5) install and compile the software and other required development kit groups. Remember that the package group should be caused by double quotation marks in English. Do you still remember the space in the middle? What happens when spaces are used in shell? Haha

[Root @ localhost ~] # Yum-y groupinstall "Desktop Platform Development" "Development tools" "Server Platform Development"

This step is also required if it has been installed before, because it will update the software packages required by the system to the latest version to further prevent system vulnerabilities. This is an online experience! This step is necessary, because the previous epel source serves this purpose!

 

(6) Necessary tools required for yum system installation

Various tools required for installing and compiling LAMP gcc-c ++ make automake autoconf kernel-devel

Install the dependencies required by PHP, such as the libxml2-devel openssl-devel curl-devel libjpeg-devel libpng-devel.

[Root @ localhost ~] # Yum-y install gcc-c ++ kernel-devel ntp vim-enhanced flex bison autoconf make automake bzip2-devel ncurses-devel zlib-devel libjpeg-devel libpng-devel libtiff-devel freetype -devel libXpm-devel gettext-devel pam-devel libtool-ltdl openssl-devel fontconfig-devel libxml2-devel curl-devel libicu-devel kernel-devel libmhash-devel pcre- devel libtool-libs gd file patch mlocate diffutils readline-devel glibc-devel glib2-devel libcap-devel

(7) uninstall the existing rpm package before compiling and installing LAMP.

First, check whether the software is installed.

[Root @ localhost ~] # Rpm-q httpd

Package httpd is not installed

[Root @ localhost ~] # Rpm-q mysql

Package mysql is not installed

[Root @ localhost ~] # Rpm-q php

Package php is not installed

Uninstall lamp software installed in the system using yum or rpm

Rpm-e httpd

Rpm-e mysql

Rpm-e php

Yum-y remove httpd

Yum-y remove mysql-server mysql

Yum-y remove php

Yum-y remove php-mysql

(8) disabling SeLinux selinux may cause compilation and installation to fail. Disable SeLinux first.

[Root @ localhost ~] # Setenforce 0

[Root @ localhost ~] # Getenforce

Permissive

[Root @ localhost ~] # Sed-I s/SELINUX = enforcing/SELINUX = disabled/g/etc/sysconfig/selinux # permanently disabled and must be restarted to take effect.

[Root @ localhost ~] # Grep ^ SELINUX/etc/sysconfig/selinux

SELINUX = disabled

SELINUXTYPE = targeted

(9) Optimization of startup and service Minimization

In line with the principle of minimizing services, this instance installs LAMP for this purpose, closing all unnecessary services. Currently, only the following services are available.

======> Clear the self-starting services

Idea: 1> close all services through scripts

[Root @ localhost ~] # For test in 'chkconfig -- list | grep 3: on | awk '{print $1} ''; do chkconfig -- level 3 $ test off; done

2> run the following command to enable the Service to be started

[Root @ localhost ~] # For test in crond network rsyslog sshd; do chkconfig -- level 3 $ test on; done 3> is the optimized result desired?

[Root @ localhost ~] # Chkconfig -- list | grep 3: on

Crond 0: off 1: off 2: on 3: on 4: on 5: on 6: off

Network 0: off 1: off 2: on 3: on 4: on 5: on 6: off

Rsyslog 0: off 1: off 2: on 3: on 4: on 5: on 6: off

Sshd 0: off 1: off 2: on 3: on 4: on 5: on 6: off

In short, it is a principle. The principle of minimizing servers and emphasizing the importance of a dedicated force

Finally, install the Common commands of the system:

[Root @ localhost ~] # Yum-y install vim-enhanced wget lrzsz

Use centos6.4 to create a new virtual machine, optimize it, and save a virtual machine, laying a good foundation for the rapid establishment of the environment for subsequent experiments;

It is vital to develop good habits. Come on, and the peak will only exist for people with dreams!

64-bit CentOS 6.5 Installation Method

64-bit CentOS 6.4 dual-system installation in Win7

Precautions for installing CentOS and Windows systems

Install Windows 8 and CentOS on UEFI + GPT

Windows 8.1 and CentOS6.5 dual-system installation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.