BookStack icon indicating copy to clipboard operation
BookStack copied to clipboard

CentOS7安装全程笔记

Open ldbinac opened this issue 5 years ago • 0 comments

看到很多人说需要centos下的安装教程,把自己结合作者的Ubuntu下的安装过程,总结摸索出来的CentOS7下安装记录比较分享出来给大家,希望作者可以抽空补充到目前的安装文档当中:

新建用户Wiki

1、建用户: adduser wiki //新建用户 passwd 123456wiki //给wiki用户设置密码 2、将用户加入root组 命令格式gpasswd -a username groupname gpasswd -a wiki root 3、切换到wiki用户 su wiki

安装Chrome

yum install chromium

执行以下命令,如果能打印百度页面代码,则表示安装成功。

chromium-browser --headless --disable-gpu --dump-dom --no-sandbox https://www.baidu.com

这个主要用于在发布文档的时候,渲染未被渲染的markdown文档,以及强力模式下的网页采集。

安装python2

yum install python2

安装calibre

  • 安装命令:
sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python2 -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
  • 执行下面命令,能看到版本号,表示安装成功。

ebook-convert --version

  • 测试 随便创建一个txt文件

echo "Hello BookStack。你好,书栈。" > test.txt 转成pdf

ebook-convert test.txt test.pdf 查看测试的转化效果,主要看下转化的过程中有没有报错,以及转化后的文档有没有出现中文乱码。

[root@CentOS8x64 bookstack]# ebook-convert test.txt test.pdf
1% Converting input to HTML...
InputFormatPlugin: TXT Input running
on /data/bookstack/test.txt
Language not specified
Creator not specified
Building file list...
Normalizing filename cases
Rewriting HTML links
flow is too short, not running heuristics
Forcing index.html into XHTML namespace
34% Running transforms on e-book...
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 0 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Cleaning up manifest...
Trimming unused files from manifest...
Creating PDF Output...
67% Running PDF Output plugin
68% Parsed all content for markup transformation
70% Completed markup transformation
[31429:31429:0320/093137.564571:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.

转换测试报错了。。。。。

切换为wiki用户再次测试,即可正常输入pdf文档,打开之后中文也是正常的。

安装puppeteer

生成自定义的书籍封面以及内容采集时需要用到,可全局安装,也可在程序根目录下安装。我们这里使用全局安装的方式。

669  npm install -g n
670  n stable
671  npm install -g cnpm
672  cnpm install -g puppeteer

安装supervisor

  • 安装命令: yum install supervisor

  • 判断是否安装成功: supervisord --version 显示版本号,即表示安装成功。

安装Git

使用 git clone 的方式导入项目的时候需要使用git

yum install git 验证安装情况 git version

安装部署

下载程序

v2.6版本

修改配置

app.conf

上传

  • 压缩
  • 上传到服务器
  • 解压

执行安装命令

  • 进入解压后的目录
  • 执行安装 ./BookStack install

执行运行命令

./BookStack

登录查看

admin admin888

ldbinac avatar Mar 23 '20 04:03 ldbinac