Re: [uWSGI] uwsgi exec in chroot

2017-04-05 Thread Damjan Georgievski
On 5 April 2017 at 17:40, Glenn Jones wrote: > Is there a way to get uwsgi running in emperor mode to exec a completely > fresh > vassal process after chrooting? Here is the background of what we're trying > to > do any why: --emperor-wrapper ? ps. afaik, the emperor doesn't fork vassals, it for

Re: [uWSGI] running with a different version of python

2017-12-11 Thread Damjan Georgievski
On 11 December 2017 at 23:56, Larry Martell wrote: > I am running on CentOS 7, which has a default python of 2.7.5. I want > to run uWSGI with 2.5.13, which I have downloaded. From a shell I need > to run this to enable the other version: > > scl enable python27 bash > > I tried modifying /etc/sys

Re: [uWSGI] why uwsgi invokes /bin/bash

2018-08-08 Thread Damjan Georgievski
On 8 August 2018 at 16:17, Michael Ströder wrote: > HI! > > I'm using uwsgi for starting WSGI Python apps. > > uwsgi itself is started with a systemd unit which also mandates that an > AppArmor profile is load for that unit. > > Although I'm using pretty tight AppAmor profiles everything works. >

Re: [uWSGI] uwsgi python3.7, strange output

2019-06-17 Thread Damjan Georgievski
On Mon, 17 Jun 2019 at 23:27, Tamer Higazi wrote: > Hi people, > > I am not getting smart. Can somebody explain me this ? > Python 3.7 was compiled with this configure statement: > > ./configure --enable-ipv6 --with-system-ffi --enable-shared > > Any ideas what could there be wrong ? > > > best,

Re: [uWSGI] [ANNOUNCE] uWSGI 1.0.5

2012-04-09 Thread Damjan Georgievski
> You cannot use curl in that way (it will wait for the whole output). > This is common even for some browser (safari for example requires a > minimal amount of data before sending output). > > There is a flag to turning off buffering in curl: > > curl -N -i http://localhost:8080 I was under the i

Re: [uWSGI] [ANNOUNCE] uWSGI 1.0.5

2012-04-09 Thread Damjan Georgievski
>> Trying this, and also 1.1 with the gevent example ./tests/ugevent.py I >> only get the full response once it's all done, it's not streamed to the >> client. > > curl -N -i http://localhost:8080 > > should do the trick Now that I have a working example with --http-socket how do I need to configu

Re: [uWSGI] [ANNOUNCE] uWSGI 1.0.5

2012-04-09 Thread Damjan Georgievski
>> curl -N -i http://localhost:8080 >> >> should do the trick > > Now that I have a working example with --http-socket how do I need to > configure nginx when using the uwsgi protocol? ok, I've found 'uwsgi_buffering' needs to be set to 'off' maybe these 2 things should be mentioned on the Gevent

Re: [uWSGI] Env vars not getting picked up via UWSGI_SETENV

2012-08-01 Thread Damjan Georgievski
> I'm having an impossible time getting a Flask app to see any environment > variables I try and pass through from nginx using the "uwsgi_param > UWSGI_SETENV VARNAME=FOO" method. > > Trying to access these vars via os.environ['VARNAME'] always throws a > KeyError exception. Interestingly, passing

[uWSGI] Segfault on debian squeeze

2012-12-19 Thread Damjan Georgievski
I have an app that started segfaulting yesterday. In trying to find what's the problem is I've simplified it to this config file, and I still get segfaults. I did recompile uwsgi, still the same. Any idea what could be this? [uwsgi] master = true daemonize = %d/log/uwsgi.log touch-reload = %p thre

Re: [uWSGI] Segfault on debian squeeze

2012-12-19 Thread Damjan Georgievski
> Be sure you are not loading the python plugin from another build. > > Try building a monolithic version. Built a monolithic version and it works. But, I'm sure that the python plugin was correct. I was deleting the whole /usr/local/lib/uwsgi/ directory -- damjan

Re: [uWSGI] Segfault on debian squeeze

2012-12-19 Thread Damjan Georgievski
> But, I'm sure that the python plugin was correct. > I was deleting the whole /usr/local/lib/uwsgi/ directory With the help of the irc channel we found the problem. I was building a modular uwsgi with python uwsgiconfig.py --build package and python uwsgiconfig.py --plugin plugins/python core py

