安装discuz

ZephyrXT 发布于 阅读:21

cd /root

./vhost.sh

输入预绑定域名

cd /home/wwwroot/域名

wget http://download.comsenz.com/DiscuzX/1.5/Discuz_X1.5_SC_UTF8.zip

unzip Discuz_X1.5_SC_UTF8.zip

cp -a upload/*  /home/wwwroot/域名

rm -rf utility readme upload

chown -R www /home/wwwroot/域名

进入域名:安装

下载/usr/local/nginx/conf/vhost/域名.conf

添加伪静态规则

上传覆盖 运行 /usr/local/nginx/sbin/nginx -t  检测配置

成功后 运行 /usr/local/nginx/sbin/nginx -s reload 重载配置即可

——————如果安装在子目录——————

解决Nginx访问域名或目录链接后无/(反斜杠)无法访问

相应的server中增加一条rewrite规则,判断当访问的是服务器的目录时,则自动在链接后面增加 /(反斜杠) ,请

  if (-d $request_filename ){ rewrite ^/(.*)([^/])$ http://$host/$1$2/ permanent; }

—————— 子目录的伪静态——————

例如安装在/bbs/下

如此设置:location /bbs/ {
          rewrite ^([^\.]*)/topic-(.+)\.html$ $1/portal.php?mod=topic&topic=$2 last;
rewrite ^([^\.]*)/article-([0-9]+)-([0-9]+)\.html$ $1/portal.php?mod=view&aid=$2&page=$3 last;
rewrite ^([^\.]*)/forum-(\w+)-([0-9]+)\.html$ $1/forum.php?mod=forumdisplay&fid=$2&page=$3 last;
rewrite ^([^\.]*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=viewthread&tid=$2&extra=page%3D$4&page=$3 last;
rewrite ^([^\.]*)/group-([0-9]+)-([0-9]+)\.html$ $1/forum.php?mod=group&fid=$2&page=$3 last;
rewrite ^([^\.]*)/space-(username|uid)-(.+)\.html$ $1/home.php?mod=space&$2=$3 last;
rewrite ^([^\.]*)/([a-z]+)-(.+)\.html$ $1/$2.php?rewrite=$3 last;
if (!-e $request_filename) {
 return 404;
}

上传覆盖 运行 /usr/local/nginx/sbin/nginx -t  检测配置

成功后 运行 /usr/local/nginx/sbin/nginx -s reload 重载配置即可

参考:

https://bbs.zephyrxt.com/thread-3608-1-1.html

https://bbs.zephyrxt.com/thread-3609-1-1.html

建站 VPS