Skip to content

Instantly share code, notes, and snippets.

@carld
Last active April 6, 2017 09:45
Show Gist options
  • Select an option

  • Save carld/b8ce44826f4c5330879532de3e9f0fab to your computer and use it in GitHub Desktop.

Select an option

Save carld/b8ce44826f4c5330879532de3e9f0fab to your computer and use it in GitHub Desktop.
Server setup
sudo apt-get update
sudo apt-get install nginx
sudo update-rc.d nginx defaults
wget -O - https://debian.neo4j.org/neotechnology.gpg.key | sudo apt-key add -
echo 'deb https://debian.neo4j.org/repo stable/' | sudo tee /etc/apt/sources.list.d/neo4j.list
sudo apt-get update
sudo apt-get install neo4j
# the follow goes in /etc/init/app.conf
cat <<EOF
description "Run app jar"
start on runlevel startup
stop on runlevel shutdown
respawn
env PORT=5000
exec java -jar /var/www/director-net.jar
EOF
# the following goes in /etc/nginx/sites/enabled/default
cat <<EOF
upstream http_backend {
server 127.0.0.1:5000;
keepalive 32;
}
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /usr/share/nginx/html;
index index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
proxy_pass http://http_backend;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
access_log /var/www/logs/do-clojure-web.access.log;
error_log /var/www/logs/do-clojure-web.error.log;
}
}
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment