Skip to content

Instantly share code, notes, and snippets.

@glisha
Created December 24, 2012 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save glisha/4369311 to your computer and use it in GitHub Desktop.
Save glisha/4369311 to your computer and use it in GitHub Desktop.
nginx+uwsgi+hatta
#!/bin/bash
HATTADIR="/home/glisha/webapps/nginx/html/georgi.softver.org.mk.wiki"
/home/glisha/bin/uwsgi \
--pidfile $HATTADIR/run/uwsgi.pid \
--daemonize $HATTADIR/run/uwsgi.log \
--processes 1 \
--socket $HATTADIR/run/hatta.sock \
--wsgi-file $HATTADIR/hatta.wsgi \
echo "Log file vo $HATTADIR/run/uwsgi.log"
#!/bin/env python2.7
# -*- coding: utf-8 -*-
import sys
# XXX Uncomment and edit this if hatta.py is not installed in site-packages
sys.path.insert(0, "/home/glisha/webapps/nginx/html/georgi.softver.org.mk.wiki")
sys.path.insert(0,"/home/glisha/lib/python2.7")
import hatta
config = hatta.WikiConfig(
pages_path='/home/glisha/webapps/nginx/html/georgi.softver.org.mk.wiki/stranici', # XXX Edit this!
cache_path='/home/glisha/webapps/nginx/html/georgi.softver.org.mk.wiki/cache', # XXX Edit this!
# read_only=True,
)
config.parse_args()
config.parse_files()
config.sanitize()
wiki = hatta.Wiki(config)
application = wiki.application
#georgi.softver.org.mk (static)
server {
listen 26297;
server_name georgi.softver.org.mk;
access_log off;
location / {
index index.html index.php;
root html/georgi.softver.org.mk/;
}
location /wiki {
include uwsgi_params;
uwsgi_param SCRIPT_NAME /wiki;
uwsgi_modifier1 30;
uwsgi_pass unix:/home/glisha/webapps/nginx/html/georgi.softver.org.mk.wiki/run/hatta.sock;
uwsgi_param REMOTE_ADDR $proxy_add_x_forwarded_for;
}
}
[glisha@web53 nginx-1.1.5]$ ./configure --prefix=/home/glisha/webapps/nginx/ \
--sbin-path=/home/glisha/webapps/nginx/sbin/nginx \
--conf-path=/home/glisha/webapps/nginx/conf/nginx.conf \
--error-log-path=/home/glisha/webapps/nginx/log/error.log \
--pid-path=/home/glisha/webapps/nginx/run/nginx.pid \
--lock-path=/home/glisha/webapps/nginx/lock/nginx.lock \
--http-log-path=/home/glisha/webapps/nginx/log/access.log \
--http-client-body-temp-path=/home/glisha/webapps/nginx/tmp/client/ \
--http-proxy-temp-path=/home/glisha/webapps/nginx/tmp/proxy/ \
--http-fastcgi-temp-path=/home/glisha/webapps/nginx/tmp/fcgi/ \
--http-uwsgi-temp-path=/home/glisha/webapps/nginx/tmp/uwsgi/ \
--http-scgi-temp-path=/home/glisha/webapps/nginx/tmp/scgi/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment