Skip to content

OpenBSD Deployment

Nathan Vasquez edited this page Aug 16, 2022 · 7 revisions

This page covers how to access the OpenBSD Deployment on one of our private servers.

This can only be done if you are authorized via RSA.

Setup (httpd.conf)

  1. Create or open /etc/httpd.conf
  2. This section below listens to port 80 for http requests and will forward them to another socket which uwsgi will listen on.
server "default" {
        listen on 0.0.0.0 port 80
        fastcgi socket tcp 127.0.0.1 3031
}
  1. If you plan on using ssl for https add something like the following.
server "ssl" {
        listen on 0.0.0.0 tls port 443
        tls {
                key "/etc/ssl/private/bobchat.key"
                certificate "/etc/ssl/private/bobchat.crt"
        }
        fastcgi socket tcp 127.0.0.1 3031
}
  1. See also man httpd.conf(5), man httpd(8)

Instructions

  1. Access the server via ssh.

  2. Attach to (or create) a session::

    tmux attach
    

    If no sessions are found, then simply create a new one:

    tmux
    
  3. Activate the local virtual environment::

    . ~/venvs/bobchat/bin/activate
    
  4. Host the server through uwsgi::

    cd /var/www/bobchat
    git pull
    uwsgi --fastcgi-socket localhost:3031 --wsgi-file wsgi.py --callable app
    

note: uwsgi and git pull both need to be able to edit data under /var/www/bobchat. The approach we took to address this is simply run everything as su which is likely a terrible solution so if you have any suggestion feel free to reach out and thanks in advance. use chgrp command to change the ownership of /var/www/bobchat/ to whatever group your user account is apart of. Alternatively chown should work too.

Clone this wiki locally