CentOS6部署phpmyadmin;部署Discuz;部署phpwind;部署phpBB
第一部分:
一、yum安裝LAMP平臺(tái)
二、部署phpMyAdmin
第二部分:
一、搭建論壇系統(tǒng)Discuz
二、搭建論壇系統(tǒng)PhpWind
三、搭建論壇系統(tǒng)?PhpBB?
第三部分
一、部署wordpress個(gè)人博客系統(tǒng)
===============================================================================
一、phpMyAdmin簡介
?1.?phpMyAdmin?是以PHP為基礎(chǔ)而開發(fā)的一個(gè)以WEB方式來管理Mysql數(shù)據(jù)庫的工具,phpMyAdmin提供了一個(gè)比較人性化的網(wǎng)頁界面,操作起來非常簡單易用。對(duì)于一些對(duì)SQL語句不太熟悉的人來使用,是最好不過的一個(gè)工具了。
phpMyAdmin官方網(wǎng)站下載地址:http://www.phpmyadmin.net/home_page/downloads.php
?2.?安裝LAMP平臺(tái)
#?yum?-y?install?http?php?php-mysql?php-mbstring?mysql?mysql-server?3.?修改Apache主配置文件,添加默認(rèn)主頁如下:
#?vim?/etc/httpd/conf/httpd.conf DirectoryIndex?index.php?index.html?index.html.var ServerName?localhost:80?4.?啟動(dòng)http與mysql服務(wù)
#?service?httpd?start #?service?mysqld?start?5.?在默認(rèn)網(wǎng)頁存放新建一個(gè)index.php文件,寫一個(gè)測(cè)試語句,是否能夠連接數(shù)據(jù)庫,數(shù)據(jù)庫用戶“root”,默認(rèn)沒有密碼,我們?cè)O(shè)置一個(gè)密碼;如下;
#?mysqladmin?-uroot?-p?password?"phpmyadmin" #?vim?/var/www/html/index.php <h1>www.phpmyadmin.com</h1> <?php $Con=mysql_connect('127.0.0.1','phpmyadmin','phpmyadmin'); if?($Con) echo?"SUCCESS..."; else echo?"FAILURE...";?6.?瀏覽器測(cè)試訪問
?7.?修改/etc/httpd/conf/httpd.conf文件,為phpmyadmin創(chuàng)建一個(gè)虛擬主機(jī);如:
#?cd?/etc/httpd/conf #?cp?httpd.conf?httpd.conf.bak #?vim?httpd.conf 增加以下行 NameVirtualHost?192.168.0.104:80 <VirtualHost?192.168.0.104:80> ServerAdmin?zhengyansheng@cdvcloud.com DocumentRoot?/var/www/html/phpmyadmin ServerName?www.phpmyadmin.com ErrorLog?logs/allentuns-error_log CustomLog?logs/allentuns-access_log?common </VirtualHost>?8.??重新載入配置文件
#?service?httpd?reload?9.?解壓phpMyAdmin軟件包
#?cd?/usr/local/src #?tar?xf?phpMyAdmin-4.1.14-all-languages.tar.bz2?-C?/var/www/html/ #?mv?phpMyAdmin-4.1.14-all-languages?phpmyadmin?10.?由于沒有DNS服務(wù)器解析,需要在本地Hosts文件中添加如下記錄:
C:\Windows\System32\Drivers\etc\hosts??#打開此文件添加如下內(nèi)容 192.168.0.104????????www.phpmyadmin.com?11、客戶端打開瀏覽器驗(yàn)證是否能成功登錄,如下
12.?登陸后的界面
提示phpMyAdmin?高級(jí)功能未設(shè)置,部分未激活,然后請(qǐng)點(diǎn)擊【這里】查看原因;如下圖
13.?首先需要修改/var/www/html/phpmyadmin/config.inc.conf文件;如下:
去掉以下行的注釋 /*?Storage?database?and?tables?*/ $cfg['Servers'][$i]['pmadb']?=?'phpmyadmin'; $cfg['Servers'][$i]['bookmarktable']?=?'pma__bookmark'; $cfg['Servers'][$i]['relation']?=?'pma__relation'; $cfg['Servers'][$i]['table_info']?=?'pma__table_info'; $cfg['Servers'][$i]['table_coords']?=?'pma__table_coords'; $cfg['Servers'][$i]['pdf_pages']?=?'pma__pdf_pages'; $cfg['Servers'][$i]['column_info']?=?'pma__column_info'; $cfg['Servers'][$i]['history']?=?'pma__history'; $cfg['Servers'][$i]['table_uiprefs']?=?'pma__table_uiprefs'; $cfg['Servers'][$i]['tracking']?=?'pma__tracking'; $cfg['Servers'][$i]['designer_coords']?=?'pma__designer_coords'; $cfg['Servers'][$i]['userconfig']?=?'pma__userconfig'; $cfg['Servers'][$i]['recent']?=?'pma__recent'; $cfg['Servers'][$i]['users']?=?'pma__users'; $cfg['Servers'][$i]['usergroups']?=?'pma__usergroups'; $cfg['Servers'][$i]['navigationhiding']?=?'pma__navigationhiding';?14.?將phpMyAdmin/examples/create_tables.sql數(shù)據(jù)庫文件導(dǎo)入數(shù)據(jù)庫;如下:
#?mysql?-uroot?-pphpmyadmin?<?/var/www/html/phpmyadmin/examples/create_tables.sql15.??再次重新登錄并驗(yàn)證;如下:
===============================================================================
第二部分:
一、搭建Discuz論壇
1.?Discuz簡介
Discuz!?X?是一款以?PHP?為編程語言,以?MySQL?為數(shù)據(jù)庫,并使用?Apache/IIS/Nginx(任意一種即可)?提供?web?服務(wù)的產(chǎn)品。要搭建?Discuz!?X?站點(diǎn),服務(wù)器必須安裝由?PHP、MySQL、Apache/IIS/Nginx?構(gòu)成的環(huán)境。其中,IIS?主要用于?Windows?服務(wù)器,Apache、Nginx?多用于?Linux?服務(wù)器(即?LAMP?和?LNMP)。
2.?部署流程
Linux?服務(wù)器部署時(shí),需要按照一定的部署順序,即: 系統(tǒng)環(huán)境初始化?->?Apache/Nginx、MySQL、PHP?程序包下載?->?Apache/Nginx、MySQL、PHP?安裝3.?軟件下載地址:http://download.comsenz.com/DiscuzX/3.1/Discuz_X3.1_SC_UTF8.zip
4.?上傳軟件包或者本地下載軟件包,解壓到Apache站點(diǎn)目錄
5.?添加虛擬主機(jī),如下
[root@allentuns?~]#?vim?/etc/httpd/conf/httpd.conf <VirtualHost?192.168.1.226:80> ServerAdmin?zhengyansheng@cdvcloud.com DocumentRoot?/var/www/html/bbs ServerName?www.bbs.com ErrorLog?logs/bbs-error_log CustomLog?logs/bbs-access_log?common </VirtualHost>6?.?由于沒有DNS服務(wù)器解析,需要在本地Hosts文件中添加如下記錄:
C:\Windows\System32\Drivers\etc\hosts??#打開此文件添加如下內(nèi)容 192.168.0.104????????www.bbs.com7.?客戶端谷歌瀏覽器訪問域名www.bbs.com;域名安裝如下圖
查看授權(quán)協(xié)議,點(diǎn)擊【我同意】,以進(jìn)行下一步操作;如圖
設(shè)置好站點(diǎn)下目錄的權(quán)限,然后全部通過后點(diǎn)擊【下一步】,如下圖
登陸MySQL數(shù)據(jù)庫,創(chuàng)建論壇庫,論壇mysql用戶,授權(quán)
[root@allentuns?~]#?mysql?-uroot?-p Enter?password: Welcome?to?the?MySQL?monitor.??Commands?end?with?;?or?\g. Your?MySQL?connection?id?is?96 Server?version:?5.1.73?Source?distribution Copyright?(c)?2000,?2013,?Oracle?and/or?its?affiliates.?All?rights?reserved. Oracle?is?a?registered?trademark?of?Oracle?Corporation?and/or?its affiliates.?Other?names?may?be?trademarks?of?their?respective owners. Type?'help;'?or?'\h'?for?help.?Type?'\c'?to?clear?the?current?input?statement. mysql>?create?database?phpmyadmin?#創(chuàng)建論壇數(shù)據(jù)庫 mysql>?insert?into?mysql.user(Host,User,Password)?values("localhost","phpmyadmin",password("phpmyadmin"));??#創(chuàng)建論壇數(shù)據(jù)庫管理員 Query?OK,?1?row?affected,?3?warnings?(0.00?sec) mysql>?grant?all?privileges?on?phpmyadmin.*?to?phpmyadmin@'%';??#賦予phpmyadmin對(duì)庫有所有權(quán)限 Query?OK,?0?rows?affected?(0.00?sec) mysql>?flush?privileges;??#重新載入授權(quán)表 Query?OK,?0?rows?affected?(0.00?sec) mysql>?select?User,Host,Password?from?user; +------------+-----------+-------------------------------------------+ |?User???????|?Host??????|?Password??????????????????????????????????| +------------+-----------+-------------------------------------------+ |?root???????|?localhost?|?*387B36D01A7C5EC3AF24E860C269DAA274EF94EF?| |?root???????|?allentuns?|???????????????????????????????????????????| |?root???????|?127.0.0.1?|???????????????????????????????????????????| |????????????|?localhost?|???????????????????????????????????????????| |????????????|?allentuns?|???????????????????????????????????????????| |?phpmyadmin?|?localhost?|?*387B36D01A7C5EC3AF24E860C269DAA274EF94EF?|#添加成功 |?phpmyadmin?|?%?????????|???????????????????????????????????????????| +------------+-----------+-------------------------------------------+ 7?rows?in?set?(0.00?sec)數(shù)據(jù)庫名:phpmyadmin??#新創(chuàng)建的數(shù)據(jù)庫
數(shù)據(jù)庫用戶名:phpmyadmin?#新創(chuàng)建的用戶
數(shù)據(jù)庫密碼:phpmyadmin
數(shù)據(jù)表前綴:默認(rèn)即可
管理員賬號(hào):admin
管理員密碼:admin
以上信息輸入完畢后,點(diǎn)擊【下一步】
如圖所示:下一步點(diǎn)擊?【繼續(xù)訪問】
Discuz論壇搭建成功,如下圖
bbs論壇安裝完成后,最好刪除或者重命名bbs目錄下install目錄
[root@allentuns?~]#?cd?/var/www/html/bbs/ [root@allentuns?bbs]#?mv?install?install.bak重新登陸再次訪問bbs論壇
用戶登陸界面
到此bbs論壇搭建完成!!!
===========================================================================
二、搭建論壇系統(tǒng)PhpWind
1.?phpwind簡介
PHPWind?是一套采用?php+mysql?數(shù)據(jù)庫方式運(yùn)行并可生成?html?頁面的全新且完善的強(qiáng)大系統(tǒng)。
2.?軟件下載地址
phpwind下載地址:http://www.phpwind.com/index.php?m=download
3.?上傳軟件包或解壓對(duì)apache下的phpwind目錄
[root@allentuns?~]#?mkdir?/var/www/html/phpwind [root@allentuns?~]#?cd?/var/www/html/phpwind/ [root@allentuns?phpwind]#?mv?/usr/local/src/phpwind_UTF8_8.7.zip?. [root@allentuns?phpwind]#?unzip?phpwind_UTF8_8.7.zip [root@allentuns?phpwind]#?cd?.. [root@allentuns?www]#?chmod?-R?777?phpwind/ [root@allentuns?~]#?cd?/var/www/html/phpwind/phpwind_UTF8_8.7/upload [root@allentuns?upload]#?mv?*?/var/www/html/phpwind/4.?添加虛擬主機(jī)
[root@allentuns?~]#?vim?/etc/httpd/conf/httpd.conf <VirtualHost?192.168.1.226:80> ServerAdmin?zhengyansheng@cdvcloud.com DocumentRoot?/var/www/html/phpwind ServerName?www.phpwind.com ErrorLog?logs/phpwind-error_log CustomLog?logs/phpwind-access_log?common </VirtualHost>5.?重新載入apache配置文件
[root@allentuns?html]#?service?httpd?reload6.?谷歌瀏覽器訪問站點(diǎn)http://www.phpwind.com;如下圖
點(diǎn)擊【接受】
點(diǎn)擊【下一步】
同上discuz創(chuàng)建對(duì)應(yīng)的數(shù)據(jù)庫、用戶、授權(quán) [root@allentuns?~]#?mysql?-uroot?-pphpmyadmin Welcome?to?the?MySQL?monitor.??Commands?end?with?;?or?\g. Your?MySQL?connection?id?is?120 Server?version:?5.1.73?Source?distribution Copyright?(c)?2000,?2013,?Oracle?and/or?its?affiliates.?All?rights?reserved. Oracle?is?a?registered?trademark?of?Oracle?Corporation?and/or?its affiliates.?Other?names?may?be?trademarks?of?their?respective owners. Type?'help;'?or?'\h'?for?help.?Type?'\c'?to?clear?the?current?input?statement. mysql>?create?database?phpwind; Query?OK,?1?row?affected?(0.00?sec) mysql>?insert?into?mysql.user(Host,User,Password)?values("localhost","phpwind",password("phpwind123")); Query?OK,?1?row?affected,?3?warnings?(0.00?sec) mysql>?grant?all?privileges?on?phpwind.*?to?phpwind@'%'; Query?OK,?0?rows?affected?(0.00?sec) mysql>?flush?privileges; Query?OK,?0?rows?affected?(0.01?sec)?
管理員登陸;如下圖
到此phpwind安裝就完成了!是不是so?easy?啊!哈哈
====================================================================================================
三、搭建論壇系統(tǒng)?PhpBB?
1.phpbb簡介
自2000年發(fā)布以來,?phpBB?已經(jīng)成為世界上應(yīng)用最廣泛的開源論壇軟件.?與早先的版本一樣,?phpBB?3.0?“Olympus”?擁有易于使用的管理面板和友好的用戶安裝界面,?您可以輕松地在數(shù)分鐘內(nèi)建立起您的論壇.
2.?下載地址:http://www.phpbbchina.com/about/
3.?下載phpbb3.0.7_pl1_zh_phpbbchina.zip
4.?上傳,解壓,重命名到Apache站點(diǎn)目錄
#?unzip?phpbb3.0.7_zh_phpbbchina #?mv?phpbb3.0.7_zh_phpbbchina?/var/www/html/ #?cd?/var/www/html/ #?mv?phpbb3.0.7_zh_phpbbchina?phpbb5.?添加虛擬主機(jī)
#?vim?/etc/httpd/conf/httpd.conf <VirtualHost?192.168.0.103:80> ServerAdmin?zhengyansheng@cdvcloud.com DocumentRoot?/var/www/html/phpbb ServerName?www.phpbb.com ErrorLog?logs/phpbb-error_log CustomLog?logs/phpbb-access_log?common </VirtualHost>6.?重新載入Apache配置文件
#?service?httpd?restart7.?本地hosts文件,修改對(duì)應(yīng)的dns記錄
C:\Windows\System32\Drivers\etc\hosts??#打開此文件添加如下內(nèi)容 192.168.0.104????????www.phpbb.com7.?谷歌瀏覽器訪問站點(diǎn)http://www.phpbb.com
點(diǎn)擊【繼續(xù)進(jìn)行下一步】
添加對(duì)應(yīng)目錄權(quán)限,否則讀取失敗
#?cd?/var/www/html/phpbb/ #?chmod?o+w?cache/?files/?store/?config.php?p_w_picpaths/avatars/upload/添加權(quán)限后如下圖所示
然后點(diǎn)擊【開始安裝】,如下圖
同上創(chuàng)建對(duì)應(yīng)的數(shù)據(jù)庫,用戶授權(quán) [root@allentuns?~]#?mysql?-uroot?-p Enter?password: Welcome?to?the?MySQL?monitor.??Commands?end?with?;?or?\g. Your?MySQL?connection?id?is?2 Server?version:?5.1.73?Source?distribution Copyright?(c)?2000,?2013,?Oracle?and/or?its?affiliates.?All?rights?reserved. Oracle?is?a?registered?trademark?of?Oracle?Corporation?and/or?its affiliates.?Other?names?may?be?trademarks?of?their?respective owners. Type?'help;'?or?'\h'?for?help.?Type?'\c'?to?clear?the?current?input?statement. mysql>?create?database?phpbb; Query?OK,?1?row?affected?(0.02?sec) mysql>?insert?into?mysql.user(Host,User,Password)?values("localhost","phpbb",password("phpbb123")); Query?OK,?1?row?affected,?3?warnings?(0.03?sec) mysql>?grant?all?privileges?on?phpbb.*?to?phpbb@'%'; Query?OK,?0?rows?affected?(0.00?sec) mysql>?flush?privileges; Query?OK,?0?rows?affected?(0.00?sec)點(diǎn)擊【繼續(xù)進(jìn)行下一步】;如下圖
默認(rèn)以下設(shè)置,點(diǎn)擊繼續(xù)下一步
完成;如下圖
移除install目錄
[root@allentuns?~]#?cd?/var/www/html/phpbb/ [root@allentuns?phpbb]#?mv?install?install.bak再次訪問站點(diǎn)卻出現(xiàn)錯(cuò)誤,如下圖
以上錯(cuò)誤提示時(shí)區(qū)錯(cuò)誤,需要做以下修改
#?cp??/usr/share/doc/php-common-5.3.3/php.ini-production??/etc/php.ini cp:?overwrite?`/etc/php.ini'??yes #?vim?/etc/php.ini [Date] ;?Defines?the?default?timezone?used?by?the?date?functions ;?http://php.net/date.timezone ;date.timezone?= date.timezone?=?Asia/Shanghai #?service?httpd?restart然后重新刷新頁面;如下圖
到此phpbb論壇就完成了
==================================================================================================
?第三部分
一、部署wordpress個(gè)人博客系統(tǒng)
?1.?wordpress簡介
WordPress起初是一款個(gè)人博客系統(tǒng),并逐步演化成一款內(nèi)容管理系統(tǒng)軟件,它是使用PHP語言和MySQL數(shù)據(jù)庫開發(fā)的。用戶
可以在支持?PHP?和?MySQL數(shù)據(jù)庫的服務(wù)器上使用自己的?Blog。
2.?軟件下載地址http://cn.wordpress.org
3.?為wordpress博客系統(tǒng)創(chuàng)建一個(gè)數(shù)據(jù)庫名為“wordpress”;如
[root@allentuns?~]#?mysql?-uroot?-p Enter?password: Welcome?to?the?MySQL?monitor.??Commands?end?with?;?or?\g. Your?MySQL?connection?id?is?25 Server?version:?5.1.73?Source?distribution Copyright?(c)?2000,?2013,?Oracle?and/or?its?affiliates.?All?rights?reserved. Oracle?is?a?registered?trademark?of?Oracle?Corporation?and/or?its affiliates.?Other?names?may?be?trademarks?of?their?respective owners. Type?'help;'?or?'\h'?for?help.?Type?'\c'?to?clear?the?current?input?statement. mysql>?create?database?wordpress; Query?OK,?1?row?affected?(0.00?sec) mysql>?insert?into?mysql.user(Host,User,Password)?values("localhost","wordpress",password("wordpress123")); Query?OK,?1?row?affected,?3?warnings?(0.00?sec) mysql>?grant?all?privileges?on?wordpress.*?to?wordpress@'%'; Query?OK,?0?rows?affected?(0.00?sec) mysql>?flush?privileges; Query?OK,?0?rows?affected?(0.00?sec)4.?上傳,解壓到Apache的站點(diǎn)目錄,并修改對(duì)應(yīng)的配置文件?錯(cuò)誤1處?密碼wordpress123
[root@allentuns?src]#?tar?xf?wordpress-3.9-zh_CN.tar.gz?-C?/var/www/html/ [root@allentuns?src]#?cd?/var/www/html/wordpress/ [root@allentuns?wordpress]#?cp?wp-config-sample.php?wp-config-sample.php.bak [root@allentuns?wordpress]#?mv?wp-config-sample.php?wp-config.php [root@allentuns?wordpress]#?vim?wp-config.php //?**?MySQL?設(shè)置?-?具體信息來自您正在使用的主機(jī)?**?// /**?WordPress數(shù)據(jù)庫的名稱?*/ define('DB_NAME',?'wordpress'); /**?MySQL數(shù)據(jù)庫用戶名?*/ define('DB_USER',?'wordpress'); /**?MySQL數(shù)據(jù)庫密碼?*/ define('DB_PASSWORD',?'wordpress'); /**?MySQL主機(jī)?*/ define('DB_HOST',?'localhost'); /**?創(chuàng)建數(shù)據(jù)表時(shí)默認(rèn)的文字編碼?*/ define('DB_CHARSET',?'utf8'); /**?數(shù)據(jù)庫整理類型。如不確定請(qǐng)勿更改?*/ define('DB_COLLATE',?'');5.?添加虛擬主機(jī);如下
[root@allentuns?~]#?vim?/etc/httpd/conf/httpd.conf <VirtualHost?192.168.0.103:80> ServerAdmin?zhengyansheng@cdvcloud.com DocumentRoot?/var/www/html/wordpress ServerName?www.wordpress.com ErrorLog?logs/wordpress-error_log CustomLog?logs/wordpress-access_log?common </VirtualHost>6.?重新載入配置文件
#?service?httpd?reload7.?由于沒有DNS服務(wù)器解析,需要在本地Hosts文件中添加如下記錄:
C:\Windows\System32\Drivers\etc\hosts??#打開此文件添加如下內(nèi)容 192.168.0.103????????www.wordpress.com8.?谷歌瀏覽器訪問域名http://www.wordpress.com?來安裝博客系統(tǒng),如下圖
輸入以下信息?用戶名和密碼都為zhengyansheng?電子郵件為公司的郵箱?然后單擊【安裝wordpress】進(jìn)行下一步
輸入用戶名和密碼【登陸】如下圖
安裝完成如下圖
?
谷歌瀏覽器重新訪問站點(diǎn);如下圖
到此整套的博客系統(tǒng)就整理完了。剩下來的時(shí)間祝大家五一節(jié)快樂!
轉(zhuǎn)載于:https://blog.51cto.com/467754239/1404849
總結(jié)
以上是生活随笔為你收集整理的CentOS6部署phpmyadmin;部署Discuz;部署phpwind;部署phpBB的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ubuntu 如何在任意终端不填加./就
- 下一篇: POJ 3613