轉:http://blog.51cto.com/haoxiaoyang/810613php
phpwind,wordpress,discuz3大論壇羣英聚會html
目前世界最流行的企業建站方式是LAMP(Linux+Apache+MySQL+PHP),即便用Linux做爲操做系統,Apache做爲Web服務器,MySQL做爲數據庫,PHP做爲服務器端腳本解釋器。這四個軟件都是遵循GPL的開放源碼軟件,它們安全、穩定、快速、功能強大,使用它們能夠創建一個快速、穩定、免費的網站系統。mysql
1.APACHE的簡介sql
Apache是世界使用排名第一的Web服務器,市場佔有率達60%左右。數據庫
它的特色是簡單、速度快、性能穩定。apache
它的成功之處主要在於它的源代碼開放、有一支開放的開發隊伍、支持跨平臺的應用(能夠運行在幾乎全部的Unix、Windows、Linux系統平臺上)、模塊化結構以及它的可移植性等方面。編程
若是你準備選擇Web服務器,毫無疑問Apache是你的最佳選擇。接下來就開始咱們的宏大的計劃。vim
2.Mysql 數據庫的簡介瀏覽器
MySQL在過去因爲性能高、成本低、可靠性好,已經成爲最流行的開源數據庫,所以被普遍地應用在Internet上的中小型網站中。隨着MySQL的不斷成熟,它也逐漸用於更多大規模網站和應用,好比維基百科、Google和Facebook等網站。很是流行的開源軟件組合LAMP中的「M」指的就是MySQL。安全
3. PHP的簡介
PHP 是一門簡單而有效的編程語言,它像是粘合劑,能夠將 LAMP 系統全部其餘的組件粘合在一塊兒。您可使用 PHP 編寫能訪問 MySQL 數據庫中的數據和 Linux 提供的一些特性的動態內容。
4.phpwind,wordpress,discuz論壇的簡介
phpwind http://baike.baidu.com/view/87742.htm
wordpress http://baike.baidu.com/view/23618.htm
discuz http://baike.baidu.com/view/107885.htm
注:實驗的源碼的下載地址http://down.51cto.com/data/403731
LAMP 安裝 配置
配置環境
操做系統:Redhat Enterprise 5 內核版本2.6.18-164.el5
而後下載文件 mysql, apache, php ,請到下面的官方網址下載相應軟件
http://www.apache.org/
http://www.php.net/
http://www.mysql.com/
在這裏咱們使用 server 目錄下的相關rpm包
httpd-2.2.3-31.el5.i386.rpm apache 主配置文檔
httpd-devel-2.2.3-31.el5.i386.rpm
httpd-manual-2.2.3-31.el5.i386.rpm apache的相關手冊
mysql-5.0.77-3.el5.i386.rpm mysql的rpm 包
mysql-server-5.0.77-3.el5.i386.rpm mysql服務器的主配置文檔
php-5.1.6-23.2.el5_3.i386.rpm php 動態腳本
php-mysql-5.1.6-23.2.el5_3.i386.rpm php和mysql數據庫之間的鏈接器件
其餘
phpMyAdmin-2.11.10.1-all-languages.zip phpmyadmin的管理工具的源碼
phpwind_GBK_8.3.zip phpwind的論壇的源碼
wordpress_v3.0.5-zh_CN.zip wordpress論壇的源碼
Discuz_7.2_FULL_SC_GBK.zip discuz論壇的源碼
一:安裝apache
1:[root@zzu ~]# yum install http* 安裝http的包
[root@zzu ~]# cd /var/www/html/
[root@zzu html]# ll
total 0
2:[root@zzu html]# vim index.html 創建一個測試頁
hello the world!!!!!!!!
3: [root@zzu html]# service httpd start 啓動httpd的服務
Starting httpd: [ OK ]
4:測試
5: [root@zzu html]# chkconfig httpd on 設置httpd服務爲自動啓動
二:安裝mysql
1:[root@zzu html]# yum install mysql* 安裝mysql的包
Running Transaction
Installing : perl-DBI 1/10
Installing : mysql 2/10
Installing : perl-DBD-MySQL 3/10
Installing : mysql-server 4/10
Installing : libtool-ltdl 5/10
Installing : unixODBC 6/10
Installing : mysql-connector-odbc 7/10
Installing : mysql-bench 8/10
Installing : mysql-test 9/10
Installing : mysql-devel 10/10
2[root@zzu html]# service mysqld start 啓動mysqld服務
3: [root@zzu html]# chkconfig mysqld on 設置mysqld爲自動啓動
[root@zzu html]# netstat -tupln|grep mysql 查看端口的狀態
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 449/mysqld
[root@zzu html]#
三:安裝php
1:創建一個index.php的測試頁面
[root@zzu ~]# yum install php*
[root@zzu html]# cd /var/www/html/
[root@zzu html]# ll
total 4
-rw-r--r-- 1 root root 24 Mar 9 01:09 index.html
[root@zzu html]# mv index.html index.php
[root@zzu html]# ll
total 4
-rw-r--r-- 1 root root 24 Mar 9 01:09 index.php
[root@zzu html]# vim index.php
hello the world!!!!!!!!
<?php
phpinfo(); //測試http和php的結合
?>
注意:在這裏咱們知道了php是apache的一個模塊,這樣的話能夠減小對系統資源的佔用
Cat /etc/httpd/conf.d/php.conf
Cd /etc/httpd/modues/libphp5.mode
2:從新啓動apache的服務
[root@zzu html]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
3:在客戶機上進行測試
4:修改 /var/www/html/index.php 的首頁
[root@zzu ~]# vim /var/www/html/index.php
hello the world!!!!!!!!
<?php
$link=mysql_connect('127.0.0.1','root','');
if($link)
echo "ok"; //驗證php和mysql之間的鏈接
else
echo "not ok";
?>
這裏咱們看到咱們已經鏈接成功,可是這樣管理mysql的話會比較麻煩,安全性也不是很高。
四:咱們下載phpmyadmin的圖形化管理工具
1:使用工具下載好的軟件包放在/root的目錄下
[root@zzu ~]# ll
total 16160
drwxr-xr-x 2 root root 4096 Feb 7 19:03 Desktop
-rw------- 1 root root 1310 Feb 8 01:55 anaconda-ks.cfg
-rw-r--r-- 1 root root 35236 Feb 8 01:55 install.log
-rw-r--r-- 1 root root 3995 Feb 8 01:54 install.log.syslog
-rw-r--r-- 1 root root 4483812 Mar 9 01:03 phpMyAdmin-2.11.10.1-all-languages.zip
-rw-r--r-- 1 root root 11962650 Mar 9 01:03 phpwind_GBK_8.3.zip
2.解壓縮
[root@zzu ~]# unzip phpMyAdmin-2.11.10.1-all-languages.zip
[root@zzu ~]# ll
total 16164
drwxr-xr-x 2 root root 4096 Feb 7 19:03 Desktop
-rw------- 1 root root 1310 Feb 8 01:55 anaconda-ks.cfg
-rw-r--r-- 1 root root 35236 Feb 8 01:55 install.log
-rw-r--r-- 1 root root 3995 Feb 8 01:54 install.log.syslog
drwxr-xr-x 9 root root 4096 Aug 20 2010 phpMyAdmin-2.11.10.1-all-languages
-rw-r--r-- 1 root root 4483812 Mar 9 01:03 phpMyAdmin-2.11.10.1-all-languages.zip
-rw-r--r-- 1 root root 11962650 Mar 9 01:03 phpwind_GBK_8.3.zip
-rw-r--r-- 1 root root 688 Mar 9 01:03 server.repo
-rw-r--r-- 1 root root 1141 Mar 8 22:47 userquota.sh
3:移動 phpMyAdmin-2.11.10.1-all-languages 目錄到網站的根目錄下面
[root@zzu ~]# mv phpMyAdmin-2.11.10.1-all-languages /var/www/html/phpmyadmin
4:在客戶端進行先關的驗證
能夠看到咱們已經進入了mysql的管理頁面啦,在這裏咱們能夠增長刪除數據庫,並做相應的操做啦。
爲了安全起見咱們可使用一下的命令給數據庫更改密碼
a、安裝完成mysql爲空密碼,修改密碼方式:
mysqladmin -u root password newpassword
b、用戶已經有舊密碼的更改方式:
MYSQLADMIN -u root -p'oldpassword' PASSWORD newpassword //須要注意的地方是新的密碼不須要引號進行標識
http://blog.chinaunix.net/uid-18933439-id-2808698.html
五:搭建phpwind論壇
1:[root@zzu ~]# unzip phpwind_GBK_8.3 解壓縮
[root@zzu ~]# ll
total 16164
drwxr-xr-x 2 root root 4096 Feb 7 19:03 Desktop
-rw------- 1 root root 1310 Feb 8 01:55 anaconda-ks.cfg
-rw-r--r-- 1 root root 35236 Feb 8 01:55 install.log
-rw-r--r-- 1 root root 3995 Feb 8 01:54 install.log.syslog
-rw-r--r-- 1 root root 4483812 Mar 9 01:03 phpMyAdmin-2.11.10.1-all-languages.zip
drwxr-xr-x 4 root root 4096 Dec 21 2010 phpwind_GBK_8.3
-rw-r--r-- 1 root root 11962650 Mar 9 01:03 phpwind_GBK_8.3.zip
-rw-r--r-- 1 root root 688 Mar 9 01:03 server.repo
-rw-r--r-- 1 root root 1141 Mar 8 22:47 userquota.sh:
2:移動 phpwind_GBK_8.3/upload 到網站的根目錄下並命名爲phpwind
[root@zzu ~]# cd phpwind_GBK_8.3
[root@zzu phpwind_GBK_8.3]# ll
total 8
drwxr-xr-x 4 root root 4096 Dec 21 2010 docs
drwxr-xr-x 22 root root 4096 Dec 21 2010 upload
[root@zzu phpwind_GBK_8.3]# mv upload /var/www/html/phpwind
3: 從新啓動各個服務,確保不出現錯誤
[root@zzu upload]# vim /etc/httpd/conf/httpd.conf
748 #AddDefaultCharset UTF-8 修改http的字符編碼方式,提升瀏覽器的兼容性
[root@zzu phpwind]# service httpd restart
Stopping httpd: [ OK ]
Starting httpd: [ OK ]
[root@zzu phpwind]# service mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]
[root@zzu phpwind]#
4:測試
5:改變目錄和文件的相應的屬性
[root@zzu phpwind]# chmod -R 777 attachment
[root@zzu phpwind]# chmod -R 777 data
[root@zzu phpwind]# chmod -R 777 html
6:點擊開始安裝
7:這裏數據庫密碼爲空的話,會出現提示,但沒關係。
[root@zzu phpwind]# rm install.php 刪除安裝的php 頁面
rm: remove regular file `install.php'? y
8: 進入論壇的首頁前臺
9:使用管理員的帳戶進入論壇的後臺,輸入帳號:admin 密碼:admin
這樣咱們就來到了論壇的後臺,在這裏咱們能夠增長和刪除模塊,發表帖子和管理其餘帳戶的帖子。
若是你敢興趣的話,你能夠對本身的論壇進行更深一步的完善,我就再也不爲你們演示啦。
小結:lamp環境使咱們能夠輕鬆的搭建咱們的網站,和本身的論壇
六:搭建wordpress的論壇
********************************************************************
首先咱們須要在數據庫裏面建立wordpres的數據庫
********************************************************************
[root@zzu ~]# unzip wordpress_v3.0.5-zh_CN.zip
[root@zzu ~]# ll
total 19560
drwxr-xr-x 2 root root 4096 May 5 16:14 wordpress-3.0.5-zh_CN
-rw-r--r-- 1 root root 3322727 May 5 15:39 wordpress_v3.0.5-zh_CN.zip
[root@zzu ~]# mv wordpress-3.0.5-zh_CN/wordpress /var/www/html/
[root@zzu html]# ll
total 16
-rw-r--r-- 1 root root 129 May 5 13:24 index.php
drwxr-xr-x 9 root root 4096 Aug 20 2010 phpmyadmin
drwxr-xr-x 22 root root 4096 May 5 13:38 phpwind
drwxr-xr-x 5 root root 4096 Feb 9 2011 wordpress
[root@zzu ~]# cd /var/www/html/wordpress/
[root@zzu wordpress]# vim wp-config.php
<?php
/**
* WordPress 基礎配置文件。
*
* 本文件包含如下配置選項: MySQL 設置、數據庫表名前綴、
* 密匙、WordPress 語言設定以及 ABSPATH。如需更多信息,請訪問
* {@link http://codex.wordpress.org/Editing_wp-config.php 編輯
* wp-config.php} Codex 頁面。MySQL 設置具體信息請諮詢您的空間提供商。
*
* 這個文件用在於安裝程序自動生成 wp-config.php 配置文件,
* 您能夠手動複製這個文件,並重命名爲 wp-config.php,而後輸入相關信息。
..............
?>
下面熟悉一下咱們的wordpress,對其進行簡單的管理
爲咱們的wordpress的更換下主題,使其更加的美觀
[root@zzu ~]# ll
total 20644
drwxr-xr-x 8 root root 4096 Jul 20 2011 Stratex
-rw-r--r-- 1 root root 592586 May 5 18:04 Stratex.zip
drwxr-xr-x 8 root root 4096 Jul 22 2011 WireMagazine
-rw-r--r-- 1 root root 497931 May 5 18:04 WireMagazine.zip
[root@zzu ~]# mv Stratex WireMagazine /var/www/html/wordpress/wp-admin/themes
七:搭建discuz論壇
[root@zzu ~]# unzip Discuz_7.2_FULL_SC_GBK.zip
[root@zzu ~]# ll
drwxr-xr-x 2 root root 4096 May 5 19:14 readme
drwxr-xr-x 18 root root 4096 Jan 6 2010 upload
drwxr-xr-x 2 root root 4096 May 5 19:14 utilities
[root@zzu ~]# mv upload/ /var/www/html/discuz
[root@zzu discuz]# chmod 666 config.inc.php
[root@zzu discuz]# chmod -R 777 attachments forumdata/
[root@zzu discuz]# chmod -R 777 uc_client/data/cache/
總結:
整整花了半天的時間就拿下了3個論壇內心面仍是挺不錯的,繼續努力。