搭建环境
- centos7
- showdoc
- nginx
showdoc亮点介绍
- 支持markdown语法
- 支持全局搜索
- 支持多级目录创建
- 支持单页分享
- 支持快捷键Ctrl + s 快速保存
- 多人协调工作,用户编辑页面的时候将自动锁定。
- 支持草稿自动保存。
- 在线编辑忘记保存就退出,下次登录会提示“检测到有上次编辑时自动保存的草稿。是否自动填充上次的草稿内容?”
安装部署showdoc
mkdir /data/www/showdoc-wiki -p
wget https://github.com/star7th/showdoc/archive/master.tar.gz
tar -zxvf master.tar.gz -C /data/www/showdoc-wiki/
mv /data/www/showdoc-wiki/showdoc-master /data/www/showdoc-wiki/html
chmod -R 777 /data/www/showdoc-wiki/html
配置nginx (php7自行安装,可搜索本博客)
cat /data/soft/nginx-1.16.1/conf/extra/wiki.123.com.conf
server {
listen 80;
server_name wiki.123.com;
charset utf-8,gbk;
return 307 https://wiki.123.com$request_uri;
}
server {
listen 443 ssl;
server_name wiki.123.com;
root /data/www/showdoc-wiki/html;
charset utf-8,gbk;
index index.php index.html index.htm;
gzip_types text/plain application/x-javascript text/css text/javascript application/x-httpd-php application/json text/json image/jpeg image/gif image/png application/octet-stream;
location ~ .*\.(php|php5|jsx)?$
{
# fastcgi_pass 127.0.0.1:9000;
fastcgi_pass unix:/data/tmp/php-fpm.sock;
fastcgi_index index.php;
include fastcgi.conf;
}
ssl_prefer_server_ciphers on;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4:!DH:!DHE;
ssl_certificate /etc/letsencrypt/live/wiki.123.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/wiki.123.com/privkey.pem;
access_log /data/logs/wiki.123.com.acc.log access;
error_log /data/logs/wiki.123.com.err.log;
}
注意:没有ssl证书可以只用80端口,或者直接用ip+端口
开始安装showdoc
浏览器输入https://wiki.123.com
安装初始化
升级showdoc
#拉取最新代码包
wget https://github.com/star7th/showdoc/archive/master.tar.gz
#解压代码包
tar -zxvf master.tar.gz -C /data/www/showdoc-wiki/
rm -rf /data/www/showdoc-wiki/html_bak ##有备份可以删除或命名
mv /data/www/showdoc-wiki/html /data/www/showdoc-wiki//html_bak
mv /data/www/showdoc-wiki/showdoc-master /data/www/showdoc-wiki/html
#赋予权限
chmod -R 777 /data/www/showdoc-wiki/html
#浏览器输入
https://wiki.123.com
重新安装初始化
#转移旧数据库
\cp -f /data/www/showdoc-wikia/html_bak/Sqlite/showdoc.db.php /data/www/showdoc-wiki/html/Sqlite/showdoc.db.php
#转移旧附件数据
\cp -r -f /data/www/showdoc-wiki/html_bak/Public/Uploads/. /data/www/showdoc-wiki/html/Public/Uploads
#删除安装文件
rm /data/www/showdoc-wiki/html/install -rf
#重启php-fpm和nignx生效
#如果中途出错,请重命名原来的 /data/www/showdoc-wiki/html_bak文件为 /data/www/showdoc-wiki/html
迁移到别的机器
- 直接拷贝/data/www/showdoc-wiki 目录到新机器,配置nginx即可。
相关文章
暂无评论...