歡迎您光臨本站 註冊首頁

使用lamp搭建Discuz論壇

←手機掃碼閱讀     火星人 @ 2014-03-09 , reply:0

實驗名稱:論壇軟體系統Discuz! 實驗概述:採用linux apache mysql php搭建Discuz論壇 實驗步驟: 1.首先,將實驗所需要的軟體包全都安裝上: [root@localhost ~]# mount /dev/cdrom /mnt mount: block device /dev/cdrom is write-protected, mounting read-only [root@localhost ~]# cd /mnt/Server/ [root@localhost Server]# [root@localhost Server]# rpm -ivh bind-9.3.3-7.el5.i386.rpm caching-nameserver-9.3.3-7.el5.i386.rpm warning: bind-9.3.3-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] 1:bind ########################################### [ 50%] 2:caching-nameserver ########################################### [100%] [root@localhost Server]# rpm -ivh httpd-2.2.3-6.el5.i386.rpm warning: httpd-2.2.3-6.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] 1:httpd ########################################### [100%] [root@localhost Server]# rpm -ivh php-5.1.6-5.el5.i386.rpm php-cli-5.1.6-5.el5.i386.rpm php-common-5.1.6-5.el5.i386.rpm warning: php-5.1.6-5.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] 1:php-common ########################################### [ 33%] 2:php-cli ########################################### [ 67%] 3:php ########################################### [100%] [root@localhost Server]# rpm -ivh mysql-5.0.22-2.1.i386.rpm mysql-server-5.0.22-2.1.i386.rpm php-mysql-5.1.6-5.el5.i386.rpm php-pdo-5.1.6-5.el5.i386.rpm perl-DBD-MySQL-3.0007-1.fc6.i386.rpm perl-DBI-1.52-1.fc6.i386.rpm

warning: mysql-5.0.22-2.1.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186 Preparing... ########################################### [100%] 1:perl-DBI ########################################### [ 17%] 2:mysql ########################################### [ 33%] 3:perl-DBD-MySQL ########################################### [ 50%] 4:php-pdo ########################################### [ 67%] 5:mysql-server ########################################### [ 83%] 6:php-mysql ########################################### [100%] [root@localhost ~]# service named start Starting named: [ OK ] [root@localhost ~]# vim /etc/named.caching-nameserver.conf 將這四行註釋了: // listen-on port 53 { 127.0.0.1; }; // allow-query { localhost; }; // match-clients { localhost; }; // match-destinations { localhost; }; 添加一個區域: [root@localhost ~]# vim /etc/named.rfc1912.zones zone "wuli.com" IN { type master; file "wuli.com.zone"; }; [root@localhost ~]# vim /var/named/wuli.com.zone @ IN SOA ns.wuli.com. root.wuli.com. ( 20090318 28800 14400 3600000 86400) @ IN NS ns.wuli.com. ns IN A 172.16.4.5 www IN CNAME ns.wuli.com. bbs IN CNAME ns.wuli.com. 編輯/etc/resolv.conf中添加如下: [root@localhost ~]#

vim /etc/resolv.conf nameserver 172.16.4.5 重啟服務: [root@localhost ~]# service named restart Stopping named: [ OK ] Starting named: [ OK ] 測試一下: [root@localhost ~]# nslookup > www.wuli.com Server: 172.16.4.5 Address: 172.16.4.5#53 www.wuli.com canonical name = ns.wuli.com. Name: ns.wuli.com Address: 172.16.4.5 > bbs.wuli.com Server: 172.16.4.5 Address: 172.16.4.5#53 bbs.wuli.com canonical name = ns.wuli.com. Name: ns.wuli.com Address: 172.16.4.5 開啟Apache服務: [root@localhost ~]# service httpd start Starting httpd: [ OK ] 編輯如下修改其中的四項: [root@localhost ~]# vim /etc/httpd/conf/httpd.conf KeepAlive On DefaultType application/octet-stream AddDefaultCharset zh-CN Options FollowSymLinks 去掉Indexes 重啟服務: [root@localhost ~]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ] 編輯基於名稱的虛擬主機的配置: [root@localhost ~]# vim /etc/httpd/conf.d/wuli.conf NameVirtualHost 172.16.4.5 <VirtualHost 172.16.4.5> ServerName www.wuli.com DocumentRoot /var/www/html </VirtualHost> <VirtualHost 172.16.4.5> ServerName bbs.wuli.com DocumentRoot /var/www/html/bbs </VirtualHost> 在/var/www/html/下創建一個bbs的目錄: [root@localhost ~]#

