Httpd服务进阶知识-基于Apache Modele的LAMP架构之Discuz!论坛案例
作者:尹正杰
版权声明:原创作品,谢绝转载!否则将追究法律责任。
一.安装依赖包及数据库
博主推荐阅读: https://www.cnblogs.com/yinzhengjie/p/12019502.html
二.部署Discuz!论坛程序
1>.下载Discuz!相关软件包
官网地址: https://www.discuz.net/forum.php
2>.解压缩WordPress博客程序到网页站点目录下并授权
[root@node101.yinzhengjie.org.cn ~]# unzip Discuz_X3.3_SC_UTF8.zip [root@node101.yinzhengjie.org.cn ~]# [root@node101.yinzhengjie.org.cn ~]# ll total 26592 -rw-r--r-- 1 root root 10922155 Dec 11 09:50 Discuz_X3.3_SC_UTF8.zip -rw-r--r-- 1 root root 4323896 Dec 11 09:51 phpMyAdmin-4.0.10.20-all-languages.tar.xz drwxr-xr-x 2 root root 4096 Jul 27 2017 readme drwxr-xr-x 12 root root 4096 Jul 27 2017 upload drwxr-xr-x 4 root root 4096 Jul 27 2017 utility -rw-r--r-- 1 root root 11966441 Dec 11 09:51 wordpress-5.0-zh_CN.zip [root@node101.yinzhengjie.org.cn ~]# [root@node101.yinzhengjie.org.cn ~]# mv readme upload utility /var/www/html/ [root@node101.yinzhengjie.org.cn ~]# [root@node101.yinzhengjie.org.cn ~]# ll total 26580 -rw-r--r-- 1 root root 10922155 Dec 11 09:50 Discuz_X3.3_SC_UTF8.zip -rw-r--r-- 1 root root 4323896 Dec 11 09:51 phpMyAdmin-4.0.10.20-all-languages.tar.xz -rw-r--r-- 1 root root 11966441 Dec 11 09:51 wordpress-5.0-zh_CN.zip [root@node101.yinzhengjie.org.cn ~]#
3>.对目录进行授权
[root@node101.yinzhengjie.org.cn ~]# cd /var/www/html/ [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# ll total 20 drwxr-xr-x 9 root root 4096 Dec 11 15:58 phpMyAdmin drwxr-xr-x 2 root root 4096 Jul 27 2017 readme drwxr-xr-x 12 root root 4096 Jul 27 2017 upload drwxr-xr-x 4 root root 4096 Jul 27 2017 utility drwxr-xr-x 5 root root 4096 Dec 11 17:32 wordpress [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# setfacl -R -m u:apache:rwx upload/ [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# ll total 20 drwxr-xr-x 9 root root 4096 Dec 11 15:58 phpMyAdmin drwxr-xr-x 2 root root 4096 Jul 27 2017 readme drwxrwxr-x+ 12 root root 4096 Jul 27 2017 upload drwxr-xr-x 4 root root 4096 Jul 27 2017 utility drwxr-xr-x 5 root root 4096 Dec 11 17:32 wordpress [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# getfacl upload # file: upload # owner: root # group: root user::rwx user:apache:rwx group::r-x mask::rwx other::r-x [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]#
4>.访问Discuz!论坛程序的webUI进入安装向导
5>.如下图所示,如果是一路绿灯说明你之前的配置是正常的,如果用红色信息说明文件不可写,验证是否授权
6>.下拉进度条,点击"下一步"
7>.选择全新安装并点击下一步
8>.如下图所示,填写数据库相关信息,点击"下一步"会有建库和表的语句自动生成的
9>.Discuz!安装成功
如下图所示,当Discuz!论坛搭建成功后,会自动生成数据库和表。
10>.再次访问论坛首页
11>.管理界面登录成功
12>.安装完毕后需要清除Discuz!的权限
[root@node101.yinzhengjie.org.cn /var/www/html]# getfacl upload # file: upload # owner: root # group: root user::rwx user:apache:rwx group::r-x mask::rwx other::r-x [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# setfacl -R -x u:apache upload/ #递归只清楚apache用户的ACL权限 [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# getfacl upload # file: upload # owner: root # group: root user::rwx group::r-x mask::r-x other::r-x [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# ll total 20 drwxr-xr-x 9 root root 4096 Dec 11 15:58 phpMyAdmin drwxr-xr-x 2 root root 4096 Jul 27 2017 readme drwxr-xr-x+ 12 root root 4096 Jul 27 2017 upload drwxr-xr-x 4 root root 4096 Jul 27 2017 utility drwxr-xr-x 5 root root 4096 Dec 11 17:32 wordpress [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# setfacl -R -b upload/ #递归清除所有ACL权限 [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]# ll total 20 drwxr-xr-x 9 root root 4096 Dec 11 15:58 phpMyAdmin drwxr-xr-x 2 root root 4096 Jul 27 2017 readme drwxr-xr-x 12 root root 4096 Jul 27 2017 upload drwxr-xr-x 4 root root 4096 Jul 27 2017 utility drwxr-xr-x 5 root root 4096 Dec 11 17:32 wordpress [root@node101.yinzhengjie.org.cn /var/www/html]# [root@node101.yinzhengjie.org.cn /var/www/html]#