First time here? Check out the FAQ!
2

How to configure Askbot with Nginx and uWSGI?
 

Please provide me a Nginx Configuration for AskBot file located at /etc/nginx/sites-available/ directory

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
gopalraha's avatar
332
gopalraha
asked 8 years ago, updated 8 years ago

Comments

Dear @Evgeny Please **tag** this question with **nginx** tag Regards

gopalraha's avatar gopalraha (8 years ago)

@gopalraha is retag function not working for you?

Evgeny's avatar Evgeny (8 years ago)

Yes!!! Its not working for me..

gopalraha's avatar gopalraha (8 years ago)

What browser are you using?

Evgeny's avatar Evgeny (8 years ago)

I forget to **tag** the question when I have ask the question here. When I use the **retag** function it won't works anymore.

gopalraha's avatar gopalraha (8 years ago)
see more comments

1 Answer

3

I use uwsgi with nginx

This is my nginx configuration:

server {
        listen 80;
        server_name ldstw.org www.ldstw.org;
        location / {
        include         uwsgi_params;
        uwsgi_pass      unix:/home/s930029/GospelForum/askbot.sock;
   }
}

This is my uwsgi configuration

[uwsgi]
project = askbot
base = /home/s930029
static-map = /m=/home/s930029/GospelForum/static
chdir = %(base)
home = /home/s930029/.virtualenvs/askbot/
wsgi-file = /home/s930029/GospelForum/django.wsgi
master = true
processes = 5
threads = 2

logto = /var/log/uwsgi/%n.log

socket = %(base)/GospelForum/askbot.sock
chmod-socket = 664
setuid  = www-data
setgid = www-data
vacuum = true

My /etc/systemd/system/uwsgi.service

[Unit]
Description=uWSGI Emperor service

[Service]
ExecStartPre=/bin/bash -c 'mkdir -p /run/uwsgi; chown s930029:www-data /run/uwsgi'
ExecStart=/usr/local/bin/uwsgi --emperor /etc/uwsgi/sites
Restart=always
KillSignal=SIGQUIT
Type=notify
NotifyAccess=all

[Install]
WantedBy=multi-user.target

For explanation: see https://www.digitalocean.com/communit...

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
AaronHuang's avatar
113
AaronHuang
answered 8 years ago, updated 8 years ago
link

Comments

Thanks for info. Please provide me '/etc/systemd/system/uwsgi.service' contents

gopalraha's avatar gopalraha (8 years ago)

@gopalraha I have modified my answer.

AaronHuang's avatar AaronHuang (8 years ago)

@AaronHuang Thanks a lot :) friend

gopalraha's avatar gopalraha (8 years ago)

one last question "home = /home/s930029/.virtualenvs/askbot/" is your python virtualenv path or something else.

gopalraha's avatar gopalraha (8 years ago)

Yes, it's my python virtualenv path.

AaronHuang's avatar AaronHuang (8 years ago)
see more comments