利用源碼實現論壇搭建

一、PHPWind 是一套採用 php+mysql 數據庫方式運行並可生成 html 頁面的全新且完善的強大系統。咱們但願做爲一個開源.共享的軟件,PHPWind 能夠以其流暢的速度與高負載能力激起各位加入PHPWind陣營的熱情,共同打造專業品牌。 php

PHPWind 除了具有多重子版塊和後臺用戶組權限能夠自由組合外,還具有分版塊控制生成html頁面、可選用的所見即所得編輯器、防止圖片和附件防盜鏈、多附件上傳下載、輸入圖片URL直接顯示圖片、版塊主題分類、版塊積分控制與版塊內的用戶組權限控制、主題與回覆審覈功能、自定義積分與自定義等級提高系統、論壇用戶宣傳接口、帖子加密隱藏出售、分論壇二級目錄/域名等一些特點功能. 從而減輕了大部分論壇程序中都必需要藉助開發hack才能實現的諸多工做。 css

PHPWind的特色 一、PHPWind v5.3進一步改進系統底層架構,極大提升了系統負載能力和穩定性,下降系統資源的消耗,讓論壇在高壓力環境下保持快速、穩定的數據運行,保障論壇的正常運行。 html

二、國內首家PHP論壇支持數據表分卷技術。這是PHPWind一項重大的技術突破,爲解決高負載、大數據量身定作,後臺自主操做,將一個大表分紅多個小表,很是實用的應用到大型網站的數據庫中,下降數據庫負載,提供數據庫查詢速度,實現網站速度的再一次技術性提高; mysql

三、全面升級的朋友圈。Web2.0其中最重要的一個表現形式,即是擁有共同興趣愛好的圈子文化流行。PHPWind v5.3從衆多的web2.0網站中獲取創意源頭,在原來的朋友圈基礎上開發出具備重大意義的朋友圈升級版,並可利用朋友圈功能充分消費論壇積分,刺激論壇積分的流通,在用戶得到個性張揚的同時又讓論壇得到更好的交流氣氛; web

四、重構的表情分組技術。PHPWind v5.3更注重用戶的使用習慣和使用方便程度。新的表情分組技術不但支持支持從後臺批量添加表情,更支持將表情實行按組分門別類,同時在用戶前臺美化發帖界面和表情顯示方式,讓用戶得到更多充滿靈性和創意的交流想象空間; sql

五、全面符合w3c、xhtml等網頁編碼標準的論壇模版體系。相比國內同類論壇仍然停留在 HTML4.0的現狀,PHPWind v5.3無疑又堅決的向前邁進了一大步。PHPWind v5.3採用了 xhtml 1.0 transtional 重構模板,能更有效的提升css樣式的使用擴張性以及對搜索引擎的友好度,更讓人堅信重構的模版能讓PHPWind論壇系統前臺的訪問速度快上加快,一路絕塵傲視國內全部論壇系統; 數據庫

六、全面優化的所見即所得編輯器。早在PHPWind v3.0的時候PHPWind就率先開發了所見即所得編輯器,獲得了廣大用戶的確定和普遍的使用,PHPWind v5.3在此基礎上減小和優化編輯器代碼,讓所見即所得編輯器加載速度更快,使用更加人性、簡單、便利; apache

七、強化系統緩存機制。對系統緩存機制進一步優化和完善,減小頁面所包含的文件個數,讓系統運行更加流暢、穩定、安全; vim

八、從廣大站長利益出發,強化廣告插件,增長更多表現形式,如彈窗,懸浮,對聯等; 瀏覽器

九、自定義頭部、底部導航菜單。用戶可在後臺控制並自主修改導航欄菜單,再也無須改動模板,便可輕鬆管理論壇導航欄,真正實現論壇建設後臺管理化;

十、防灌水注冊機機制。PHPWind 5.3採用了各個獨立論壇獨立設置註冊選項、提交數據表單等內容,最大限度防治灌水注冊機的橫行霸道;

十一、發帖認證碼功能。用戶可選擇設置一個數值,則發貼數小於這個數值的會員,將顯示驗證碼;此功能將最大程度提升論壇帖子質量,又不影響論壇的易用性;