Re: [uWSGI] What's the proper way to run background jobs in uWSGI

2013-02-19 Thread Damjan Georgievski
>> >> Actually this is still not fixed in 1.4.5 or HEAD in 1.4 > > use the newer uwsgidecorators (committed in 1.4), the previous one, did > not catch the exception forcing the post_fork hook to continue calling the > classing mule handler. > >> >> 1.5 HEAD 50891 on the other hand does restart but

[uWSGI] trying an unshare setup with php

2013-09-05 Thread Damjan Georgievski
I'm trying to jail mediawiki on Linux by using the unshare support in uwsgi. I want to setup the chroot in /srv/mediawiki, which has /app /var /proc /dev direcotries. Mediawiki is installed from package in /usr/share/webapps/mediawiki, and I try to bind mount that to /app Following are my uwsgi

Re: [uWSGI] on debian patches

2013-10-09 Thread Damjan Georgievski
> > The Arch ones seem like they got copied from the RPM spec for fedora, > which I > wrote. A brief explanation: > - uwsgi_ruby20_compatibility.patch because fedora ships with ruby20 >now > Arch too comes with ruby 2.0, but uwsgi-plugin-rack builds even without that patch > - uwsgi_trick_

Re: [uWSGI] [ANNOUNCE] uWSGI 2.0.2

2014-02-26 Thread Damjan Georgievski
it seems the release is not tagged on github (and I use the release tarballs that github provides) On 26 February 2014 17:24, Roberto De Ioris wrote: > Hi everyone, a tiny minor bugfix release is available: > > http://uwsgi-docs.readthedocs.org/en/latest/Changelog-2.0.2.html > > Users of CGI an

[uWSGI] logstash best practice

2014-03-17 Thread Damjan Georgievski
Anyone using logstash to collect uwsgi logs? What are some best practices when configuring uwsgi - or for that matter logstash too. Especially wrt tracebacks from python, ruby and php applications which are often multiline. -- damjan ___ uWSGI mailing

Re: [uWSGI] logstash best practice

2014-03-25 Thread Damjan Georgievski
On 18 March 2014 01:07, Damjan Georgievski wrote: > Anyone using logstash to collect uwsgi logs? > What are some best practices when configuring uwsgi - or for that matter > logstash too. > > Especially wrt tracebacks from python, ruby and php applications which are > often mul

Re: [uWSGI] logstash best practice

2014-03-26 Thread Damjan Georgievski
>> The claim on http://uwsgi-docs.readthedocs.org/en/latest/Logging.html that >> ... logger = file:/tmp/foobar # This logger will log everything as >> it's not named ... >> >> seems to not be true, it doesn't log to tty like that >> > > can't reproduce the problem: > > ./uwsgi --logger file:/dev/t

Re: [uWSGI] uwsgi and PHP_INI_SCAN_DIR

2014-04-04 Thread Damjan Georgievski
> i'm a complete newby to uwsgi, so sorry if i'm overlooking something > obvious. > > I've recompiled uwsgi 2.0.3 along with php plugin and i'm trying to have > $PHP_INI_SCAN_DIR system variable passed to underlying php instance (5.3.3) > in order to have a given directory scanned for additional in

[uWSGI] fastrouter with "builtin" fallback

2014-06-19 Thread Damjan Georgievski
I'm trying to setup a fastrouter with a fallback that in the same process/config. Should this config work, because it doesn't for me: The fastrouter just closes the connection to nginx as if it didn't have a fallback. [uwsgi] master = true plugin = fastrouter fastrouter = @fastrouter fastrouter-

Re: [uWSGI] fastrouter with "builtin" fallback

2014-06-20 Thread Damjan Georgievski
> I have added the --fastrouter-fallback-on-no-key option/flag > > https://github.com/unbit/uwsgi/commit/84d6f54ddd879650cf4b0d827598630e629e0496 > > unfortuately i do not think it can be added flawlessly to the httprouter too > (eventually it is something for 2.1 branch) > works fine -- damj

Re: [uWSGI] [ANN] mysqlclient-python 1.3.2 is released

2014-07-03 Thread Damjan Georgievski
> I've just released mysqlclient-python 1.3.2 > > https://pypi.python.org/pypi/mysqlclient > > This is a fork of MySQL-python. > New feature introduced in 1.3.2 is asyncio+coroutine friendness. > > Here is example with gevent: > https://github.com/PyMySQL/mysqlclient-python/blob/master/samples/wait