mkdir /var/www/html/bbs 開啟資料庫的服務: [root@localhost ~]# service mysqld start 給資料庫管理員設置密碼: [root@localhost ~]# mysqladmin -u root password 123456 讓資料庫用戶登錄: [root@localhost ~]# mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or g. Your MySQL connection id is 3 to server version: 5.0.22 Type 'help;' or 'h' for help. Type 'c' to clear the buffer. mysql> show databases; -------------------- | Database | -------------------- | information_schema | | mysql | | test | -------------------- 3 rows in set (0.00 sec) 創建新的資料庫: mysql> create database bbsdb; Query OK, 1 row affected (0.00 sec) mysql> grant all on bbsdb.* to bbsuser@localhost identified by "123456"; Query OK, 0 rows affected (0.00 sec) 重啟資料庫服務: [root@localhost ~]# service mysqld restart Stopping MySQL: [ OK ] Starting MySQL: [ OK ] 將Discuz!_6.0.0_SC_GBK.zip 導入到root家目錄: [root@localhost ~]# ls anaconda-ks.cfg Discuz!_6.0.0_SC_GBK.zip install.log install.log.syslog 新建一個目錄名為d6,將Discuz剪切到裡面解壓: [root@localhost ~]# mkdir d6 [root@localhost ~]# mv Discuz!_6.0.0_SC_GBK.zip d6/ [root@localhost ~]# ls anaconda-ks.cfg d6 install.log install.log.syslog [root@localhost ~]# cd d6/ [root@localhost d6]# ls Discuz!_6.0.0_SC_GBK.zip [root@localhost d6]# unzip Discuz!_6.0.0_SC_GBK.zip [root@localhost d6]# ls Discuz!_6.0.0_SC_GBK.zip upload usersguide users_guide.htm utilities 然後將upload里的所有內容拷貝到/var/www/html/bbs/ [root@localhost d6]#

cp -r ./upload/* /var/www/html/bbs/ 現在寫一個首頁,測試一下: [root@localhost d6]# vim /var/www/html/index.php <?php phpinfo(); ?> 重啟httpd 的服務: [root@localhost d6]# service httpd restart Stopping httpd: [ OK ] Starting httpd: [ OK ]

使用客戶端瀏覽器測試:

點擊下一步后,進入此地改許可權: [root@localhost bbs]# pwd /var/www/html/bbs

[root@localhostbbs]#chmod777 ./templates ./attachments ./customavatars ./forumdata ./forumdata/templates ./forumdata/cache ./forumdata/threadcaches./forumdata/logs

填寫資料庫的信息: [root@localhost bbs]# vim ./config.inc.php $dbhost = 'localhost'; $dbuser = 'bbsuser'; $dbpw = '123456'; $dbname = 'bbsdb'; $pconnect = 0; 重啟服務: [root@localhost bbs]# service mysqld restart Stopping MySQL: [ OK ] Starting MySQL: [ OK ]

就此,實驗已經全部安裝完成,一個新的論壇搭建好了.

本文出自 「技術交流」 博客,請務必保留此出處http://wuli03960405.blog.51cto.com/1470785/486291


[火星人 ] 使用lamp搭建Discuz論壇已經有377次圍觀

http://coctec.com/docs/linux/show-post-49326.html