how to use pelican and isso on centos7

  1. install python, nginx, sqlite

    yum -y install epel-release
    yum -y groupinstall "Development Tools"
    yum -y install https://centos7.iuscommunity.org/ius-release.rpm
    yum -y install python36u python36u-pip python36u-devel nginx sqlite
    
  2. install pelican, isso, supervisor

    pip3 install pelican[Markdown] isso supervisor
    
  3. prepare config files

    cat nginx_site.conf

    server {
        listen       80;
        server_name  chenshi.net;
        location / {
            proxy_pass http://127.0.0.1:8000;
        }
        location /isso {
            proxy_pass http://127.0.0.1:8090;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            proxy_set_header X-Forwarded-Proto $scheme;
                }
    }
    

    cat /etc/isso.conf

    [general]
    dbpath = /var/lib/isso/comments.db
    name =
    host = http://chenshi.net/
    max-age = 1m
    notify = smtp
    #notify = stdout
    log-file =
    
    [moderation]
    enabled = false
    purge-after = 7d
    
    [server]
    listen = http://127.0.0.1:8090/
    reload = off
    profile = off
    
    [smtp]
    username = account
    password = password
    host = smtp.gmail.com
    port = 587
    security = starttls
    to = [email protected]
    from = "Isso Comment"
    timeout = 10
    
    [guard]
    enabled = true
    ratelimit = 1
    direct-reply = 10
    reply-to-self = false
    require-author = false
    require-email = false
    

    tail -n 20 /etc/supervisor.conf

    [program:pelican]
    command = pelican --listen
    directory = /home/centos/pelican/
    user = root
    autostart = true
    autorestart = true
    stdout_logfile = /var/log/pelican/pelican.log
    stderr_logfile = /var/log/pelican/pelican_error.log
    environment = LANG="en_US.UTF-8"
    
    [program:isso]
    command = isso -c /etc/isso.conf run
    directory = /var/lib/isso/
    user = root
    autostart = true
    autorestart = true
    stdout_logfile = /var/log/isso/isso.log
    stderr_logfile = /var/log/isso/isso_error.log
    environment = LANG="en_US.UTF-8"
    
  4. add isso to comments.html

    <hr/>
    <section class="comments" id="comments">
        <h2>{{ _('Comments') }}</h2>
    
        <section id="isso-thread"></section>
        <script data-isso="http://chenshi.net/isso/" src="http://chenshi.net/isso/js/embed.min.js"></script>
    </section>
    
  5. start programs

    supervisord -c supervisor.conf
    nginx