Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

宝塔面板下的安装教程:目前有个问题,新安装进入后台点击标签管理会白屏,请问这个怎么解决 #642

Open
lopins opened this issue Aug 15, 2019 · 9 comments

Comments

@lopins
Copy link

lopins commented Aug 15, 2019

  1. 在宝塔上创建一个站点,填写解析好的域名。

  2. 网站目录 -> 运行目录 选择 /www

  3. 默认文档第一行设置为 index.js

  4. 申请并配置好 SSL证书 ,勾选 强制HTTPS

  5. PHP版本 选择 纯静态 并点击切换保存 。

  6. Nginx配置(相关地方修改成你的信息即可)

server
{
    listen 80;
	listen 443 ssl http2;
    server_name docnn.cn *.docnn.cn;
	index index.js index.php index.html index.htm default.php default.htm default.html;
    root /www/wwwroot/person/www; #此处配置firekylin博客程序根目录下的www子目录
    set $node_port 8360; #此处配置firekylin博客监听端口,默认为8360
    
    #SSL-START SSL相关配置,请勿删除或修改下一行带注释的404规则
    #error_page 404/404.html;
    limit_conn perserver 300;
    limit_conn perip 25;
    limit_rate 512k;
    #HTTP_TO_HTTPS_START
    if ($server_port !~ 443){
        rewrite ^(/.*)$ https://$host$1 permanent;
    }
    #HTTP_TO_HTTPS_END
    ssl_certificate    /www/server/panel/vhost/cert/docnn.cn/fullchain.pem;
    ssl_certificate_key    /www/server/panel/vhost/cert/docnn.cn/privkey.pem;
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
    ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
    ssl_prefer_server_ciphers on;
    ssl_session_cache shared:SSL:10m;
    ssl_session_timeout 10m;
    error_page 497  https://$host$request_uri;

    #SSL-END
    
    #ERROR-PAGE-START  错误页配置,可以注释、删除或修改
    #error_page 404 /404.html;
    #error_page 502 /502.html;
    #ERROR-PAGE-END
    
    #PHP-INFO-START  PHP引用配置,可以注释或修改
    include enable-php-00.conf;
    #PHP-INFO-END
    
    #REWRITE-START URL重写规则引用,修改后将导致面板设置的伪静态规则失效
    include /www/server/panel/vhost/rewrite/docnn.cn.conf;
    #REWRITE-END
    
    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }
    
    #一键申请SSL证书验证目录相关设置
    location ~ \.well-known{
        allow all;
    }
    
    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        error_log off;
        access_log /dev/null;
    }
    
    location ~ .*\.(js|css)?$
    {
        expires      12h;
        error_log off;
        access_log /dev/null; 
    }
    
    #Firekylin配置
    location / {
        proxy_http_version 1.1;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_set_header X-NginX-Proxy true;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_pass http://127.0.0.1:$node_port$request_uri;
        proxy_redirect off;
    }

    location = /development.js {
        deny all;
    }
    location = /testing.js {
        deny all;
    }

    location = /production.js {
        deny all;
    }

    location ~ /static/ {
        etag         on;
        expires      max;
    }
    
    #access_log  /www/wwwlogs/docnn.cn.log;
    #error_log  /www/wwwlogs/docnn.cn.error.log;
}
  1. 上传firekylin博客安装包到第一步创建的目录下 。

  2. 解压缩安装包,并将 firekylin 目录下的所有文件全选移动到根目录下,删除 firekylin 目录和安装包文件。

  3. 在程序目录中执行 npm install 安装对应的依赖。

注意:

执行之前请确认已有 Node.js 8.9.4+ 环境。如果国内 npm install

太慢可选择添加淘宝源代理 npm install --registry=https://registry.npm.taobao.org

  1. 配置 PM2

将项目下的 pm2_default.json 文件重命名为 pm2.json

修改文件中的 cwd 配置值为项目的当前路径。如我的 "cwd": "/www/wwwroot/person",

{
  "apps": [{
    "name": "firekylin",
    "script": "production.js",
    "cwd": "/www/wwwroot/person",
    "exec_mode": "fork",
    "max_memory_restart": "1G",
    "autorestart": true,
    "node_args": [],
    "args": [],
    "env": {
      
    }
  }]
}

然后通过 pm2 startOrReload pm2.json来启动项目。

注意:

在服务器上推荐使用 PM2 来管理 Node.js 服务,

可以通过 sudo npm install -g pm2 来安装 PM2

当然 Firekylin 也支持使用其它的进程守护工具。

  1. 访问你的博客地址填写配置信息

    • 使用浏览器直接访问你的博客地址即可看到 Firekylin 的安装程序。

    • 填入你的 MySQL 信息并设置好管理员账号后点击完成。

    • 提示安装成功后会重新进入博客首页,访问 www.docnn.cn/admin 即可跳转到后台。

@lopins
Copy link
Author

lopins commented Aug 15, 2019

目前有个问题,新安装进入后台点击标签管理会白屏,请问这个怎么解决

@lopins lopins changed the title 宝塔面板下的安装教程 宝塔面板下的安装教程:目前有个问题,新安装进入后台点击标签管理会白屏,请问这个怎么解决 Aug 15, 2019
@lizheming
Copy link
Collaborator

@lopins 可能是个 BUG,我们之后看一下。

@lopins
Copy link
Author

lopins commented Aug 15, 2019

好的,谢谢

@lopins
Copy link
Author

lopins commented Aug 15, 2019

代码块的解析好像不是很友好
TIM截图20190815114725
TIM截图20190815115157
TIM截图20190815115245

@lizheming
Copy link
Collaborator

@lopins 代码高亮的这个提供个线上环境我们去看一下吧。

@lopins
Copy link
Author

lopins commented Aug 16, 2019

Markdown文档

链接:https://pan.baidu.com/s/199FhuqEe6oxt9grYgXoMrg
提取码:k5y4

@lizheming
Copy link
Collaborator

@lopins 我在本地试了下应该是 OK 的,这块用了很久没出过这种问题啊[苦笑不得],如果还有问题你提供个线上环境我过去看下吧

image

@lopins
Copy link
Author

lopins commented Aug 16, 2019

@lizheming 好的,我再多试几遍吧,当时我这边测试确实是有问题的,谢谢您

@lxjcxj
Copy link

lxjcxj commented Apr 20, 2020

@lopins 这是文件加载顺序的问题

修改/view/admin/index_index.html最后一行插入<script src="/static/js/vendor.js?v=25fd8"></script>

修改后为</script><script src="/static/js/admin.js?v=8e2d6"></script><script src="/static/js/vendor.js?v=25fd8"></script><script src="/static/js/vendor.js?v=25fd8"></script>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants