lamp環境下論壇的實現

1.lamp簡介

     Linux-Apache-MySQL-PHP的LAMP一直是最流行的Web開發平臺。LAMP之所以很受歡迎,是因爲與其它平臺相比,它具有很多優勢。1)成本低廉,擴展能力好。2)部署量大,安全性高LAMP因其部署量非常大,安全問題也更少,因爲能發現的問題幾乎都被翻了過遍,它也是全世界範圍內測試最徹底的軟件組合。靈活,穩定LAMP也提供了非常好的靈活性,開發人員可以選擇自己喜歡的框架,甚至構建自己的框架。

2.lamp+bbs的詳細配置

1)爲比較方便的安裝所需要的軟件配置本地yum

[root@localhost ~]# mkdir /mnt/cdrom    //創建/mnt/cdrom目錄

[root@localhost ~]# mount /dev/cdrom   /mnt/cdrom    //掛載光盤

編輯yum配置文件

[root@localhost Server]# vim /etc/yum.repos.d/rhel-debuginfo.repo

文件修改如下圖

wps_clip_image-7650

2)安裝httpd 服務

[root@localhost Server]# yum install httpd -y

3)安裝mysql

[root@localhost Server]# yum install mysql  mysql-server  -y

[root@localhost Server]# yum list all |grep php

4)安裝php

[root@localhost Server]# yum install php php-mysql   php-mbstring

5)啓動所需的服務

wps_clip_image-8196

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

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

6)測試php

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

[root@localhost html]# vim index.php

編輯的文件如下圖

wps_clip_image-8509

測試信息如下

wps_clip_image-8702

7)測試php是否能調用mysql

[root@localhost html]# vim index.php

網頁文件如下

wps_clip_image-9012

測試信息如下

wps_clip_image-9254

8)利用lamp+phpwind創建論壇

查看phpwind壓縮文件

wps_clip_image-9603

9)解壓phpwind壓縮文件

[root@localhost ~]# unzip phpwind_GBK_8.3.zip

[root@localhost ~]# cd phpwind_GBK_8.3

10)解壓phpwind壓縮文件

wps_clip_image-10073

10)安裝論壇

wps_clip_image-10579

11)按照網頁上的提示改變文件夾權限

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

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

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

12)創建論壇數據庫

[root@localhost phpwind]# mysql

mysql> create database phpwind;

mysql> use phpwind;      

mysql> mysqladmin  -u  user root -p password '123‘;   //創建數據庫用戶名密碼

安裝完成

wps_clip_image-10864

13)測試

wps_clip_image-11122

14)構建基於主機頭的網站

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

wps_clip_image-11278

wps_clip_image-12624

重啓服務

wps_clip_image-11370

15)修改測試機上的host文件

wps_clip_image-11523

用主機名測試

wps_clip_image-11752

Lamp+Wordpress實現構建論壇

1) 解壓wordpress包

[root@localhost ~]# cd wordpress

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

[root@localhost wordpress]# 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/wordpress/

[root@localhost wordpress-3.0.5-zh_CN]# cd /var/www/html

[root@localhost html]# ll

總計 20

-rw-r--r--  1 root root  110 07-26 00:00 index.php

drwxr-xr-x 22 root root 4096 07-26 02:22 phpwind

drwxr-xr-x  5 root root 4096 2011-02-09 wordpress

2)配置httpd.conf配置如下圖

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

wps_clip_image-12251

3)wordpress的相關配置

[root@localhost wordpress]# ls |grep wp-config

wp-config-sample.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;

mysql> create database wordpress                              //創建wordpress數據庫

4)配置wp-config.php

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

wps_clip_image-13107

重啓服務

[root@localhost wordpress]# service httpd restart

客戶端配置

wps_clip_image-13483

5)論壇配置

wps_clip_image-13626

wps_clip_image-13714

管理界面

wps_clip_image-13842

論壇首頁

wps_clip_image-14008

6)更換主題

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

[root@localhost html]# cd wordpress

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

[root@localhost wp-content]# ll

總計 20

-rw-r--r-- 1 root   root     30 2011-02-08 index.php

drwxr-xr-x 2 root   root   4096 2011-02-08 languages

drwxr-xr-x 3 root   root   4096 2011-02-08 plugins

drwxr-xr-x 3 root   root   4096 2011-02-08 themes

[root@localhost wp-content]# cd uploads

[root@localhost uploads]# cd ../themes/

[root@localhost themes]# cp  ../uploads/Stratex.zip ./

[root@localhost themes]# unzip Stratex.zip

7)安裝主題的界面

wps_clip_image-14240

8)安裝後的主題

wps_clip_image-14563

9)更換主題後的首頁。

wps_clip_image-14704

lamp+Discuz實現論壇

1)解壓文件

[root@localhost ]# mkdir discuz

[root@localhost discuz]# cd discuz

[root@localhost discuz]# unzip Discuz_X2.5_SC_GBK.zip

解壓後所形成的文件

7

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

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

修改用戶host文件

4

修改/etc/httpd/conf/httpd.conf

8 

訪問網站

1

2)按照網頁提示做如下操作
[root@localhost discuz]# cd config

創建所需文件

[root@localhost config]# cp  config_global_default.php  config_global.php
[root@localhost config]# cp  config_ucenter_default.php  config_ucenter.php

改變文件權限

[root@localhost config]# chmod 777 config_global.php
[root@localhost config]# chmod 777 config_ucenter.php

[root@localhost discuz]# chmod 777 -R config
[root@localhost discuz]# chmod 777 -R data
[root@localhost discuz]# chmod 777 -R uc_client
[root@localhost discuz]# chmod 777 -R uc_server

config目錄下的文件如下

[root@localhost discuz]# cd config
[root@localhost config]# ll
總計 16
-rwxrwxrwx 1 root root 7637 07-02 13:54 config_global_default.php
-rwxrwxrwx 1 root root 1512 07-02 13:54 config_ucenter_default.php
-rwxrwxrwx 1 root root    1 07-02 13:54 index.htm

創建數據庫

5

修改/var/www/html/discuz/config目錄下的文件如下所示

6

3)安裝成功後頁面

2

訪問論壇首頁

3

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章