Re: [uWSGI] Ideas for 2.1

2014-09-10 Thread Damjan Georgievski
On 11 September 2014 01:15, Jacob Rief wrote: > When building Docker containers, one must run services such as nginx, sshd > and uwsgi controlled by supervisord. http://jpetazzo.github.io/2014/06/23/docker-ssh-considered-evil/ "If you run SSHD in your Docker containers, you're doing it wrong!"

Re: [uWSGI] jQuery with uWSGI

2014-10-06 Thread Damjan Georgievski
> location /project/ { > include uwsgi_params; > uwsgi_pass 127.0.0.1:9090; ... > [uwsgi] > http-socket= :9090 You can't use uwsgi_pass with http-socket -- damjan ___ uWSGI mailing list uWSGI@lists.unbit.it http://lists.unbit.it/cgi-bin/

Re: [uWSGI] uwsgi in docker

2014-10-08 Thread Damjan Georgievski
On 8 October 2014 17:19, Roberto Bampi wrote: > Hi all, > we are trying to use uwsgi to host a django application in a docker [1] > container. > Docker's main way to configure packaged application is to pass environment > variables to them. > So I configured my django application to read most of t

Re: [uWSGI] Server can't see app and I can't figure out why

2014-11-11 Thread Damjan Georgievski
On 11 November 2014 15:34, Rui Pacheco wrote: > I have a Flask app running behind uwsgi 2.0.8. Startup logs seem to be ok > except for a problem: whenever I hit a URI on my app I always get a 404. I > can see in the uwsgi logs that 0 bytes were returned and on the nginx logs > that the URI was

Re: [uWSGI] Content-Length woes between uwsgi/php and nginx

2014-12-08 Thread Damjan Georgievski
On 8 December 2014 at 16:52, Jean-Baptiste Quenot wrote: > Hello fellow UWSGI supporters, > > I'm struggling with an issue in my PHP software (namely Pimcore). > > The PHP stuff is served through an Haproxy -> Nginx -> UWSGI stack that runs > without a hitch since 18 months. > > A few days ago, af

[uWSGI] asyncio coroutines and uwsgi

2015-02-01 Thread Damjan Georgievski
Reading about asyncio in uwsgi at http://uwsgi-docs.readthedocs.org/en/latest/asyncio.html I really didn't like the ugly explicit switching, passing the greenlet around and the future. So I made this simple decorator that hides that away: def coroutine(f): def _f(*args, **kwargs): myse

Re: [uWSGI] asyncio coroutines and uwsgi

2015-02-01 Thread Damjan Georgievski
om sleeping() return [response] On 1 February 2015 at 22:20, Damjan Georgievski wrote: > Reading about asyncio in uwsgi at > http://uwsgi-docs.readthedocs.org/en/latest/asyncio.html > > I really didn't like the ugly explicit switching, passing the greenlet > around and

Re: [uWSGI] asyncio coroutines and uwsgi

2015-02-02 Thread Damjan Georgievski
I've made some improvements and comments here https://gist.github.com/gdamjan/b417ad54e59073a112ba the second approach basically delegates the uwsgi/greenlet worker to an asyncio coroutine and from then on everything is asyncio. the shortcoming of the first approach is that you can be easily foo

Re: [uWSGI] how to use @timer decorator?

2015-02-06 Thread Damjan Georgievski
> I'm writing a Django application and want to use some extra facilities of > uWSGI. > > I'd like to use the @timer decorator to periodically execute some > "offline" processes, like scanning a directory and adding to a > database. But if I include the file that defines this function from > my mo

Re: [uWSGI] Tyrant mode, vassals not using uid specified in their configuration

2015-03-12 Thread Damjan Georgievski
> In my scenario, the emperor is running as root, as expected, but the vassal > processes end up running as another user on our test server, not www-data. > However, if remove the "emperor-tyrant = true" from the emperor > configuration, the vassals do run as using the www-data user, as specified >

Re: [uWSGI] Tyrant mode, vassals not using uid specified in their configuration

2015-03-12 Thread Damjan Georgievski
>> > In my scenario, the emperor is running as root, as expected, but the >> > vassal >> > processes end up running as another user on our test server, not >> > www-data. >> > However, if remove the "emperor-tyrant = true" from the emperor >> > configuration, the vassals do run as using the www-dat

[uWSGI] http status and response time in custom logger

2015-05-20 Thread Damjan Georgievski
I'm using msgpack logging to logstash, as here http://uwsgi-docs.readthedocs.org/en/latest/LogEncoders.html#the-msgpack-encoder Is it possible to add fields for the response time and http status to the log message structure? My current encoder is set as: log-encoder = msgpack:logstash map:4|

Re: [uWSGI] How to get upload file name in Flask

2015-05-29 Thread Damjan Georgievski
it'll be in the request.environ dictionary. do you use proxy_pass or uwsgi_pass in the nginx config? On 29 May 2015 at 11:01, Jerry OELoo wrote: > Hi. > I am using Nginx + uWSGI + Flask for web service. > Now use Nginx upload module to support file upload. and set file name in > X-FILE. > > pro

[uWSGI] empty SCRIPT_NAME when using php-app

2015-06-26 Thread Damjan Georgievski
I have no idea what the correct behaviour here is, but at least Slim the PHP framework fails when used with --php-app, and it complains about the empty SCRIPT_NAME SCRIPT_NAME seems to be empty in uwsgi in both cases on the uwsgi level, but when in php in the first case (php-app) it's again empty,

[uWSGI] tracing php app execution

2015-07-30 Thread Damjan Georgievski
Is it possible to trace the execution of a PHP webapp? owncloud is returning me an HTTP 500 error but it doesn't log anything, and I want to find out where it does that. what are my debug options? -- damjan ___ uWSGI mailing list uWSGI@lists.unbit.it

Re: [uWSGI] documentation of uwsgi.h file

2015-10-23 Thread Damjan Georgievski
there's also this, https://github.com/unbit/uwsgi/tree/master/plugins/cplusplus I don't know if it helps you On 23 October 2015 at 21:49, Bo Lorentsen wrote: > Hi ... > > I am quite new to uwsgi and this list, so I am sorry if this has been asked > before. > > I like to make a C++ plugin, using t

Re: [uWSGI] An aiohttp example (special branch)

2015-11-03 Thread Damjan Georgievski
I think the indentation in the example is wrong for the "async for msg in ws:" block. btw, how does this work? what parses the uwsgi protocol? since you map the socket fds to the aiohttp.web.make_handler handler wont that expect http? On 3 November 2015 at 10:19, Roberto De Ioris wrote: > Hi,

Re: [uWSGI] Any tips on uwsgi packaging for as easy as Go program??

2015-11-12 Thread Damjan Georgievski
On 12 November 2015 at 09:14, est wrote: > hello list, > > I have this django+uwsgi project need to ship to a client. I wanna make sure > it's dead simple as possible, something like copy package, run package and > viola would be awesome. > > > So I looked into this, setuptools installs package to

Re: [uWSGI] 3 different uwsgi apps max to 100% cpu and stuck there, lot of epoll_wait and "Resource temporarily unavailable" on AWS

2015-12-01 Thread Damjan Georgievski
On 1 December 2015 at 13:55, Curtis wrote: > On 01/12/15 23:42, alonn wrote: > >> Example configuration for different apps >> >> [uwsgi] >> socket = /tmp/rest.sock >> chmod-socket = 664 >> uid = www-data >> gid = www-data >> master = true >> processes = 4 >> threads = 25 >> > > This may be a sill

[uWSGI] weird interaction between mount python app and routes

2015-12-18 Thread Damjan Georgievski
Below is my config (.ini) file. Requesting the /_auth url should hit my application, all other urls should redirect to /_auth The problem is, even a request to /_auth is redirected to /_auth and `redirect will happen` shows up in the log. This only happens when I use the `mount` option, not for e

[uWSGI] empty response from rpc fails the request

2015-12-18 Thread Damjan Georgievski
I've found that an empty string returned from a rpc function would stop a request with a 500 error for ex: @rpc('myrpc') def myrpc(): return b"" and route-run= rpcvar:TEST myrpc will just end the request as soon the rpcvar route is invoked. The empty string goes back to uwsgi as NULL at

Re: [uWSGI] weird interaction between mount python app and routes

2015-12-18 Thread Damjan Georgievski
On 18 December 2015 at 16:34, Damjan Georgievski wrote: > Below is my config (.ini) file. > > Requesting the /_auth url should hit my application, all other urls should > redirect to /_auth > > The problem is, even a request to /_auth is redirected to /_auth and > `redirect

Re: [uWSGI] Debian Jessie, Nginx, PHP, UWSGI quick start

2016-01-02 Thread Damjan Georgievski
On 2 January 2016 at 08:37, Thomas Glanzmann wrote: > Hello, > I had to host a potential unsecure PHP web application. So I though about > writing a small c programm which creates a network, filesystem, pid, > uts, and ipc namespace and run php-fpm inside it. Since you're on jessie, you can also

Re: [uWSGI] remove file after sendfile

2016-03-18 Thread Damjan Georgievski
> > if you have a file descriptor open you can unlink the file from the > filesystem, the file will be actually removed once the fd is closed. > Wouldn't uwsgi cleanup my psgi application before passing name to an > "offload thread"? Also, afaik unlinking with open fd would make file not > access

Re: [uWSGI] remove file after sendfile

2016-03-19 Thread Damjan Georgievski
if you have a file descriptor open you can unlink the file from the filesystem, the file will be actually removed once the fd is closed. On 18 March 2016 at 10:50, Руслан Закиров wrote: > Hi, > > I've setup an app that serves files after processing using sendfile and I > want to remove them afte

Re: [uWSGI] Newbie: serving Flask app with UWSGI on Debian 8 not working

2016-05-06 Thread Damjan Georgievski
> I should also say that I have only SSH access to the Debian machine, that's all you need. > Windows computer to access the Debian one, with SSH for direct access and > Firefox to test web serving. Unfortunately, I can't copy text from SSH > output to paste here, nor can I paste into SSH. Any ou

Re: [uWSGI] Stupid question: where'd the main ini file go?

2016-05-10 Thread Damjan Georgievski
On 10 May 2016 at 17:22, Alex Hall wrote: > Hi all, > I feel pretty bad that I have to ask this at all, but where's my UWSGI main > ini file get to? I thought I had it in /etc/uwsgi, but it's not there. > Starting UWSGI fails, and I don't know why as the log is empty (as usual). > Some forum sugge

Re: [uWSGI] Unable to open log file despite chmod and chown

2016-05-11 Thread Damjan Georgievski
On 11 May 2016 at 20:07, Alex Hall wrote: > Hi all, > Sometimes, when I start my uwsgi from an ini file in which a log file is > specified, I get an error 288. This says that permission to write to the log > file was denied. The file is > /var/log/uwsgi/myapp.log > and I've done > chown www-data /

Re: [uWSGI] django1.6 with uwsgi and nginx on RHEL 7

2016-06-06 Thread Damjan Georgievski
On 6 June 2016 at 19:01, Larry Martell wrote: > I have successfully deployed django1.6 with uwsgi and nginx on RHEL6 > but I cannot seem to get it working on RHEL7. > > I get Internal Server Error in the browser, and this in the uwsgi log: the main thing here beeing: --- no python application fou

[uWSGI] writing to stderr from uwsgi-php

2016-07-19 Thread Damjan Georgievski
I need to debug a php application running in uwsgi, what's the best way to write to stderr from php itself? ps. for some reason I don't get any output from the error_log() function -- damjan ___ uWSGI mailing list uWSGI@lists.unbit.it http://lists.unbi

Re: [uWSGI] Newbie question on uWSGI + web2py on Dreamhost

2016-08-06 Thread Damjan Georgievski
> There is so much information on the uWSGI site, I almost feel ashamed to > ask this question... > > I have a shared account on Dreamhost, and was able to install uWSGI with > the instructions from the uWSGI page. Werkzeug is showing correctly. > > I also downloaded web2py, and uncompressed it (on

Re: [uWSGI] Build plugins with a pip install of uwsgi?

2016-09-09 Thread Damjan Georgievski
On 10 September 2016 at 01:07, Jay Wineinger wrote: > I have installed uwsgi via pip and am trying to use the > stats_pusher_statsd plugin. It does not seem available by default, so I had > to download the source for my version and execute uwsgi --build-plugin to > build it. > > # uwsgi --build-p

Re: [uWSGI] [ANNOUNCE] uWSGI 2.0.14 LTS

2016-10-03 Thread Damjan Georgievski
> In addition to this, i have seen a bunch of blog-posts about the 2.1 > release, or better its non-release :) Yes it is on development by 2 years, > and 2.0 is basically cherry-picking from it. It has lot of interesting > features and removes some of the stupid decisions i made at the start of > t

Re: [uWSGI] PHP plugin security hazard

2017-02-25 Thread Damjan Georgievski
On 25 February 2017 at 01:05, Curtis Maloney wrote: > You probably want to also include in such security advice: I wish, more php applications would work with the `php-app =` option, i.e. they have a single file as entry-point. When I host php apps nowdays I typically look at using the applicait

[uWSGI] Cherokee + uwsgi + django + pep-370

2010-09-13 Thread Damjan Georgievski
This is how I run my django applications in cherokee First the cherokee config is simple, I run a local interpreter (cherokee starts the web app) as user damjan: r...@jeos:~# grep '!11!' /etc/cherokee/cherokee.conf source!11!env_inherited = 0 source!11!host = 127.0.0.1:37116 source!11!interpreter

Re: [uWSGI] uWSGI 0.9.7-dev and Linux cgroups

2010-09-16 Thread Damjan Georgievski
> Documentation available: > > http://projects.unbit.it/uwsgi/wiki/UseCgroups > > Thanks for testing (and abusing) it This is certainly an interesting thing, but maybe in the near future we could be using systemd to start uwsgi instances and set the cgroups. Anyway, from what I've read on LKML re

Re: [uWSGI] [ANNOUNCE] uWSGI 0.9.6.5 with PEP3333 support

2010-09-30 Thread Damjan Georgievski
> uWSGI 0.9.6.5 is available > > http://projects.unbit.it/downloads/uwsgi-0.9.6.5.tar.gz Do you also keep the stable 0.9.6.x versions in mercurial? btw. I'd like to try and implement dynamic .wsgi loading, similar to how uwsgi can now dynamically load .py files based on UWSGI_SCRIPT in the reques

Re: [uWSGI] uwsgiconfig.py python2.7 gcc issue

2010-12-14 Thread Damjan Georgievski
> It looks to me as there are some trouble parsing my german located env. > I don't know If this is an error on arch linux or uwsgi, but maybe it > helps to make uwsgi better. > You can make it compatible to this kind of output and add an unittest > or something for it would be great. ot it can ju

Re: [uWSGI] The uWSGI Emperor mode

2011-01-27 Thread Damjan Georgievski
>> I have (still) not added support for magic vars (%s, %n ...) as i have >> just added them to ini/xml/yaml parsing. So independently from the Emperor >> you can use the following vars in your config files: >> >> %s the filename of the config file >> %o the original string passed to --xml/--yaml/-

Re: [uWSGI] Django app in uwsgi/cherokee under a url prefix

2011-01-27 Thread Damjan Georgievski
>> The error that I'm getting is that Django doesn't generate the links >> corectly. I guess it doesn't get SCRIPT_NAME right. > > It seems that Django is at fault here, I've replaced the Django app with > werkzeug's test_app and SCRIPT_NAME and PATH_INFO are correct, so it seems > Django doesn't h

[uWSGI] Patch to enable building without xml

2011-01-27 Thread Damjan Georgievski
I tried to build with xml = false in the buildconf .ini file. The build failed. Here's a patch to correct that: http://paste.pocoo.org/show/327861/ the noop "if (0) {}" is needed so that the later "else if" statements have a starting "if" when xml is not used -- damjan _

Re: [uWSGI] some comments about the namespaces support

2011-03-08 Thread Damjan Georgievski
>> - first of all, the for(;;) endless loop for starting a namespace is too >> aggressive. If there's any error in the namespaced child, it'll take >> 100% of a cpu. Some kind of backoff would be required here (although >> that comes close to an implementation of an init system) > > The only thing

Re: [uWSGI] New Async stack committed with improved uGreen and greenlet support

2011-03-18 Thread Damjan Georgievski
> Thanks to this new system, uGreen is now less than 80 lines of code, and > support for python greenlet has been added in only 50 lines (!!!). Does this mean that I can now use gevent APIs with uwsgi? -- damjan ___ uWSGI mailing list uWSGI@lists.unbi