爱意满满的作品展示区。
xyjtou

不用 1 分钟,从 0 搭建自己的轻博客

  •  3
     
  •   xyjtou · Apr 24, 2019 · 8959 views
    This topic created in 2753 days ago, the information mentioned may be changed or developed.

    任意小机机都可以安装,在 Ubuntu 14/16/18 全系 和 Debian 8/9 主机上实测通过 😋

    • 专为移动 Web 设计的轻博客
    • 发布 文字、图片、小视频、文件
    • Markdown & 实时预览
    • 自带图床(相册)
    • 匿名评论 /回复评论
    • 支持 PWA ( Android 和 iOS12 )

    演示:liteBB


    打开本机 Terminal 或 SSH 连上主机,输入下面 8 行命令就完成啦!

    ubuntu@vm-ubuntu:~$ sudo -i
    root@vm-ubuntu:~# apt update
    root@vm-ubuntu:~# apt install git
    root@vm-ubuntu:~# git clone https://github.com/225119/litebb
    root@vm-ubuntu:~# cd litebb
    root@vm-ubuntu:~/litebb# apt install python3-pip
    root@vm-ubuntu:~/litebb# pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r requirements.txt
    root@vm-ubuntu:~/litebb# /usr/local/bin/gunicorn -w 4 -b 0.0.0.0:80 "app:create_app('default')"
    

    就酱,搞定!网速快的话只须 40 秒左右 😂😂😂 (非 root 用户加 sudo 执行命令)

    本地就访问 http://127.0.0.1/ 如果是云服务器或 VPS,直接访问 IP 即可打开博客啦!默认用户名 /密码:admin/admin

    Supplement 1  ·  Apr 26, 2019

    CentOS的同学们,轻博客1分钟安装教程如下,欢迎使用和反馈 -:)

    CentOS 6 一分钟安装教程:

    [root@VM_centos ~]# yum install epel-release
    [root@VM_centos ~]# yum install python34
    [root@VM_centos ~]# curl -O https://bootstrap.pypa.io/get-pip.py
    [root@VM_centos ~]# /usr/bin/python3.4 get-pip.py
    [root@VM_centos ~]# yum install git
    [root@VM_centos ~]# git clone https://github.com/litebb/litebb
    [root@VM_centos ~]# cd litebb
    [root@VM_centos litebb]# pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r requirements.txt
    [root@VM_centos litebb]# /usr/bin/gunicorn -w 4 -b 0.0.0.0:80 "app:create_app('default')"
    

    CentOS 7 一分钟安装教程:

    [root@VM_centos ~]# yum install epel-release
    [root@VM_centos ~]# yum install python36
    [root@VM_centos ~]# curl -O https://bootstrap.pypa.io/get-pip.py
    [root@VM_centos ~]# /usr/bin/python3.6 get-pip.py
    [root@VM_centos ~]# yum install git
    [root@VM_centos ~]# git clone https://github.com/litebb/litebb
    [root@VM_centos ~]# cd litebb
    [root@VM_centos litebb]# pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r requirements.txt
    [root@VM_centos litebb]# /usr/local/bin/gunicorn -w 4 -b 0.0.0.0:80 "app:create_app('default')"
    
    39 replies  •  2019-05-05 00:30:41 +08:00
    xmitman
    xmitman
    Apr 24, 2019
    1
    厉害了,看起来不错
    cznq1106
    cznq1106
    Apr 24, 2019
    2
    菜鸟看不懂,不过感觉很厉害。
    vanishcode
    vanishcode
    Apr 24, 2019
    3
    已 star,感觉挺轻量的
    xyjtou
    xyjtou
    OP
    Apr 24, 2019
    4
    @linxb
    @vanishcode

    轻量向静态博客看齐,功能向动态博客靠拢 😄

    @cznq1106

    不用折腾的,新建只须招抄就可以了 -:)
    omph
    omph
    Apr 24, 2019
    5
    要不要加个 markdown 编辑器,手机手写代码费劲啊
    goodryb
    goodryb
    Apr 24, 2019
    6
    https 如何支持的?
    Chengyaojin
    Chengyaojin
    Apr 24, 2019 via iPhone
    7
    怎么绑定域名 这个轻量级 还有可以修改吗 定制页面之类
    xyjtou
    xyjtou
    OP
    Apr 24, 2019
    8
    @omph 可以点击那个 (Markdown) 按钮,打开实时预览就可以了。移动设备上的富文本编辑器体验并不好,做那么几个加粗 /倾斜 /列表的快捷键貌似有点画蛇添足。虽然轻博客是移动优先,其实也支持 PC 的,重度文字工作者也可以无缝切换到电脑上用的。

    @goodryb 如果是 nginx+gunicorn 部署的化,用 nginx 配置 ssl 证书路径就可以了;如故只用 gunicorn 启动的化,直接在 gunicorn 中配置 ssl 证书路径就可以。

    @Chengyaojin 直接解析域名到你的主机 ip 就行,上面是在 80 端口启动的,所以可以直接访问。支持 https 的话,要添加 ssl 证书和 443 端口。当前版本可以满足大多主流的博客功能,定制页面需要二开了,这个定位是轻量化,否则就变成了另一个 wordpress 了🙂
    Chengyaojin
    Chengyaojin
    Apr 24, 2019 via iPhone
    9
    我的服务器 a 记录解析了几个网站 所以这个轻量级绑定特定的域名是 ? 初学者不太懂这些 @
    @xyjtou
    sunocean
    sunocean
    Apr 24, 2019 via iPhone
    10
    名字是 少 bb 的意思吗😂
    xyjtou
    xyjtou
    OP
    Apr 24, 2019
    11
    @Chengyaojin 轻量化是指这个轻博客的设计理念,服务器上解析同安装一个 wordpress 一样的。你的服务器已经装了几个网站,就当是多增加配置一个二级域名的网站就可以了。

    @sunocean BB 是取自 Blog/Board 的意思,对应中文是博客 /分类板块的意思😄
    adyyq
    adyyq
    Apr 24, 2019 via Android
    12
    挺简洁的
    imningfeng
    imningfeng
    Apr 24, 2019
    13
    @sunocean 小声比比
    leisunlove
    leisunlove
    Apr 24, 2019
    14
    PC 端有吗?不习惯手机上搞
    sunocean
    sunocean
    Apr 24, 2019
    15
    闲下来了,我点开网站看了下. 啥也不说了,求奥特曼种子
    xyjtou
    xyjtou
    OP
    Apr 24, 2019
    16
    @leisunlove 移动友好,同时支持直接从 PC 访问的。

    @sunocean 谢谢提醒,已经删了。

    请体验的同学别往演示 Sample 上传违规内容,要不很快会禁止体验了😭
    xyjtou
    xyjtou
    OP
    Apr 24, 2019 via Android
    18
    @JmmBite 谢谢,已重置。
    hqdmy
    hqdmy
    Apr 24, 2019
    19
    看起来不错.准备在树莓派上试试
    yelah
    yelah
    Apr 24, 2019 via iPhone
    20
    复制粘贴挺累的,来个一键吧(滑稽
    hello461380249
    hello461380249
    Apr 24, 2019
    21
    liteBB... 小声 bb ? 🤣
    xyjtou
    xyjtou
    OP
    Apr 24, 2019 via Android
    22
    @hqdmy 只依赖一个 Python3 环境,应该没问题。

    @yelah 有考虑写个一键 setup,发现省不了几下,总共就几行命令,抄抄其实更快😛

    @hello461380249 #11 楼解释过啦😀
    CallMeReznov
    CallMeReznov
    Apr 24, 2019
    23
    大佬,牛皮.
    正好看看代码学习学习.
    wmui
    wmui
    Apr 24, 2019 via Android
    24
    报个 bug,非公开文章添加标签后,标签文章数量统计不正确
    hasaki1997
    hasaki1997
    Apr 24, 2019
    25
    这个项目开源吗?
    xyjtou
    xyjtou
    OP
    Apr 24, 2019
    26
    @CallMeReznov 欢迎提建议反馈 :)

    @wmui 测试了下没有复现这个问题阿,是不是删除过了文章?(已知的情况是删除被标签过的文章,文章被删除后标签统计数量没有更新)。你可以截个图吗?发 [email protected] 这个邮箱

    @hasaki1997 是的,github 上有。
    strugglexiang
    strugglexiang
    Apr 24, 2019 via Android
    27
    关注一下,有时间搞搞
    misaka19000
    misaka19000
    Apr 24, 2019
    28
    楼主不如写个 shell 脚本然后支持远程下载该脚本,这样只要一行命令就可以安装了
    xyjtou
    xyjtou
    OP
    Apr 24, 2019
    29
    @strugglexiang 感谢,欢迎关注 ~

    @misaka19000 哈哈 下次写个 setup 😄
    ctD
    ctD
    Apr 24, 2019 via Android
    30
    插眼
    Ruan
    Ruan
    Apr 24, 2019
    31
    centos 支持吗
    xyjtou
    xyjtou
    OP
    Apr 24, 2019
    32
    @Ruan Linux 的各个发行版都是可以的。CentOS7 默认是 Python2 环境,所以要先装下 Python3 环境。启动命令 gunicorn 的路径和 Debian/Ubuntu 稍有不同,这样就可以了:
    [root@VM_centos litebb]# /usr/bin/gunicorn -w 4 -b 0.0.0.0:80 "app:create_app('default')"
    DJI360
    DJI360
    Apr 25, 2019 via Android
    33
    mark,明天看一下
    ghos
    ghos
    Apr 25, 2019 via Android
    34
    可以搞个 docker 镜像吗
    xyjtou
    xyjtou
    OP
    Apr 25, 2019 via Android
    35
    @ghos 会考虑,主要是 https 证书无法预先装进去,在考虑 nginx 要不要 build 进去。
    leisunlove
    leisunlove
    Apr 26, 2019
    36
    centos 麻烦老哥支持一下。
    xyjtou
    xyjtou
    OP
    Apr 26, 2019❤️1
    37
    @Ruan
    @leisunlove

    轻博客 1 分钟安装教程,在附言了增加了 -:)
    record
    record
    May 3, 2019 via Android
    38
    在 armbian 上未能正常搭建
    root@Sakura_DNS:~/litebb# pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple/ -r requirements.txt
    Collecting alembic==0.9.9 (from -r requirements.txt (line 1))
    Using cached https://pypi.tuna.tsinghua.edu.cn/packages/89/03/756d5b8e1c90bf283c3f435766aa3f20208d1c3887579dd8f2122e01d5f4/alembic-0.9.9.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    ImportError: No module named 'setuptools'

    ----------------------------------------
    Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-7bq_d0na/alembic/
    xyjtou
    xyjtou
    OP
    May 5, 2019 via Android❤️1
    39
    @record 这个看起来像是没有 Python3 环境。你 whereis Python 看下,是什么结果? 你可以直接在这里提交问题反馈:litebb.com/s/O85MKR
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1547 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 65ms · UTC 00:27 · PVG 08:27 · LAX 16:27 · JFK 19:27
    ♥ Do have faith in what you're doing.