十二、針對搜索引擎的優化。輕鬆定義的網頁標題文字、關鍵字設置等,讓論壇更具人性化管理,輕鬆後臺管理便可打造完美論壇;

1三、用戶前、後臺體驗再度提高。PHPWind v5.3採用了新界面、新佈局、新表現形式,最大可能的發掘用戶體驗,加強用戶對論壇的粘性和好感,爲論壇的發展提早作好用戶體驗性鋪墊;PHPWind v5.3正式版還首次對論壇系統的管理後臺風格做出了重大的改變,全新的後臺風格,條理更加清晰、界面更加時尚、管理更加方便……管理之際亦能享受舒服的視覺效果,讓PHPWind v5.3經典之做更添厚重一筆;

1四、PHPWind v5.3多達100多項功能修正、增強、完善,爲廣大用戶提供一個安全、易用、美觀的論壇系統;

Linux+Apache+Mysql+Perl/PHP/Python一組經常使用來搭建動態網站或者服務器的開源軟件,自己都是各自獨立的程序,可是由於常被放在一塊兒使用,擁有了愈來愈高的兼容度,共同組成了一個強大的Web應用程序平臺。隨着開源潮流的蓬勃發展,開放源代碼的LAMP已經與J2EE和.Net商業軟件造成三足鼎立之勢,而且該軟件開發的項目在軟件方面的投資成本較低,所以受到整個IT界的關注。從網站的流量上來講,70%以上的訪問流量是LAMP來提供的,LAMP是最強大的網站解決方案. 本次配置沒有利用源代碼搭建環境。使用光盤進行的環境搭建。

lamp環境的搭建

爲了方便安裝。首先進行yum的搭建。這裏就不作說明了。前面博客裏有詳細步驟。

[root@localhost ~]# mount /dev/cdrom /mnt/cdrom

[root@localhost ~]# yum install httpd –y //安裝apache

[root@localhost ~]# yum install mysql mysql-server –y //安裝mysql 和mysql服務器

[root@localhost ~]# yum install php php-mbstring php-mysql –y //安裝php

[root@localhost phpwind]# mysqladmin -u root -p password '123' //爲mysql管理員設置密碼

[root@localhost ~]# service httpd start //啓動apache服務

[root@localhost ~]# service mysqld start //啓動mysql

[root@localhost ~]# chkconfig httpd on
[root@localhost ~]# chkconfig mysqld on //設置開機啓動

咱們先作一個測試頁面,建議用戶將瀏覽器安全級別設爲中或中低

[root@localhost ~]# cd /var/www/html

[root@localhost html]# vim index.php

<?php
phpinfo() ;
?>

[root@localhost html]# service httpd restart

image

將phpwind_GBK_8.3.zip

wordpress_v3.0.5-zh_CN.zip

Discuz_7.2_SC_UTF8.zip

UCenter_1.5.0_SC_UTF8.zip導入到/root目錄下

[root@localhost ~]# ll
總計 20236
-rw------- 1 root root 1287 08-11 23:13 anaconda-ks.cfg
drwxr-xr-x 2 root root 4096 08-11 15:20 Desktop
-rw-r--r-- 1 root root 4241904 08-12 00:58 Discuz_7.2_SC_GBK.zip
-rw-r--r-- 1 root root 35369 08-11 23:13 install.log
-rw-r--r-- 1 root root 3995 08-11 23:11 install.log.syslog
-rw-r--r-- 1 root root 11962650 08-12 00:51 phpwind_GBK_8.3.zip
-rw-r--r-- 1 root root 592586 08-12 00:51 Stratex.zip
-rw-r--r-- 1 root root 497931 08-12 00:51 WireMagazine.zip
-rw-r--r-- 1 root root 3322727 08-12 00:51 wordpress_v3.0.5-zh_CN.zip

案例一

phpwind的搭建

[root@localhost ~]# unzip phpwind_GBK_8.3.zip //解壓縮

[root@localhost ~]# cd phpwind_GBK_8.3

咱們須要把upload 傳到網站目錄下

[root@localhost phpwind_GBK_8.3]# mv upload/ /var/www/html/phpwind

在客戶端瀏覽器中輸入http://192.168.145.100 出現結果以下:

image

咱們只須要把編碼方式改成簡體中文GB2312 便可正常顯示。但打開一次就選擇編碼方式有些麻煩。能夠做以下修改:

[root@localhost phpwind_GBK_8.3]# vim /etc/httpd/conf/httpd.conf

大概在746行

746 #AddDefaultCharset UTF-8

[root@localhost phpwind_GBK_8.3]# service httpd restart

image

須要按照上述要求修改上述文件的權限,爲了方便起見。我把上述目錄下的全部文件修改了屬性。

[root@localhost phpwind_GBK_8.3]# cd /var/www/html/phpwind/

[root@localhost phpwind]# chmod -R 777 attachment
[root@localhost phpwind]# chmod -R 777 data
[root@localhost phpwind]# chmod -R 777 html

image

咱們還須要創建數據庫

[root@localhost phpwind]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; create database phpwind;

image

系統自動建立表,安裝成功。

image

image

咱們還須要刪除上述文件

[root@localhost phpwind]# rm -rf install.php

image

咱們就能夠對論壇進行模塊等一系列的編輯。

image

image

image

下面會寫出三個案例的站點配置。請稍後。。。

案例二

wordpress的搭建

[root@localhost ~]# unzip wordpress_v3.0.5-zh_CN.zip //解壓縮

[root@localhost ~]# cd wordpress-3.0.5-zh_CN/

[root@localhost wordpress-3.0.5-zh_CN]# ll
總計 4
drwxr-xr-x 5 root root 4096 2011-02-09 wordpress

[root@localhost wordpress-3.0.5-zh_CN]# mv wordpress/ /var/www/html/
[root@localhost wordpress-3.0.5-zh_CN]# cd /var/www/html/
[root@localhost html]# ll
總計 12
-rw-r--r-- 1 root root 19 08-12 00:46 index.php
drwxr-xr-x 22 root root 4096 08-28 12:09 phpwind
drwxr-xr-x 5 root root 4096 2011-02-09 wordpress

在客戶端輸入http://192.168.145.100/wordpress

image

[root@localhost html]# cd wordpress/
[root@localhost wordpress]# ls
index.php wp-blog-header.php wp-includes wp-register.php
license.txt wp-comments-post.php wp-links-opml.php wp-rss2.php
readme.html wp-commentsrss2.php wp-load.php wp-rss.php
wp-activate.php wp-config-sample.php wp-login.php wp-settings.php
wp-admin wp-content wp-mail.php wp-signup.php
wp-app.php wp-cron.php wp-pass.php wp-trackback.php
wp-atom.php wp-feed.php wp-rdf.php xmlrpc.php
[root@localhost wordpress]# cp wp-config-sample.php wp-config.php
[root@localhost wordpress]# chown apache.apache wp-config.php //改變全部者

建立數據庫:

[root@localhost wordpress]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 45
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; create database wordpress
-&gt; ;
Query OK, 1 row affected (0.00 sec)

編輯文件以下:

[root@localhost wordpress]# vim wp-config.php

image

刷新網站

image

image

主站點頁面

image

咱們也能夠安裝主題。

image

點擊如今安裝。

image

[root@localhost wordpress]# chmod o+w wp-content/

刷新網頁會看到頁面

[root@localhost wordpress]# cd wp-content/uploads/
[root@localhost uploads]# cd ../themes/
[root@localhost themes]# cp ../uploads/Stratex.zip ./
[root@localhost themes]# unzip Stratex.zip

image

啓用便可。

image

主題更改爲功。

案例三

discuz的搭建

[root@localhost ~]# unzip Discuz_7.2_SC_UTF8.zip

[root@localhost ~]# mv upload/ /var/www/html/Discuz

[root@localhost ~]# cd /var/www/html/Discuz/

客戶端瀏覽器輸入http://192.168.145.100/Discuz/install

image

image

[root@localhost Discuz]# chmod -R 777 config.inc.php
[root@localhost Discuz]# chmod -R 777 attachments
[root@localhost Discuz]# chmod -R 777 forumdata/
[root@localhost Discuz]# chmod -R 777 uc_client/

