Skip to main content

Turtl API Server Installation CentOS 7

Clone and Configure Turtl

  1. Create a user for turtl API: sudo useradd turtl
  2. Switch user to turtl: sudo su turtl
  3. Change directory to turtl's home: cd ~
  4. Install Clozure CL
  5. Install RethinkDB and create an instance for Turtl API
  6. Install libuv: sudo yum install libuv
  7. Clone Turtl repo: git clone https://github.com/turtl/api.git
  8. Copy Turtl API config: cp config/config.default.lisp config/lisp
  9. Edit and configure config/config.lisp, make sure to update the following parameters:
    (defvar *local-upload* "<local upload directory>"
    (defvar *local-upload-url* "<upload url>"
    

Setup Up Service

Create a service file at /usr/lib/systemd/system/turtl.service with the following entry:

[Unit]
Description=Turtl API Server

[Service]
User=turtl
Group=turtl
ExecStart=/usr/local/bin/ccl64 --load /home/turtl/api/start.lisp
KillMode=process

[Install]
WantedBy=multi-user.target

Start and enable the service:

sudo systemctl start turtl
sudo systemctl enable turtl

(OPTIONAL) Configure Reverse Proxy in Apache

Create httpd virtual host configuration /etc/httpd/conf.d/turtl.conf with the following content, make sure to change <turtl domain> to your own domain name:

<VirtualHost *:80>
    #Server name configuration
    ServerName <turtl domain>
    ServerAdmin webmaster@<turtl domain>

    #Proxy configuration
    ProxyPreserveHost on
    ProxyRequests off
    ProxyPass / http://localhost:8181/
    ProxyPassReverse / http://localhost:8181/

    #Logging configuration
    ErrorLog /var/log/httpd/turtl.err
    LogLevel warn
</VirtualHost>