diff --git a/scripts/setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh b/scripts/setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh index 5c13c83d..7042029b 100644 --- a/scripts/setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh +++ b/scripts/setup-ubuntu-12-04-redmine-unicorn-web2py-uwsgi-nginx.sh @@ -453,10 +453,9 @@ cd /home/www-data wget http://web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip rm web2py_src.zip -# Download latest version of sessions2trash.py -wget http://web2py.googlecode.com/hg/scripts/sessions2trash.py -O /home/www-data/web2py/scripts/sessions2trash.py chown -R www-data:www-data web2py cd /home/www-data/web2py +mv handlers/wsgihandler.py wsgihandler.py sudo -u www-data python -c "from gluon.main import save_password; save_password('$PW',443)" /etc/init.d/redmine start start uwsgi-emperor diff --git a/scripts/setup-web2py-fedora-ami.sh b/scripts/setup-web2py-fedora-ami.sh index 48b78a9f..a36fbcc4 100755 --- a/scripts/setup-web2py-fedora-ami.sh +++ b/scripts/setup-web2py-fedora-ami.sh @@ -159,6 +159,7 @@ fi wget http://web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip +mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py chown -R apache:apache web2py ### diff --git a/scripts/setup-web2py-fedora.sh b/scripts/setup-web2py-fedora.sh index 41184d46..801ce8ea 100644 --- a/scripts/setup-web2py-fedora.sh +++ b/scripts/setup-web2py-fedora.sh @@ -159,6 +159,7 @@ fi wget http://web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip +mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py chown -R apache:apache web2py ### diff --git a/scripts/setup-web2py-nginx-uwsgi-centos64.sh b/scripts/setup-web2py-nginx-uwsgi-centos64.sh index bd794282..c6148e4b 100644 --- a/scripts/setup-web2py-nginx-uwsgi-centos64.sh +++ b/scripts/setup-web2py-nginx-uwsgi-centos64.sh @@ -3,53 +3,53 @@ echo 'setup-web2py-nginx-uwsgi-centos64.sh' echo 'Support CentOS 6.4' echo 'Installs Nginx 1.4.1 + uWSGI + Web2py' - - + + # Get Web2py Admin Password echo -e "Web2py Admin Password: \c " read PW - + echo -e "Set Server Name Ex: web2py.domain.com : \c " read SERVER_FQDN - + echo -e "Set Server IP: \c " read SERVER_IP - - + + echo "" >>/etc/hosts echo "$SERVER_IP $SERVER_FQDN" >>/etc/hosts - + yum update -y - + yum install -y http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm 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.1-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.1-1.el6.ngx.i386.rpm - - + + pip-python install --upgrade pip PIPPATH=`which pip` $PIPPATH install --upgrade uwsgi - - + + # Prepare folders for uwsgi mkdir /etc/uwsgi mkdir /var/log/uwsgi mkdir -p /var/www/ - + #usermod -a -G apache nginx mkdir -p /etc/nginx/ssl/ - - + + cd /etc/nginx/ssl openssl genrsa 1024 > web2py.key && chmod 400 web2py.key openssl req -new -x509 -nodes -sha1 -days 1780 -key web2py.key > web2py.crt openssl x509 -noout -fingerprint -text < web2py.crt > web2py.info - - + + echo 'server { listen YOUR_SERVER_IP:80; server_name YOUR_SERVER_FQDN; @@ -97,13 +97,13 @@ server { #client_max_body_size 10m; ### } - + }' >/etc/nginx/conf.d/web2py.conf - + 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.ini echo '[uwsgi] @@ -126,21 +126,21 @@ cron = 0 0 -1 -1 -1 python /var/www/web2py/web2py.py -Q -S welcome -M -R scripts no-orphans = true chmod-socket = 666 ' >/etc/uwsgi/web2py.ini - - + + cd /var/www/ curl --progress -O http://web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip && rm -rf web2py_src.zip # Download latest version of sessions2trash.py -curl --output /var/www/web2py/scripts/sessions2trash.py http://web2py.googlecode.com/hg/scripts/sessions2trash.py +mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py chown -R nginx:nginx web2py cd /var/www/web2py sudo -u nginx python -c "from gluon.main import save_password; save_password('$PW',443)" - - - + + + ## Daemons /start/stop - + echo '#!/bin/sh # Autor: Nilton OS -- www.linuxpro.com.br # @@ -154,27 +154,27 @@ echo '#!/bin/sh # Default-Start: 3 5 # Default-Stop: 0 1 2 6 ### END INIT INFO - + # Source function library. . /etc/rc.d/init.d/functions - + # Check for missing binaries (stale symlinks should not happen) UWSGI_BIN=`which uwsgi` -test -x $UWSGI_BIN || { echo "$UWSGI_BIN not installed"; +test -x $UWSGI_BIN || { echo "$UWSGI_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } - + UWSGI_EMPEROR_MODE=true UWSGI_VASSALS="/etc/uwsgi/" UWSGI_OPTIONS="--enable-threads --logto /var/log/uwsgi/uwsgi.log" lockfile=/var/lock/subsys/uwsgi - + UWSGI_OPTIONS="$UWSGI_OPTIONS --autoload" - + if [ "$UWSGI_EMPEROR_MODE" = "true" ] ; then UWSGI_OPTIONS="$UWSGI_OPTIONS --emperor $UWSGI_VASSALS" fi - + case "$1" in start) echo -n "Starting uWSGI " @@ -198,19 +198,19 @@ case "$1" in ;; esac exit 0 '> /etc/init.d/uwsgi - + chmod +x /etc/init.d/uwsgi - + /etc/init.d/uwsgi start /etc/init.d/nginx start - + /etc/init.d/iptables stop chkconfig --del iptables - + chkconfig --levels 235 uwsgi on 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.ini \ No newline at end of file +# touch /etc/uwsgi/web2py.ini diff --git a/scripts/setup-web2py-nginx-uwsgi-on-centos.sh b/scripts/setup-web2py-nginx-uwsgi-on-centos.sh index 74461aac..9d3c8db3 100644 --- a/scripts/setup-web2py-nginx-uwsgi-on-centos.sh +++ b/scripts/setup-web2py-nginx-uwsgi-on-centos.sh @@ -122,6 +122,7 @@ mkdir ./web-apps cd ./web-apps curl -O http://www.web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip +mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py echo "Set the ownership for web2py application to uwsgi" chown -R uwsgi /opt/web-apps/web2py diff --git a/scripts/setup-web2py-nginx-uwsgi-opensuse.sh b/scripts/setup-web2py-nginx-uwsgi-opensuse.sh index dd9e56dd..128ad2d0 100644 --- a/scripts/setup-web2py-nginx-uwsgi-opensuse.sh +++ b/scripts/setup-web2py-nginx-uwsgi-opensuse.sh @@ -71,7 +71,7 @@ server { uwsgi_param UWSGI_SCHEME $scheme; uwsgi_param SERVER_SOFTWARE nginx/$nginx_version; } - + }' >/etc/nginx/vhosts.d/web2py.conf @@ -102,8 +102,7 @@ cd /srv/www/ wget http://web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip rm web2py_src.zip -# Download latest version of sessions2trash.py -wget http://web2py.googlecode.com/hg/scripts/sessions2trash.py -O /srv/www/web2py/scripts/sessions2trash.py +mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py chown -R nginx:www web2py cd /srv/www/web2py sudo -u nginx python -c "from gluon.main import save_password; save_password('$PW',443)" @@ -137,7 +136,7 @@ echo '#!/bin/sh # Check for missing binaries (stale symlinks should not happen) UWSGI_BIN=/usr/bin/uwsgi -test -x $UWSGI_BIN || { echo "$UWSGI_BIN not installed"; +test -x $UWSGI_BIN || { echo "$UWSGI_BIN not installed"; if [ "$1" = "stop" ]; then exit 0; else exit 5; fi; } @@ -150,13 +149,13 @@ UWSGI_OPTIONS="$UWSGI_OPTIONS --autoload" if [ "$UWSGI_EMPEROR_MODE" = "true" ] ; then UWSGI_OPTIONS="$UWSGI_OPTIONS --emperor $UWSGI_VASSALS" -fi - -. /etc/rc.status - -rc_reset - -case "$1" in +fi + +. /etc/rc.status + +rc_reset + +case "$1" in start) echo -n "Starting uWSGI " /sbin/startproc $UWSGI_BIN $UWSGI_OPTIONS @@ -219,7 +218,7 @@ chmod +x /etc/init.d/uwsgi chkconfig --add uwsgi chkconfig --add nginx - + ## you can reload uwsgi with #/etc/init.d/uwsgi restart ## to reload web2py only (without restarting uwsgi) diff --git a/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh b/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh index 21ec33c2..32c2f61c 100644 --- a/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh +++ b/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh @@ -169,9 +169,8 @@ mkdir /home/www-data cd /home/www-data wget http://web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip +mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py rm web2py_src.zip -# Download latest version of sessions2trash.py -wget http://web2py.googlecode.com/hg/scripts/sessions2trash.py -O /home/www-data/web2py/scripts/sessions2trash.py chown -R www-data:www-data web2py cd /home/www-data/web2py sudo -u www-data python -c "from gluon.main import save_password; save_password('$PW',443)" diff --git a/scripts/setup-web2py-ubuntu.sh b/scripts/setup-web2py-ubuntu.sh index 7a8f4126..b4ef9901 100755 --- a/scripts/setup-web2py-ubuntu.sh +++ b/scripts/setup-web2py-ubuntu.sh @@ -59,6 +59,7 @@ cd www-data rm web2py_src.zip* wget http://web2py.com/examples/static/web2py_src.zip unzip web2py_src.zip +mv web2py/handlers/wsgihandler.py web2py/wsgihandler.py chown -R www-data:www-data web2py echo "setting up apache modules"