[root@localhost Discuz]# vim config.inc.php 修改以下:

13
14 $dbhost = 'localhost'; // 數據庫服務器
15 $dbuser = 'root'; // 數據庫用戶名
16 $dbpw = '123'; // 數據庫密碼
17 $dbname = 'discuz'; // 數據庫名
18 $pconnect = 0; // 數據庫持久鏈接 0=關閉, 1=打開

創建數據庫:

[root@localhost Discuz]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 118
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; create database discuz
-&gt; ;
Query OK, 1 row affected (0.00 sec)

mysql&gt; \q

image

因此咱們還須要UCenter的安裝

[root@localhost ~]# unzip UCenter_1.5.0_SC_UTF8.zip

[root@localhost ~]# mv upload/ /var/www/html/ucenter
在客戶端瀏覽器輸入http://192.168.145.100/ucenter/install

image

[root@localhost ~]# cd /var/www/html/
[root@localhost html]# cd ucenter/

[root@localhost ucenter]# chmod -R 777 data/

image

創建數據庫:

[root@localhost ucenter]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4
Server version: 5.0.77 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql&gt; create database ucenter;

image

可能驗證碼顯示不出來。咱們須要做以下修改:

[root@localhost ucenter]# vim control/admin/seccode.php

image

image

image

咱們就能夠進行配置了

而後進入咱們的Discuz安裝http://192.168.145.100/Discuz/install

image

image

在客戶端瀏覽器中輸入http://192.168.145.100/Discuz

image

這樣咱們就能夠進行本身的設置了

另外網上有含UCenter的discuz包。你們能夠下,也能夠聯繫我。

下面進行虛擬目錄的配置

[root@localhost ~]# vim /etc/httpd/conf/httpd.conf

978 NameVirtualHost 192.168.145.100:80

994 # ServerName dummy-host.example.com
995 # ErrorLog logs/dummy-host.example.com-error_log
996 # CustomLog logs/dummy-host.example.com-access_log common
997 #</VirtualHost>
998 <VirtualHost 192.168.145.100:80>
999 ServerAdmin zhangzhen0324@126.com
1000 DocumentRoot /var/www/html/phpwind
1001 ServerName www.phpwind.com
1002 ErrorLog logs/error_log
1003 CustomLog logs/access_log common
1004 </VirtualHost>
1005 <VirtualHost 192.168.145.100:80>
1006 ServerAdmin zhangzhen0324@126.com
1007 DocumentRoot /var/www/html/wordpress
1008 ServerName www.wordpress.com
1009 ErrorLog logs/error_log
1010 CustomLog logs/access_log common
1011 </VirtualHost>
1012 <VirtualHost 192.168.145.100:80>
1013 ServerAdmin zhangzhen0324@126.com
1014 DocumentRoot /var/www/html/Discuz
1015 ServerName www.discuz.com
1016 ErrorLog logs/error_log
1017 CustomLog logs/access_log common
1018 </VirtualHost>

[root@localhost ~]# service httpd restart

在這裏咱們就不作DNS服務器的搭建了

在客戶端裏編輯C:\Windows\System32\drivers\etc\hosts

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 localhost

192.168.145.100 www.phpwind.com
192.168.145.100 www.wordpress.com
192.168.145.100 www.discuz.com

這樣咱們就能夠進行測試了

www.phpwind.com

image

www.discuz.com

image

www.wordpress.com

image

解決辦法以下:

[root@localhost ~]# vim /etc/httpd/conf/httpd.conf 修改以下:

Alias /wordpress/ "/var/www/html/wordpress/"
540 <Directory "/var/www/html/wordpress">
541 Options Indexes MultiViews
542 AllowOverride None
543 Order allow,deny
544 Allow from all
545 </Directory> //定義別名

546 Alias /icons/ "/var/www/icons/"
547 <Directory "/var/www/icons">
548 Options Indexes MultiViews
549 AllowOverride None
550 Order allow,deny
551 Allow from all
552 </Directory>

[root@localhost ~]# service httpd restart

image

相關文章
相關標籤/搜索