fixed Issue 1538:Update Script setup-web2py-nginx-uwsgi-centos64.sh, thanks jniltinho
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Autor: Nilton OS -- www.linuxpro.com.br
|
# Autor: Nilton OS -- www.linuxpro.com.br
|
||||||
echo 'setup-web2py-nginx-uwsgi-centos64.sh'
|
echo 'setup-web2py-nginx-uwsgi-centos64.sh'
|
||||||
echo 'Support CentOS 6.4'
|
echo 'Support CentOS 6.4'
|
||||||
echo 'Installs Nginx 1.4 + uWSGI + Web2py'
|
echo 'Installs Nginx 1.4.1 + uWSGI + Web2py'
|
||||||
|
|
||||||
|
|
||||||
# Get Web2py Admin Password
|
# 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
|
yum install -y gcc libxml2-devel python-devel python-pip PyXML unzip make sudo
|
||||||
|
|
||||||
## 64Bits System
|
## 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/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.0-1.el6.ngx.i386.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
|
pip-python install --upgrade pip
|
||||||
@@ -69,6 +69,10 @@ echo 'server {
|
|||||||
include /etc/nginx/uwsgi_params;
|
include /etc/nginx/uwsgi_params;
|
||||||
uwsgi_param UWSGI_SCHEME $scheme;
|
uwsgi_param UWSGI_SCHEME $scheme;
|
||||||
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
||||||
|
|
||||||
|
### remove the comments if you use uploads (max 10 MB)
|
||||||
|
#client_max_body_size 10m;
|
||||||
|
###
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
server {
|
server {
|
||||||
@@ -88,6 +92,10 @@ server {
|
|||||||
include /etc/nginx/uwsgi_params;
|
include /etc/nginx/uwsgi_params;
|
||||||
uwsgi_param UWSGI_SCHEME $scheme;
|
uwsgi_param UWSGI_SCHEME $scheme;
|
||||||
uwsgi_param SERVER_SOFTWARE nginx/$nginx_version;
|
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
|
}' >/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
|
sed -i "s/YOUR_SERVER_FQDN/$SERVER_FQDN/" /etc/nginx/conf.d/web2py.conf
|
||||||
|
|
||||||
|
|
||||||
# Create configuration file /etc/uwsgi/web2py.xml
|
# Create configuration file /etc/uwsgi/web2py.ini
|
||||||
echo '<uwsgi>
|
echo '[uwsgi]
|
||||||
<socket>/var/www/web2py/logs/web2py.socket</socket>
|
|
||||||
<pythonpath>/var/www/web2py/</pythonpath>
|
socket = /var/www/web2py/logs/%n.socket
|
||||||
<mount>/=wsgihandler:application</mount>
|
pythonpath = /var/www/web2py/
|
||||||
<master/>
|
mount = /=wsgihandler:application
|
||||||
<processes>4</processes>
|
processes = 4
|
||||||
<harakiri>60</harakiri>
|
master = true
|
||||||
<reload-mercy>8</reload-mercy>
|
harakiri = 60
|
||||||
<cpu-affinity>1</cpu-affinity>
|
reload-mercy = 8
|
||||||
<stats>/var/www/web2py/logs/stats.socket</stats>
|
cpu-affinity = 1
|
||||||
<max-requests>2000</max-requests>
|
stats = /tmp/%n.stats.socket
|
||||||
<limit-as>512</limit-as>
|
max-requests = 2000
|
||||||
<reload-on-as>256</reload-on-as>
|
limit-as = 512
|
||||||
<reload-on-rss>192</reload-on-rss>
|
reload-on-as = 256
|
||||||
<uid>nginx</uid>
|
reload-on-rss = 192
|
||||||
<gid>nginx</gid>
|
uid = nginx
|
||||||
<cron>0 0 -1 -1 -1 python /var/www/web2py/web2py.py -Q -S welcome -M -R scripts/sessions2trash.py -A -o</cron>
|
gid = nginx
|
||||||
<no-orphans/>
|
cron = 0 0 -1 -1 -1 python /var/www/web2py/web2py.py -Q -S welcome -M -R scripts/sessions2trash.py -A -o
|
||||||
</uwsgi>' >/etc/uwsgi/web2py.xml
|
no-orphans = true
|
||||||
|
chmod-socket = 666
|
||||||
|
' >/etc/uwsgi/web2py.ini
|
||||||
|
|
||||||
|
|
||||||
cd /var/www/
|
cd /var/www/
|
||||||
@@ -203,4 +213,4 @@ chkconfig --levels 235 nginx on
|
|||||||
## you can reload uwsgi with
|
## you can reload uwsgi with
|
||||||
#/etc/init.d/uwsgi restart
|
#/etc/init.d/uwsgi restart
|
||||||
## to reload web2py only (without restarting uwsgi)
|
## to reload web2py only (without restarting uwsgi)
|
||||||
# touch /etc/uwsgi/web2py.xml
|
# touch /etc/uwsgi/web2py.ini
|
||||||
Reference in New Issue
Block a user