专注收集记录技术开发学习笔记、技术难点、解决方案
网站信息搜索 >> 请输入关键词:
您当前的位置: 首页 > youbbs

goyoubbs在宝塔面板上安装的方法

发布时间: 文章来源:www.iduyao.cn 采编人员:毒药  
昨晚睡不着就试着折腾很早就想折腾的事情 - youbbs(开源项目),是好些年未见的老友 恐龙爵爷/ego008 使用golang+bolt 重新编写的轻论坛程序。早年php版本只维护不增加新功能。
注:本站是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;
    }

}
友情提示:
信息收集于互联网,如果您发现错误或造成侵权,请及时通知本站更正或删除,具体联系方式见页面底部联系我们,谢谢。
   1818阅读

goyoubbs在根目录无法访问文件如一些txt验证文件和html静态文件
配置方法:
https://iduyao.cn/topics/316

毒药   2020-01-07 12:01:54
1
登录 后发表评论