注:本站是php版本youbbs+二次开发
下面就来分享下goyoubbs在宝塔面板上安装的方法:
1、使用宝塔面板新建网站和ftp,数据库不需要了
2、可以使用终端下载解压或者ftp上传 goyoubbs-linux-amd64.zip 和 site.zip后解压
下载地址:https://github.com/ego008/goyoubbs/releases
wget https://github.com/ego008/goyoubbs/releases/download/current/goyoubbs-linux-amd64.zip
wget https://github.com/ego008/goyoubbs/releases/download/current/site.zip
unzip goyoubbs-linux-amd64.zip
unzip site.zip
./goyoubbs
3、运行安装命令
./goyoubbs
出现下面提示说明安装成功:
2017/12/06 16:24:42 MainDomain: http://127.0.0.1:8082
2017/12/06 16:24:42 youdb Connect to mydata.db
2017/12/06 16:24:42 Web server Listen to http://127.0.0.1:8082
4、在宝塔面板的配置文件中添加如下
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8082;
}
5、屏蔽配置文件中的如下代码,前面加#就行了:
include enable-php-54.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
error_log off;
access_log off;
}
改成:
#include enable-php-54.conf;
#location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
#{
# expires 30d;
# error_log off;
# access_log off;
#}
6、正常使用宝塔面板的ssl工具开启ssl证书。
7、结束。
附:youBBS生产环境部署:nginx 配置示例:
server {
listen 80;
server_name yourdomain.com;
charset utf-8;
access_log /logs/youbbs/access.log;
error_log /logs/youbbs/error.log;
client_max_body_size 100M;
client_body_buffer_size 100M;
location / {
proxy_pass_header Server;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8082;
}
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}