论坛搭建
安装PHP等等准备环境
修改apache httpd.conf: sudo vi /opt/httpd-2.4.2-server/conf/httpd.conf ,在 AddType application/x-gzip .gz .tgz 下面添加以下两行:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
(f) 验证php
在 /opt/httpd-2.4.2-server/htdocs/ 目录下,新建一个文件 index.php: sudo vi /opt/httpd-2.4.2-server/htdocs/index.php
在浏览器中,输入网址: http://localhost/index.php,打开以下页面,说明配置php成功。
2,准备好软件包
3, Discuz 环境配置
(a) 解压zip文件: unzip Discuz_X3.0_SC_UTF8.zip -d Discuz_X3.0_SC_UTF8
(b) 拷贝Discuz到apache httdp目录: sudo cp -r Discuz_X3.0_SC_UTF8 /opt/httpd-2.4.2-server/htdocs/
(c) 进入/opt/httpd-2.4.2-server/htdocs/Discuz_X3.0_SC_UTF8/upload/ 目录,设置子目录权限: sudo chmod -R 777 config/ data/ uc_client/ uc_server/
(d) 配置Discuz 默认文件: sudo vi /opt/httpd-2.4.2-server/conf/httpd.conf
<IfModule dir_module>
DirectoryIndex index.php default.php index.html index.htm
</IfModule>
(e) 配置Discuz 虚拟目录: sudo vi /opt/httpd-2.4.2-server/conf/httpd.conf
查找: DocumentRoot "/opt/httpd-2.4.2-server//htdocs"
添加如下两行:
Alias /forum "/opt/httpd-2.4.2-server//htdocs//Discuz_X3.0_SC_UTF8//upload" // 添加一行,虚拟目录
<Directory "/opt/httpd-2.4.2-server//htdocs//Discuz_X3.0_SC_UTF8//upload"> // 指向discuz目录
如下图(目录名有改动,请根据自己目录修改):
4, Discuz 安装
(a) 按照步骤3,配置好Discuz环境变量后,在浏览器输入网址: http://localhost/Discuz_X3.0_SC_UTF8/upload/install/index.php,出现如下安装页面:
(b) 点击“同意”,继续
(c) 点击“下一步”,继续(如果没有权限,请参见上面步骤3 —— (c))
(d) 点击“下一步”,继续
(e) 点击“下一步”,在浏览器输入网址: http://localhost/forum/admin.php,出现如下页面, 说明安装成功!
登陆后,进入”管理中心首页“——》”首页“,会提示删除安装目录(网页):
这是为了防止再次安装,因此一般只需把”install“目录,修改为”install_bk"或其他名字即可,我喜欢改成"install_bk",修改命令: sudo mv install install_bk
后台数据库访问方式: mysql -uroot -pabcd1234
后台数据库为 ithomer:
5, Discuz 功能
Dizcuz 具有非常丰富的功能,如用户注册, 论坛主题设置,页面访问权限设置,发起投票(需装插件)等功能,下面是默认论坛页面