天问

使用discuzX搭建论坛

twtccw discuzx论坛

1. bbs的安装

「This part is written by ZhuShifu」

参考:http://www.discuz.net/thread-3258186-1-1.html

一、[参照 http://wuli03960405.blog.51cto.com/1470785/486291/,创建数据库]()

root@localhost ~]# mysql -u root -p
Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.40-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> create database bbsdb;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all on bbsdb.* to bbsuser@localhost identified by "123456";#此处123456为你所设置的bbsuser的密码
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> quit
Bye

二、下载Discuz代码,解压,把文件夹upload内的文件拷贝到www的root目录(或某子目录) 三、在浏览器中输入IP地址,开始安装,选择新建,到下一步会出现权限问题, 获得需要设置权限的个目录和文件的列表,存为chmod.list 然后运行

for f in $(cat chmod.list)
do
{ [ -f "$f" ] && chmod 766 "$f" ; } || { [ -d "$f" ] && chmod 777 "$f" ; }
done

四、解决SELinux的问题 网络上得教程几乎都是通过 setenforce 0 临时关闭SELinux发挥作用来跳过这一步骤,但这是一个需要面对和解决的问题。

参考: http://www.serverlab.ca/tutorials/linux/administration-linux/troubleshooting-selinux-centos-red-hat/ http://www.ahlinux.com/apache/1334.html

甚至:http://wiki.centos.org/zh/HowTos/SELinux

yum install setroubleshoot setools
sealert -a /var/log/audit/audit.log > trouble.log
在trouble.log总寻找解决方法:
semanage fcontext -a -t httpd_sys_rw_content_t /opt/www
restorecon -v /opt/www
setsebool -P httpd_unified 1
grep httpd /var/log/audit/audit.log | audit2allow -M mypol
semodule -i mypol.pp
接下来还有一些步骤是更改Discuz源代码的安全上下文:
semanage fcontext -a -t httpd_sys_content_t '/opt/www(/.*)?'
restorecon -Rv /opt/www

五、完成安装 删除install/index.php 六、进一步修改权限.

2. bbs的重装


参考:http://zhidao.baidu.com/question/309236972.html/ 1. 下载一个新的安装包,找到upload目录,解压出install文件夹。 2. 删除原站点FTP的data/install.lock文件,把install文件夹上传到论坛的根目录, 访问站点的install即(addressofyoursite/install)可开始安装。 3. 安装到设置数据库这里时注意不要使用原数据库名,随便换个名字,我这里用的bbsdb_new 4. 修改config/config_global.php,将bbsdb_new改为原来的数据库bbsdb,同样修改uc_server/data/config.inc.php的UC_DBNAME常量为bbsdb. 将里面的bbsdb_new全部替换位bbsdb

服务器开机后出现database error, 有时候这种情况是mariadb没有正确启动所导致,重启系统可解决, 与网上的问题所不同的是,使用数据库启动命令并不能正确启动数据库

twtccw
现已装备物理学圣剑