一直以来用的友言第三方评论系统倒闭了,现在连官方网站都打不开了。
所有的评论数据全部丢失,很伤。那我宁愿用开源的评论系统了,例如isso。
下面记录一下isso的使用方法(isso-0.11.1版本)。
安装(阿里云ECS的centos7.3环境)
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 
 | 安装pip,sqliteyum install python-devel sqlite
 升级pip
 pip install --upgrade pip
 根据报错提示安装依赖库
 yum install libffi-devel
 安装isso
 pip install isso
 新建立一个数据库目录
 mkdir -p /var/lib/isso
 
 | 
服务端配置
使用最简单配置测试
| 12
 3
 4
 5
 6
 7
 8
 9
 
 | [general]dbpath = /var/lib/isso/comments.db
 host = http://example.com/
 
 [server]
 listen = http://localhost:8090/
 
 [moderation]
 enabled = false
 
 | 
注意这边的host是让isso来帮助你跨域的,当你的评论系统是另外的域名时,这边要填被跨域的域名
| 1
 | isso -c /etc/isso.conf run
 | 
客户端配置
| 1
 | <script data-isso="http://example.com/isso/" src="http://example.com/isso/js/embed.min.js"></script>
 | 
博客模板中加入一行section
| 1
 | <section id="isso-thread"></section>
 | 
nginx配置
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 
 | server {listen 80;
 server_name example.com;
 access_log /data/log/nginx/access.log main;
 
 location /isso {
 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
 proxy_set_header X-Script-Name /isso;
 proxy_set_header Host $host;
 proxy_set_header X-Forwarded-Proto $scheme;
 proxy_pass http://localhost:8090;
 }
 }
 
 | 
使用
| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 
 | mkdir -pv /root/isso写入/root/isso/run.sh内容:
 nohup isso -c /etc/isso.conf run >> /root/isso/isso.log 2>&1 &
 
 写入/root/isso/check_isso.sh内容:
 found=`ps -ef|grep isso|grep -v grep`
 if [[ $found == "" ]];then
 ./run.sh
 fi
 
 写入/etc/crontab内容:
 * * * * *   root    cd /root/isso && ./check_isso.sh
 
 service crond restart
 
 | 
数据备份
因为我有很多阿里云的服务器,因此简单的定时scp即可
| 12
 3
 4
 
 | 写入/root/isso/scp.shscp /var/lib/isso/comments.db root@x.x.x.x:/root
 写入/etc/crontab:
 * 0 * * *   root    cd /root/isso && ./scp.sh
 
 | 
参考文章
这一篇文章有个坑,js不是embed.js而是embed.min.js
Debian / Ubuntu 搭建 Isso 评论系统教程
开源评论系统 Isso 全攻略