||
最新更新:http://www.linuxea.com/1528.html Centos7部署LNMP+Discuz_X3.2_SC_UTF8更新内容: 采用更新更稳定的nmp,更加详细的步骤!||
搭建论坛1,授权库和数据库 2,授权用户数据库授权创建表
mysql> create database bbs;
授权
mysql> GRANT ALL ON bbs.* to 'bbs'@'10.0.0.53' IDENTIFIED BY 'password.com';
也可以最小化授权可以创建删除修改查看:
GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON bbs.* to 'bbs'@'10.0.0.53' IDENTIFIED BY 'password.com';
删除安装完的权限:
DROP user 'bbs'@'10.0.0.53';
重新授权,不给创建表权限 : GRANT SELECT,INSERT,UPDATE,DELETE,DROP ON bbs.* to 'bbs'@'10.0.0.53' IDENTIFIED BY 'password.com';
3,安装配置虚拟主机vhost下载安装包:
wget http://download.comsenz.com/DiscuzX/3.2/Discuz_X3.2_SC_UTF8.zip
解压:
mv Discuz_X3.2_SC_UTF8.zip /www/bbs
unzip Discuz_X3.2_SC_UTF8.zip
rm -rf readme
rm -rf utility/
mv upload/* ./
修改属性
chown -R nginx.nginx /www/bbs/
chown -R nginx.nginx config/ data/ uc_*
打开nginx vhost文件
include /etc/nginx/conf.d/blog.conf;
vhost配置文件
server {
listen 80;
server_name www.linuxea123.com;
root /www/bbs;
location / {
index index.php index.html index.htm;
}
location ~ .*.(php|php5.3)?$ {
root /www/bbs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
access_log logs/access_blog.log main;
}
图片路径,这里的图片路径是可以挂在nfs上面!/data/attachment/forum根据提示删除安装目录rm -rf install/
设置伪静态
vim /etc/nginx/conf.d/blog.conf
server {
listen 80;
server_name www.linuxea123.com;
root /www/bbs;
location / {
index index.php index.html index.htm;
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 ^([^.]*)/blog-([0-9]+)-([0-9]+).html$ $1/home.php?mod=space&uid=$2&do=blog&id=$3 last;
rewrite ^([^.]*)/(fid|tid)-([0-9]+).html$ $1/index.php?action=$2&value=$3 last;
rewrite ^([^.]*)/([a-z]+[a-z0-9_]*)-([a-z0-9_-]+).html$ $1/plugin.php?id=$2:$3 last;
if (!-e $request_filename) {
return 404;
}
}
location ~ .*.(php|php5.3)?$ {
root /www/bbs;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
access_log logs/access_blog.log main;
}