Install nginx

sudo apt-get install nginx-full

Install gunicorn

sudo apt-get install gunicorn

Install python + virtualenv

TODO: described somewhere else

Switch to web virtualenv

This is done under the user that runs the process.

workon web

Configure nginx

Requests are forwarded to localhost:6010.

  location ~ /wps/?(.*)$ {

    	   proxy_set_header X-Forwarded-Host $host/wps/;
	   proxy_set_header X-Forwarded-Server $host;
	   proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	   proxy_read_timeout 120;
	   proxy_pass http://127.0.0.1:6010/$1$is_args$args;
    }

The data (for store enabled processes) is expected to live /data/wps. Turn of auto-index otherwise people can browse eachothers data.

  location /outputwps/ {
           alias /data/wps/;
	   autoindex off;
  }

Use the wsgiwps

https://github.com/jachym/PyWPS/blob/master/webservices/wsgi/wsgiwps.py

Start gunicorn

gunicorn wsgiwps:dispatchWps -b 127.0.0.1:6010

This should result in a response from server/wps

  • No labels