阿里云上面安装Discuz论坛
简单总结一下流程:
(1)首先yum安装php,mysql,nginx.
(2)设置nginx的配置文件
vim /etc/nginx/nginx.conf
root /var/www/html;(我居然写成了/www/var/html,后面出错了排查半天,小错误费时间啊)
转发Php时,include下面这两行一定不要注释掉,否则php请求无法处理。
include /etc/nginx/conf.d/.conf;
include /etc/nginx/default.d/.conf;
location ~ .php$ {
root /var/www/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME fastcgi_script_name;
}
还有,使用阿里云搭建nginx服务器的时候,在根目录下面创建index.html,里面内容:hello,welcome you to visit Discuz!
阿里云的命令行上面使用curl +网站IP可以看到内容,在浏览器上面就不行。
原因:阿里云默认关闭了80和443
要在服务器网络安全:安全组规则里放行这两个端口!
最后,数据库mysql上面新建Discuz用户,给与创建数据库和其它权限。
grant all privileges on . to ‘Discuz’@’%’ with grant option;
最后:浏览器访问网站名/install就可以安装了