By paul simmons
Hi, Iam stuck. I am following a tutorial “Full stack full stack web application raspberry pi” I am doing well, for a noob. The pi is a zero w with rasbian lite stretch, installed nginx, postgresql, php7, python3, pip, flask, installed uwsgi, The tutorial states ```>cd /var/www/heating/
vim heating_nginx.conf```
the code is
server {
listen
80;
server_name localhost;
charset
utf-8;
client_max_body_size 75M;
location /static {
root /var/www/heating/;
}
location / { try_files $uri @heating; }
location @heating {
include uwsgi_params;
uwsgi_pass unix:/var/www/heating/heating_uwsgi.sock;
}
}
You are configuring an app
and then create the link >ln -s /var/www/lab_app/lab_app_nginx.conf /etc/nginx/conf.d/
and then >vim /var/www/lab_app/lab_app_uwsgi.ini
[uwsgi]
#application’s base folder
base = /var/www/heating
#python module to import
app = hello
module = %(app)
home = %(base)/venv
pythonpath = %(base)
#socket file’s location
socket = /var/www/heating/%n.sock
#permissions for the socket file
chmod-socket
= 666
#the variable that holds a flask application inside the module imported at line #6
callable = app
#location of log files
logto = /var/log/uwsgi/%n.log
then the bit where it all goes wrong:
uwsgi —ini /var/www/heating/heating_uwsgi.ini
here I get the error message uwsgi: invalid option – ‘n’ getopt_long() error
Can any body point me in the right direction Kind regards Paul
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Looking at your configuration I am still not 100% sure where the ‘n’ option is coming from but I think it may be the last line of your ini file. I would try commenting out your logto line to see if the service starts properly.
It also looks like there is an extra linebreak that should be removed:
chmod-socket
= 666
should be
chmod-socket = 666
Hi again @ryanpq, Thank you for your reply, I was using only one -, I made it two – but got a huge error message!
*** Starting uWSGI 2.0.17 (32bit) on [Thu Apr 5 18:41:33 2018] ***
compiled with version: 6.3.0 20170516 on 04 April 2018 20:16:56
os: Linux-4.9.59+ #1047 Sun Oct 29 11:47:10 GMT 2017
nodename: heating3
machine: armv6l
clock source: unix
detected number of CPU cores: 1
current working directory: /home/pi
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 3405
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
bind(): Permission denied [core/socket.c line 230]
So I took away the comment tag added sudo (as I am not in root) and got
[uWSGI] getting INI configuration from /var/www/heating/heating_uwsgi.ini
Which is what I think I want but when I look at http://192.168.0.12 I dont get “hello world” I get
“Internal Server Error” Huge progress, nearly there!!! Thank you so much for your help so far you’re great!!! Kind regards Paul
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.