fixed Issue 1538:Update Script setup-web2py-nginx-uwsgi-centos64.sh, thanks jniltinho

This commit is contained in:
mdipierro committed 2013-06-16 16:59:20 -05:00
1 parent d04f2ff502
commit 19f754704c
2 files changed
+35 -25

No files matched your search

+1 -1
View File
@@ -1 +1 @@
Version 2.5.1-stable+timestamp.2013.06.16.07.20.03
Version 2.5.1-stable+timestamp.2013.06.16.16.58.29
+34 -24
View File
@@ -2,7 +2,7 @@
# Autor: Nilton OS -- www.linuxpro.com.br
echo 'setup-web2py-nginx-uwsgi-centos64.sh'
echo 'Support CentOS 6.4'
echo 'Installs Nginx 1.4 + uWSGI + Web2py'
echo 'Installs Nginx 1.4.1 + uWSGI + Web2py'
# Get Web2py Admin Password
@@ -26,8 +26,8 @@ yum clean all
yum install -y gcc libxml2-devel python-devel python-pip PyXML unzip make sudo
## 64Bits System
## yum install -y http://nginx.org/packages/rhel/6/x86_64/RPMS/nginx-1.4.0-1.el6.ngx.x86_64.rpm
yum install -y http://nginx.org/packages/rhel/6/i386/RPMS/nginx-1.4.0-1.el6.ngx.i386.rpm
## yum install -y http://nginx.org/packages/rhel/6/x86_64/RPMS/nginx-1.4.1-1.el6.ngx.x86_64.rpm
yum install -y http://nginx.org/packages/rhel/6/i386/RPMS/nginx-1.4.1-1.el6.ngx.i386.rpm
pip-python install --upgrade pip
@@ -69,6 +69,10 @@ echo 'server {
include /etc/nginx/uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
### remove the comments if you use uploads (max 10 MB)
#client_max_body_size 10m;
###
}
}
server {
@@ -88,6 +92,10 @@ server {
include /etc/nginx/uwsgi_params;
uwsgi_param UWSGI_SCHEME $scheme;
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
### remove the comments if you use uploads (max 10 MB)
#client_max_body_size 10m;
###
}
}' >/etc/nginx/conf.d/web2py.conf
@@ -96,26 +104,28 @@ sed -i "s/YOUR_SERVER_IP/$SERVER_IP/" /etc/nginx/conf.d/web2py.conf
sed -i "s/YOUR_SERVER_FQDN/$SERVER_FQDN/" /etc/nginx/conf.d/web2py.conf
# Create configuration file /etc/uwsgi/web2py.xml
echo '<uwsgi>
<socket>/var/www/web2py/logs/web2py.socket</socket>
<pythonpath>/var/www/web2py/</pythonpath>
<mount>/=wsgihandler:application</mount>
<master/>
<processes>4</processes>
<harakiri>60</harakiri>
<reload-mercy>8</reload-mercy>
<cpu-affinity>1</cpu-affinity>
<stats>/var/www/web2py/logs/stats.socket</stats>
<max-requests>2000</max-requests>
<limit-as>512</limit-as>
<reload-on-as>256</reload-on-as>
<reload-on-rss>192</reload-on-rss>
<uid>nginx</uid>
<gid>nginx</gid>
<cron>0 0 -1 -1 -1 python /var/www/web2py/web2py.py -Q -S welcome -M -R scripts/sessions2trash.py -A -o</cron>
<no-orphans/>
</uwsgi>' >/etc/uwsgi/web2py.xml
# Create configuration file /etc/uwsgi/web2py.ini
echo '[uwsgi]
socket = /var/www/web2py/logs/%n.socket
pythonpath = /var/www/web2py/
mount = /=wsgihandler:application
processes = 4
master = true
harakiri = 60
reload-mercy = 8
cpu-affinity = 1
stats = /tmp/%n.stats.socket
max-requests = 2000
limit-as = 512
reload-on-as = 256
reload-on-rss = 192
uid = nginx
gid = nginx
cron = 0 0 -1 -1 -1 python /var/www/web2py/web2py.py -Q -S welcome -M -R scripts/sessions2trash.py -A -o
no-orphans = true
chmod-socket = 666
' >/etc/uwsgi/web2py.ini
cd /var/www/
@@ -203,4 +213,4 @@ chkconfig --levels 235 nginx on
## you can reload uwsgi with
#/etc/init.d/uwsgi restart
## to reload web2py only (without restarting uwsgi)
# touch /etc/uwsgi/web2py.xml
# touch /etc/uwsgi/web2py.ini