安裝Cent OS
從http://www./modules/tinycontent/index.php?id=15下載最新版本的CentOS
更新成163源
打開(kāi)Terminate 輸入sudo root并輸入密碼 輸入su讓當(dāng)前用戶以root權(quán)限進(jìn)入 輸入cd /etc/yum.repos.d 輸入mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 來(lái)備份/etc/yum.repos.d/CentOS-Base.repo 輸入wget http://mirrors.163.com/.help/CentOS6-Base-163.repo下載163源 輸入mv /etc/yum.repos.d/CentOS6-Base-163.repo /etc/yum.repos.d/CentOS-Base.repo 輸入yum makecache完成更新
安裝并配置MySQL 1.1 執(zhí)行yum命令安裝MySQL
1.2 把添加MySQL進(jìn)開(kāi)機(jī)啟動(dòng)項(xiàng),并立即啟動(dòng)MySQL
1.3 設(shè)置MySQL root賬號(hào)密碼
二、 安裝Apache 2.1 使用yum命令安裝Apache
2.2 設(shè)置開(kāi)機(jī)啟動(dòng)Apache
2.3 啟動(dòng)Apache
2.4 現(xiàn)在直接在瀏覽器鍵入http://localhost或http://本機(jī)IP,應(yīng)該會(huì)看到Apache的測(cè)試頁(yè)面
3.3 安裝相關(guān)模塊使用PHP支持MySQL:為了讓PHP支持MySQL,我們可以安裝php-mysql軟件包;也可使用以下命令搜索可用的php模塊
Using YUM :Step 1 ? Install/enable EPEL repository . You can find latest repository here ( http://download./pub/epel/6/i386/repoview/epel-release.html )
Step 2 ? Now update repositories
Step 3 ? After updating yum repositories , now you can install phpmyadmin package
This command will install phpmyadmin package along with dependencies . please type the package name exactly as phpMyAdmin ( ” M” and “A” –> Uppercase ) Step 4 ? Now restart httpd service
Now open the path in your browser ( Eg-> http://192.168.1.1/phpMyAdmin ) . You can see the below screen after entering Mysql root username and password . 4.9 至此,打開(kāi)頁(yè)面http://localhost/phpmyadmin即可輕松管理你的mySQL數(shù)據(jù)庫(kù)
打開(kāi)CentOS網(wǎng)絡(luò)端口保證其它機(jī)器可以訪問(wèn)
#/sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
查看打開(kāi)的端口:
# /etc/init.d/iptables status
|
|
來(lái)自: corefashion > 《web服務(wù)》