一、腳本YUM源安裝:
1.yum install wget #安裝下載工具wget2.wget http://www.atomicorp.com/installers/atomic #下載atomic yum源,配置CentOS 6.5第三方yum源3. sh ./atomic #腳本執行4. yum check-update #更新yum軟件包
二、163yum源的安裝
1.進入yum源配置目錄
cd /etc/yum.repos.d
2.備份系統自帶的yum源
mv CentOS-Base.repo CentOS-Base.repo.bk
3.下載163網易的yum源:
centos7.x:wget http://mirrors.163.com/.help/CentOS7-Base-163.repocentos6.x:wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
4.更新玩yum源后,執行下邊命令更新yum配置,使操作立即生效
yum makecache
三、添加阿里yum更新源碼:
1.安裝wget:
yum install wget -y
2.備份你的原鏡像文件,以免出錯后可以恢復。
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
3.下載新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repoCentOS 6:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repoCentOS 7:wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
4.然后重建緩存:
yum clean allyum makecache
四、安裝并配置MySQL
1. 執行yum命令安裝MySQ
yum -y install mysql mysql-server
2 .把添加MySQL進開機啟動項,并立即啟動MySQL
chkconfig --levels 235 mysqld on #重啟自動啟動服務service mysqld start #重新啟動mysql服務
3.設置MySQL root帳號密碼
mysql_secure_installation
回車,根據提示輸入Y
輸入2次密碼,回車
根據提示一路輸入Y
最后出現:Thanks for using MySQL!
MySql密碼設置完成,重新啟動 MySQL
service mysqld start [root@localhost ~]# netstat -tulpn | grep -i mysqltcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 1723/mysqld
五、安裝Apache
1. 使用yum命令安裝Apache
yum –y install httpd
2.設置開機啟動Apache
chkconfig --levels 235 httpd on
3.啟動Apache
service httpd start
4. 現在直接在瀏覽器鍵入http://localhost或http://本機IP,應該會看到Apache的測試頁面
### 安裝apache 一些擴展###root@localhost ~]# yum -y install httpd-manual mod_ssl mod_perl mod_auth_mysql
新聞熱點
疑難解答