CentOS常見操作背記
1. 初始化設置
#yum -y update 更新
#tzselect 時區設置
#5>9>1>1
#cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 保存時區
安裝中文支持
# yum install "@Chinese Support"
現在,我們再看VPS上的時間,已經更新為北京時間了
#date -R
Sat, 25 Feb 2012 18:57:58 +0800
如果需要定時更新的話,可以安裝一個ntp服務
#yum install ntp
03 * * * * /usr/sbin/ntpdate -u 0.asia.pool.ntp.org
安裝編譯環境及其依賴庫
#yum -y install gcc gcc-c++ autoconf automake libtool libevent libevent-devel gmp gmp-devel
#yum -y install gd gd-devel freetype freetype-devel fontconfig fontconfig-devel libjpeg libjpeg-devel zlib zlib-devel pcre pcre-devel
#yum -y install ncurses ncurses-devel libmcrypt mhash
安裝apache、MySQL、PHP
#yum -y install mysql mysql-server mysql-devel
#yum -y install httpd httpd-devel
#wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el6.rf.x86_64.rpm
#rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt
#rpm -K rpmforge-release-0.5.2-2.el6.rf.*.rpm # Verifies the package
#rpm -i rpmforge-release-0.5.2-2.el6.rf.*.rpm
#yum install libmcrypt-devel
#rpm -Uvh http://repo.webtatic.com/yum/el6/latest.rpm
#yum -y install php54*
#yum upgrade php
啟動apache
#/etc/init.d/httpd restart
啟動mysql
#/etc/init.d/mysqld restart
#/usr/bin/mysql_secure_installation
開機自啟動
#chkconfig httpd on
#chkconfig mysqld on