Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-02-07 Thread dederocks
AWSOME! Thank you so much for the fix and explanation! Best regards, Andre Le jeudi 7 février 2013 10:11:19 UTC+1, Roberto De Ioris a écrit : > > > > Hello, > > > > I have setup nginx & uwsgi on lubuntu with the script and it works great > > (best server ever!), except for a part of my applica

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-02-07 Thread Roberto De Ioris
> Hello, > > I have setup nginx & uwsgi on lubuntu with the script and it works great > (best server ever!), except for a part of my application that requires > multi threads. I have changed the /etc/uwsgi/web2py.xml to enable threads, > tried to set each worker with 2 threads, set the thread memo

[web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-02-07 Thread dederocks
Hello, I have setup nginx & uwsgi on lubuntu with the script and it works great (best server ever!), except for a part of my application that requires multi threads. I have changed the /etc/uwsgi/web2py.xml to enable threads, tried to set each worker with 2 threads, set the thread memory stack

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-26 Thread Niphlod
disk cache is shared among processes, so no problem there. uwsgi should use os.fork() to spawn a new process, so modules are definitively cached. Didn't test with cache.ram (but if you want I may test it) because I use redis as cache in production. cache.ram will be "erased" when a "forced"

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-26 Thread Arnon Marcus
Here is a cool episode about virtualisation architecture design: https://www.youtube.com/watch?v=Kiftbm1L_eQ&list=PL3EFBFBCE1249ABC0 On Fri, Jan 25, 2013 at 1:17 PM, Arnon Marcus wrote: > Well, the way I currently understand this, is as follows: > Web2py uses execfile for most of it's work (mo

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Arnon Marcus
Well, the way I currently understand this, is as follows: Web2py uses execfile for most of it's work (models, controllers and views), so no reload() is needed in production whenever a file get's modified. The flip-side of this, is that there can be no cache in these module-files. Then the ram/disk

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Paolo valleri
I am using memcached for caching cache.ram and cache.disk, the configuration is really easy, this is mine: if not request.is_local: from gluon.contrib.memcache import MemcacheClient memcache_servers = ['127.0.0.1:11211'] cache.memcache = MemcacheClient(request, memcache_servers) ca

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Arnon Marcus
Oh, and what about memcache? Can web2py benefit from it? Is there somewhere an explanation about this? On Fri, Jan 25, 2013 at 12:48 PM, Arnon Marcus wrote: > 10x for clearing things out - you're right, I didn't do too much resource > on uwsgi, and just assumed that it is, for nginx. what mod_w

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Arnon Marcus
10x for clearing things out - you're right, I didn't do too much resource on uwsgi, and just assumed that it is, for nginx. what mod_wsgi is for apache. So I guess I had it wrong. My current (soon to be "old") setup is running apache + mod_wsgi on windows 7, so I know all about the headaches that c

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Niphlod
seems you missed a point uwsgi here is not a module, is an executable that does one job and it does it well (actually, very well, and there's a lot of it that can be used that is outside the scope of this script). It could be used as a standalone highperformance webserver, but nginx is plac

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Arnon Marcus
My second question, was basically to get a vibe for the pros/cons of this hybrid setup vs. the plain and pure vanilla setup that this script probably generates. On Fri, Jan 25, 2013 at 12:08 PM, Arnon Marcus wrote: > Yeah, I already know that, I was asking something else: > You can have a hybri

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Arnon Marcus
Yeah, I already know that, I was asking something else: You can have a hybrid setup of Apache +nginx, where nginx is hosting apache as a reverse-proxy. According to what I read, this kind of setup is very common, especially for php servers, as the php processing that apache operates is single-thre

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Richard Vézina
The only benefit I see nginx over apache from my reading, is that nginx memory usage and cpu usage will not grow that much even if you add massive number of users since "Nginx is event-based it doesn't need to spawn new processes or threads for each request, so its memory usage is very low" http:/

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Arnon Marcus
Is there a benefit for using nginx as rps for apache? What are the pros/cons for such an arrangement over uwsgi ? On Fri, Jan 25, 2013 at 4:36 AM, Arnon Marcus wrote: > I am deploying on VMs that are relatively easy to clone, so I opted for > separate servers for redmine and web2py, for perform

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-25 Thread Arnon Marcus
I am deploying on VMs that are relatively easy to clone, so I opted for separate servers for redmine and web2py, for performance and security. I obviously also separated the database to be on its own server. Since it's all VMs on the same physical machine, the virtual-network is really fast, and si

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-24 Thread Richard Vézina
I will look at Niphold changes and update my script when I get time. I have no intention to port the w2p-redmine script to CentOS. I would not put redmine and web2py on 2 differents servers, I would put all the web app on one server (one html server) and the database on an other server. But that is

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-24 Thread Arnon Marcus
Great to see this coming along ! Few questions: 1. Would it be moduralized enough to separate the redmine and web2py parts? 2. if not, can I use it on 2 servers, and then remove redmine in one and web2py on the other? 3. Does this supports older web2py versions (say, 1.8) ? 4. Can somebody port

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-24 Thread Niphlod
ok, made it more modular, and now web2py config for uwsgi is in ini-style (far more readable). If you come from previous script, before executing this please delete /etc/uwsgi/web2py.xml . the new /etc/uwsgi/web2py.ini will be created with the exact same options. thanks Paolo, patch attached.

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-23 Thread paolo.vall...@gmail.com
yep, I've added it under the location / and it worked. You are right it might be placed in the main configuration, on the other hand today at work I was blocked because unable to upload files greaten than 1M. From my point of view we should at least mention it. For what concerns gzip is that on ubu

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-23 Thread niphlod
uhm. this is outside the scope of the location I mean... probably you'd like to turn on gzip too, but that is a feature to enable on nginx "main" conf, not in the "web2py" one Anyway, did you put this setting inside the file /etc/nginx/sites-available/web2py and it just works ok ? 2013/

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-23 Thread paolo.vall...@gmail.com
In the meanwhile I discovered that if you upload a file greater than 1M, I tried with a 1.5M, you will get a 413 error. In order to avoid this error for file not so big, I suggest you to add the directive *client_max_body_size *and to set it at something more 'common' for me few MB is already ok. s

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-23 Thread Niphlod
ok, I'll test it more @home and then add a commented section to the script PS: that site you posted . turn off response.optimize_js = 'inline' pleeease :P On Wednesday, January 23, 2013 11:19:34 AM UTC+1, Paolo valleri wrote: > > Just tested, it works, I've already upgraded the production se

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-23 Thread paolo.vall...@gmail.com
Just tested, it works, I've already upgraded the production server too :-P I would suggest to add it (maybe as a comment) to the script. Thanks, Paolo 2013/1/22 Niphlod > maybe I have a fix . > Can you please test it ? > assuming an example of routes.py like > > myapp = dict(languages=['en', 'i

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-22 Thread Niphlod
maybe I have a fix . Can you please test it ? assuming an example of routes.py like myapp = dict(languages=['en', 'it', 'jp'], default_language='en') this means that navigating to: /myapp/ --> the static files will be referenced as web2py_home/applications/myapp/en/static/whatever.css /myapp/

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-22 Thread paolo.vall...@gmail.com
Hi Niphlod, once I discovered that making a symbolic link for each language in the app directory pointing to the app directory worked well. Namely something like that app_dir/it ---> app_dir . However it would be better to find something cleaner but for that I have to look at nginx but right now I

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-22 Thread Niphlod
got it. can you post the routes.py you're using ? The problem lies in the fact that routes.py is really flexible and adapting that logic using only rewrite or alias statements in nginx is cumbersome. Standing on one feet (i.e. without tests) I'd say that the regex checking static files

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-22 Thread paolo.vall...@gmail.com
Hi Massimo, for example, if I visit this traffic.integreen-life.bz.it/default/wiki/about (default is the controller and wiki is the function) it works while traffic.integreen-life.bz.it/it/default/wiki/about the application works very well but the static links do not. Paolo 2013/1/22 Massimo Di

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-22 Thread Massimo Di Pierro
can you show an example? On Tuesday, 22 January 2013 07:36:39 UTC-6, Paolo valleri wrote: > > Hi all, I've just discovered that the regex used to retrieve the static > files doesn't work if I use languages abbreviation in urls. > How can we fix this? > > > > 2012/12/28 Richard Vézina > > >> Hello

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2013-01-22 Thread paolo.vall...@gmail.com
Hi all, I've just discovered that the regex used to retrieve the static files doesn't work if I use languages abbreviation in urls. How can we fix this? 2012/12/28 Richard Vézina > Hello, > > I publish a new script that allow deployment of Redmine beside web2py. > > Here : > https://groups.goo

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-28 Thread Richard Vézina
Hello, I publish a new script that allow deployment of Redmine beside web2py. Here : https://groups.google.com/forum/?fromgroups=#!searchin/web2py/redmine/web2py/ZqL7Si8Khbo/Es-wK1yXdgQJ Notice : After some read, I choose Unicorn over Phussion Passenger. Richard On Thu, Dec 20, 2012 at 9:57 A

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-20 Thread Massimo Di Pierro
please email me the patch of latest file when ready for inclusion. On Thursday, 20 December 2012 03:18:20 UTC-6, Niphlod wrote: > > perfect, Ccing Massimo on this final one. > > Il giorno giovedì 20 dicembre 2012 00:16:25 UTC+1, Paolo ha scritto: >> >> Hi >> I was trying with the script that comes

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-20 Thread Niphlod
perfect, Ccing Massimo on this final one. Il giorno giovedì 20 dicembre 2012 00:16:25 UTC+1, Paolo ha scritto: > > Hi > I was trying with the script that comes with the stable web2py. with the > one on dropbox I problem has gone. > > Paolo > > > 2012/12/19 Niphlod > > >> >> @Simone, an other im

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-19 Thread paolo.vall...@gmail.com
Hi I was trying with the script that comes with the stable web2py. with the one on dropbox I problem has gone. Paolo 2012/12/19 Niphlod > > @Simone, an other improvement to the script could be to combine into a >> single server the 80, and 443 to avoid duplicating configuration, as stated >> h

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-19 Thread Richard Vézina
Agree... Richard On Wed, Dec 19, 2012 at 2:59 PM, Niphlod wrote: > ry the script found at the dropbox link. If the same error happens I th --

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-19 Thread Niphlod
> @Simone, an other improvement to the script could be to combine into a > single server the 80, and 443 to avoid duplicating configuration, as stated > here : > > http://nginx.org/en/docs/http/configuring_https_servers.html#single_http_https_server > I don't had test this. > > Also, here the c

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-19 Thread Richard Vézina
@Paolo, I don't see dist-upgrade anymore you should have a wrong version look at the drop box of Simone Niphold : https://www.dropbox.com/s/n7chteos9sh6p2h/setup-web2py-nginx-uwsgi-ubuntu.sh @Arnon, I don't know bitnami I heard about, but didn't have a look, but I guest it will not works because u

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-19 Thread Paolo
Hi all, I've just tried to run the script on a VM (ubuntu 12.04.1). The compilation of uwsgi failed: *** uWSGI linking *** gcc -pthread -o /usr/local/bin/uwsgi core/utils.o core/protocol.o core/socket.o core/logging.o core/master.o core/master_utils.o core/emperor.o core/notify.o core/mule.o

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-18 Thread Arnon Marcus
Hey guys, I'm also using web2py and redmine, and was concidering moving it into a linux-based VM and running it with nginx. Good to know your on it. Keep up the good work - I'm a neub in linux-land... Couple of questions: 1. Are you using postgreSQL in this thing? 2. How can one replicate your a

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-18 Thread Richard Vézina
I will, when I finish my research. I am planning to write a slice about deployment of Redmine beside Web2py with Nginx. So until I finish my Nginx config in case I found other tweaks, I wait for testing the script again. But I have a fresh VM in place that I can clone rapidly to for testing purpos

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-18 Thread Niphlod
At this point I did a bit of research. https://github.com/ioerror/duraconf/blob/master/configs/nginx/nginx.conf updated the script to reflect those, but I can't test it. Can you please ? --

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-17 Thread Richard Vézina
Hello Simone Here some improvement : *The following is an example configuration, to reduce the CPU load it is recommended to run one worker process only and to enable keep-alive connections:* *worker_processes 1;*http

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-17 Thread Richard Vézina
I am not sure, the only thing that I know is that Nginx is not showing up until I stop and restart it. Maybe it was needing a reload as you said at last... Richard On Fri, Dec 14, 2012 at 3:01 PM, Niphlod wrote: > tly with the install and this line is the culprit ? --

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-14 Thread Niphlod
uhm, in my tests worked (and that line comes from the old script). After you install nginx it is started automatically, so "restart" is a good choice. However, let's not take it for granted and investigate. doing cat /etc/init.d/nginx in 12.10 we can find restart|force-reload) echo

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-14 Thread Richard Vézina
Hello Simone, As I told you just try the script with a fresh VM. I notice that, the server were not accessible after the script executed. I had to stop both uwsgi and nginx and restart them, then the welcome show up. I think that the last line is erroneous... I replace : /etc/init.d/nginx restar

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Niphlod
fixed in PM. uwsgi wasn't installed on Richard's VM because pip path was reported incorrectly at the first installation (meaning that pip install --upgrade pip worked ok but the next pip install --upgrade pip was not finding pip binary). Fixed that, script is now running ok even in 12.10. @Pao

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Niphlod
ok, wait a second, I'll try with my VM. the previous traceback is due to the changes done to the certificate generation: I took them for granted but there must be an error somewhere. On Wednesday, December 12, 2012 7:48:54 PM UTC+1, Richard wrote: > > uwsgi doesn't seem to start, I have not log

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Richard Vézina
uwsgi doesn't seem to start, I have not log for it in /var/log/uwsgi/ Try to start it like that : /etc/init$ sudo start uwsgi-emperor start: Job failed to start Richard On Wed, Dec 12, 2012 at 1:27 PM, Richard Vézina wrote: > Here error log : > > cat /var/log/nginx/error.log > 2012/12/12 13:

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Richard Vézina
Here error log : cat /var/log/nginx/error.log 2012/12/12 13:12:40 [emerg] 17676#0: SSL_CTX_use_certificate_chain_file("/etc/nginx/ssl/web2py.crt") failed (SSL: error:02001002:system library:fopen:No such file or directory error:20074002:BIO routines:FILE_CTRL:system lib error:140DC002:SSL routine

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Richard Vézina
502 Bad Gateway Under 12.10 Richard On Wed, Dec 12, 2012 at 12:53 PM, Richard Vézina < ml.richard.vez...@gmail.com> wrote: > I am testing it right now, waiting the VM finish to install :) > > Richard > > > On Wed, Dec 12, 2012 at 12:48 PM, Niphlod wrote: > >> @Richard: fixed. Can you test if t

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Richard Vézina
I am testing it right now, waiting the VM finish to install :) Richard On Wed, Dec 12, 2012 at 12:48 PM, Niphlod wrote: > @Richard: fixed. Can you test if this is the behaviour that you want ? > > @Paolo: thanks for the pointer, fixed. > > @Massimo: I "released" the script here to test it befor

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Niphlod
@Richard: fixed. Can you test if this is the behaviour that you want ? @Paolo: thanks for the pointer, fixed. @Massimo: I "released" the script here to test it before sending the patch to you just because of these small hiccups here and there. This could definitely become the default installati

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Massimo Di Pierro
Email me a patch of send me a pull request if this works and you feel should be included On Wednesday, 12 December 2012 09:30:24 UTC-6, Richard wrote: > > Didn't test it, but I take the SSL creation commands from > setup-web2py-ubuntu.sh that ask for location and owner of certificat that I > li

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Richard Vézina
Didn't test it, but I take the SSL creation commands from setup-web2py-ubuntu.sh that ask for location and owner of certificat that I like better and adapt them for the setup-web2py-nginx-uwsgi-ubuntu.sh script in order to make these script more homogen. Here the part I change ln -s /etc/nginx/si

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Paolo
I've just tested, you should use " with != something like that seems to work if [ "$UID" != "0" ]; then... Paolo On Wednesday, December 12, 2012 12:48:33 PM UTC+1, Niphlod wrote: > > Updated. don't have a shell lying around, could you try it ? > > --

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Niphlod
Updated. don't have a shell lying around, could you try it ? --

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread paolo.vall...@gmail.com
yeap :) 2012/12/12 Niphlod > meaning checking if the script is run as root ? > > Il giorno mercoledì 12 dicembre 2012 11:06:42 UTC+1, Paolo ha scritto: >> >> sorry, one more thing, what about checking if you have the permission to >> install stuff and so on? >> >> >> 2012/12/12 Niphlod >> >> m

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Niphlod
meaning checking if the script is run as root ? Il giorno mercoledì 12 dicembre 2012 11:06:42 UTC+1, Paolo ha scritto: > > sorry, one more thing, what about checking if you have the permission to > install stuff and so on? > > > 2012/12/12 Niphlod > > >> mee too, didn't notice in the cut-paste ma

Re: [web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread paolo.vall...@gmail.com
sorry, one more thing, what about checking if you have the permission to install stuff and so on? 2012/12/12 Niphlod > mee too, didn't notice in the cut-paste madness. > > > On Wednesday, December 12, 2012 9:57:06 AM UTC+1, Paolo wrote: >> >> Hi and great job! >> >> One thing that I don't like

[web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Niphlod
mee too, didn't notice in the cut-paste madness. On Wednesday, December 12, 2012 9:57:06 AM UTC+1, Paolo wrote: > > Hi and great job! > > One thing that I don't like is at line 10 > apt-get -y dist-upgrade > > this was also in the previous version, actually I see this too > restrictive, for examp

[web2py] Re: new setup-web2py-nginx-uwsgi-ubuntu.sh

2012-12-12 Thread Paolo
Hi and great job! One thing that I don't like is at line 10 apt-get -y dist-upgrade this was also in the previous version, actually I see this too restrictive, for example I have ubuntu 12.04 and don't want to move to 12.10 Paolo On Wednesday, December 12, 2012 12:06:16 AM UTC+1, Niphlod wrot