On 25 Oct 2018, at 15:36, blaxxton via Kotti wrote:
Following below installation document:
https://kotti.readthedocs.io/en/latest/developing/basic/deployment.html
after restarting nginx, noticed the socks file was not created and got file
not found error in nginx log files,
so manually created the file in /tmp and chmod 666 as it set in wsgi
section of kotti.ini.
You shouldn't do that. If the file is not created where you expect it, you either have specified a wrong path or the user running uwsgi doesn't have the permission required to create that file.
now I get below error:
2018/10/25 08:26:05 [error] 24834#24834: *3 connect() to
unix:/tmp/domainname.sock failed (111: Connection refused) while connecting
to upstream, client: X.X.X.X, server: domainname.com, request: "GET /
HTTP/1.1", upstream: "uwsgi://unix:/tmp/domainname.sock:", host:
"domainname.com"
supervisor process is pointed to kotti.ini but there is no directive in
nginx config to point to kotti.ini
so I think there are some steps are missing in document.
nginx doesn't need kotti.ini
at all. You just have to make sure, that the path
uwsgi_pass unix:/tmp/domainname.sock;
in your nginx config matches the path in your kotti.ini
:
[uwsgi]
socket = /tmp/domainname.sock
If you doublechecked the above and still get the same error, check owner/group and permissions for the socket to allow both the user running nginx and the user running uwsgi can read and write to the socket file.
HTH,
Andreas
On 26 Oct 2018, at 0:24, 'Blaxton' via Kotti wrote:
Following below document:https://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html
I am able to connect to nginx socket and browse on port 80:server {
listen 80;
server_name domainname.com;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:3031;
}
}
using command:
uwsgi --socket 127.0.0.1:3031 --wsgi-file foobar.py --master --processes 4 --threads 2
therefore nginx config is ok, it only left wsgi config in kotti.ini
There should be a wsgi file, to:
https://github.com/FriendCode/python-django-sample/blob/master/hellodjango/wsgi.py
There should be the same file for kotti.
I have already setup wsgi and Apache to use Pyramid using below wsgi config file:from pyramid.paster import get_app, setup_logging
ini_path = '/path/to/development.ini'
setup_logging(ini_path)
application = get_app(ini_path, 'main')
There has to be the same config for kotti but nothing has mentioned.
No, uWSGI doesn't need a wsgi-file. It can load the application from the ini file. This is from a Kotti application's ini file I'm running:
[app:tng3]
use = egg:kotti
…
[filter:fanstatic]
use = egg:fanstatic#fanstatic
…
[pipeline:main]
pipeline =
fanstatic
tng3
[uwsgi]
virtualenv = /usr/local/app
paste = config:/usr/local/app/app.ini
limit-post = 2097152
post-buffering = 2097152
processes = 2
threads = 2
enable-threads = true
env = LANG=en_US.UTF-8
uWSGI is run like this:
/usr/local/bin/uwsgi-2.7 --ini /usr/local/app/app.ini --master --uid uwsgi --gid www --pidfile /var/run/uwsgi.pid -d /var/log/uwsgi.log -s /tmp/app.socket --chmod-socket=660 --chown-socket=uwsgi:www -L
You can freely move uWSGI configuration options from command line options to the [uwsgi]
section in your ini file or vice versa.
Reading over the thread and docs again, I think the documentation is missing the paste = config:/usr/local/app/app.ini
line in the the ini file.
HTH,
Andreas
Create a supervisor config for Kotti / uWSGI in /etc/supervisor/conf.d/kotti.conf
:
[program:kotti] autorestart=true command=uwsgi_python --ini-paste /home/kotti/kotti.ini directory=/home/kotti redirect_stderr=true
On 14 Nov 2018, at 16:48, 'Blaxton' via Kotti wrote:
Sorry guys, first time using nginx and uwsgi.
changed uwsgi_python to /home/kotti/bin/uwsgi
and added logto directive to check uwsgi errors:
logto = /var/log/uwsgi/uwsgi.log
checking the uwsgi log file getting postgres access denied
This is usually related to the contents of your pg_hba.conf
.
but now I know where I stand, thanks for all your help,will send update once figured the rest.
quick question, how may I contribute to kotti documentation?
The docs reside in the docs
directory of the Kotti repo. You'd usually fork Kotti on Github, make some changes to your fork (probably in a branch) and create a pull request.
do I need to know about sphinx to edit the kotti documentation ?
Unless you want to change the docs structure or create new pages, you don't need to know anything (or at most very little) about Sphinx. The "pages" are simple reStructuredText documents. However, you could have Sphinx render the HTML locally to check if your changes look like intended:
cd <your kotti checkout directory>
python setup.py docs
cd docs
make html
HTH,
Andreas