一.论坛简介
论坛又名网络论坛BBS,全称为Bulletin Board System(电子公告板)或者Bulletin Board Service(公告板服务)。是Internet上的一种电子信息服务系统。它提供一块公共电子白板,每个用户都可以在上面书写,可发布信息或提出看法。它是一种交互性强,内容丰富而及时的Internet电子信息服务系统。用户在BBS站点上可以获得各种信息服务,发布信息,进行讨论,聊天等等。
二.架构phpwind论坛实例
简介:搭建基于主机头的phpwind论坛
1.修改apache服务上的基本配置
①.调整语言
[root@donghao244 apache]# vim /etc/httpd/httpd.conf //编辑apache的主配置文件
381 Include /etc/httpd/extra/httpd-languages.conf //启用语言配置文件
[root@donghao244 apache]# vim /etc/httpd/extra/httpd-languages.conf //编辑语言配置文件
LanguagePriority zh-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-TW
//将中文(zh-CN )调整为apache的默认语言
②.创建基于主机头的虚拟主机的配置
[root@donghao244 apache]# vim /etc/httpd/httpd.conf //修改apache的主配置文件
390 Include /etc/httpd/extra/httpd-vhosts.conf //开启虚拟主机模块
[root@donghao244 apache]#vim /etc/httpd/extra/httpd-vhosts.conf
19 NameVirtualHost 192.168.10.244:80 // 开启虚拟主机
27
28 ServerAdmin [email protected] //管理员的账号
29 DocumentRoot /usr/local/apache/phpwind //虚拟主机的目录
30 ServerName bbs.cj.com //虚拟主机的主机名
31 ServerAlias phpwind.cj.com //虚拟主机的别名
32 ErrorLog "logs/phpwind.cj.com-error_log"//错误日志记录文件
33 CustomLog "logs/phpwind.cj.com-access_log" common //成功访问日志记录文件
34
③.在apache的配置文件中添加站点主目录的规则
[root@donghao244 apache]# vim /etc/httpd/httpd.conf //修改apache的主配置文件
161
162 Options Indexes FollowSymLinks
163 AllowOverride None
164 Order allow,deny
165 Allow from all
166
2.修改apache中一些文件及目录的权限
[root@donghao244 phpwind]# cd /usr/local/apache/phpwind/
[root@donghao244 phpwind]# chmod -R 777 p_w_upload //修改目录的权限
[root@donghao244 phpwind]# chmod -R 777 html //修改目录的权限
[root@donghao244 phpwind]# chmod -R 777 data //修改目录的权限
3.创建数据库
[root@donghao244 phpwind]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 5
Server version: 5.5.15-log MySQL Community Server (GPL)
Copyright (c) 2000, 2010, 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.18 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| phpwind |
| test |
+--------------------+
5 rows in set (0.22 sec)
mysql> use phpwind;
Database changed
mysql> show tables;
Empty set (0.01 sec)
mysql> \q
Bye
4.进行安装phpwind论坛
开始安装
创建账号为“admin”密码为“admin”的管理账户
下一步:
安装完成!!!
5.清除安装过程后的无用文件
[root@donghao244 phpwind]# rm install.php
rm: remove regular file `install.php'? y
//此时的bbs论坛就可以测试访问了!!!
三.搭建wordpress论坛实例
1.修改apache服务上的基本配置
①.调整语言
[root@donghao244 apache]# vim /etc/httpd/httpd.conf //编辑apache的主配置文件
381 Include /etc/httpd/extra/httpd-languages.conf //启用语言配置文件
[root@donghao244 apache]# vim /etc/httpd/extra/httpd-languages.conf //编辑语言配置文件
LanguagePriority zh-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-TW
//将中文(zh-CN )调整为apache的默认语言
②.创建基于主机头的虚拟主机的配置
[root@donghao244 apache]# vim /etc/httpd/httpd.conf //修改apache的主配置文件
390 Include /etc/httpd/extra/httpd-vhosts.conf //开启虚拟主机模块
[root@donghao244 apache]#vim /etc/httpd/extra/httpd-vhosts.conf
19 NameVirtualHost 192.168.10.244:80 // 开启虚拟主机
36
37 ServerAdmin [email protected] //管理员邮箱
38 DocumentRoot "/usr/local/apache/wordpress" //主站点的目录
39 ServerName wp.cj.com //完整的主机名
40 ErrorLog "logs/wp.cj.com-error_log" //错误日志存放的位置
41 CustomLog "logs/wp.cj.com-access_log" common //访问成功地记录文件
42
③.在apache的配置文件中添加站点主目录的规则
[root@donghao244 apache]# vim /etc/httpd/httpd.conf //修改apache的主配置文件
161
162 Options Indexes FollowSymLinks
163 AllowOverride None
164 Order allow,deny
165 Allow from all //允许所有人访问该目录
166
④.创建apache的账号并修改为不可登录。并对某些文件进行权限的修改。
[root@donghao244 wordpress]# useradd apache -u 102 //创建不可登录的apache账号
[root@donghao244 wordpress]# cp wp-config-sample-.php wp-config.php //创建配置文件
[root@donghao244 wordpress]# chown apache.apache wp-config.php //修改配置文件的所属组及用户
[root@donghao244 wordpress]# chmod –R o+w wp-content //修改目录权限
[root@donghao244 wordpress]# vim /etc/httpd/httpd.conf //将apache的执行用户及组修改为apache
66 User apache
67 Group apache
⑤.创建数据库
[root@donghao244 wordpress]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 28
Server version: 5.5.15-log MySQL Community Server (GPL)
Copyright (c) 2000, 2010, 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.17 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| phpwind |
| test |
| wordpress |
+--------------------+
6 rows in set (0.16 sec)
mysql> \q
Bye
⑥.修改配置文件中的信息
[root@donghao244 wordpress]# vim wp-config.php //修改配置文件
19 define('DB_NAME', 'wordpress'); //指定数据库的名字
22 define('DB_USER', 'root'); //指定数据库的用户
25 define('DB_PASSWORD', '123'); //指定用户的密码
2.安装论坛
输入账号密码
登录
进行登录
至此一个可以访问的论坛机已经可以访问了!!!
3.为论坛更换主题
通过浏览器上传主题的zip格式的压缩包
移动主题文件并解压到指定目录“/usr/local/apache/wordpress/wp-content/themes/”目录下
[root@donghao244 uploads]# cp Stratex.zip ../themes/ //移动主题文件
[root@donghao244 uploads]# cd ../themes/ //解压缩包
这时重新刷新一次就好了!!!再进行启用
保存更改
结果如图所示:
三.discuz论坛的搭建
1.修改apache服务上的基本配置
①.调整语言
[root@donghao244 apache]# vim /etc/httpd/httpd.conf //编辑apache的主配置文件
381 Include /etc/httpd/extra/httpd-languages.conf //启用语言配置文件
[root@donghao244 apache]# vim /etc/httpd/extra/httpd-languages.conf //编辑语言配置文件
LanguagePriority zh-CN en ca cs da de el eo es et fr he hr it ja ko ltz nl nn no pl pt pt-BR ru sv tr zh-TW
//将中文(zh-CN )调整为apache的默认语言
②.创建基于主机头的虚拟主机的配置
[root@donghao244 apache]# vim /etc/httpd/httpd.conf //修改apache的主配置文件
390 Include /etc/httpd/extra/httpd-vhosts.conf //开启虚拟主机模块
[root@donghao244 apache]#vim /etc/httpd/extra/httpd-vhosts.conf
19 NameVirtualHost 192.168.10.244:80 // 开启虚拟主机
36
37 ServerAdmin [email protected] //管理员邮箱
38 DocumentRoot "/usr/local/apache/wordpress" //站点的主目录
39 ServerName wp.cj.com //站点的主机名
40 ErrorLog "logs/wp.cj.com-error_log" //访问错误日志记录文件
41 CustomLog "logs/wp.cj.com-access_log" common //成功访问的记录文件
42
③.在apache的配置文件中添加站点主目录的规则
167
168 Options Indexes FollowSymLinks
169 AllowOverride None
170 Order allow,deny
171 Allow from all //允许所有
172
④.创建mysql 数据库
[root@donghao244 discuz]# /usr/local/mysql/bin/mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 43
Server version: 5.5.15-log MySQL Community Server (GPL)
Copyright (c) 2000, 2010, 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 discuz;
Query OK, 1 row affected (0.01 sec)
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| discuz |
| mysql |
| performance_schema |
| phpwind |
| test |
| wordpress |
+--------------------+
7 rows in set (0.09 sec)
mysql> \q
Bye
⑤.进行discuz论坛的安装
依据提示进行文件及目录的权限修改
[root@donghao244 discuz]# chmod –R o+w config //修改权限
[root@donghao244 discuz]# chmod -R o+w uc_client/data/cache
[root@donghao244 discuz]# chmod -R o+w uc_client/data/cache
[root@donghao244 discuz]# chmod -R o+w uc_server/data/
点击下一步
下一步即可安装成功,最后!!!
最后简单的论坛搭建已经成功!!!
嗯,韩宇说的对!!!