Hi there,

I'm trying to set up Web2Py in Ubuntu 20.04.01 LTS using the scripts:

https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh

It doesn't work. I've been going through it some details and have almost 
got it working but wanted to (a) check I'm not being an idiot (b) ask about 
a couple of unresolved issues and (c) does this merit a pull request?

# Problem 1:

https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh#L31-34

Python 2 is no longer shipped in 20.04 and --no-build-wheel is deprecated. 
Rather than install it, it makes sense to me to switch this section and use 
the installed Python 3.8. I understand that this makes the script Python 3 
specific, but that seems a sane thing to offer as a script with Ubuntu 20.04

```
apt-get -y install build-essential python3-dev libxml2-dev python-pip3 
unzippip3 install setuptools --no-binary :all: --upgrade
PIPPATH=`which pip3`
$PIPPATH install --upgrade uwsgi
```

# Problem 2:

https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh#L133-136

OpenSSL no longer accepts 1024 bit keys, so this needs to be altered. I 
think these two lines do the same job with a 2048 bit key.

```
openssl req -x509 -nodes -sha256 -days 365 -newkey rsa:2048 -keyout 
web2py.key -out web2py.crt
openssl x509 -noout -text -in web2py.crt -out web2py.info
```

# Problem 3:

https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh#L185

I'm really out on a limb here, but I don't think this is creating the 
services correctly on 20.04, which I think is to do with the removal of 
Upstart (?). If I _manually_ start uwsgi from the command line on my 
server, then I can access the web2py Welcome page:

```
sudo uwsgi --master --die-on-term --emperor /etc/uwsgi --logto 
/var/log/uwsgi/uwsgi.log
```

The script does create a uwsgi service:

https://github.com/web2py/web2py/blob/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh#L144

This doesn't seem to work as expected and I think this is because the 
ExecStart statement isn't correct. If I substitute the ExecStart command 
with the one in the upstart config at line 201 and restart the services, 
then it works. I suspect that makes lines 185 to 202 redundant?

And I think that is it - I get an instance running on Ubuntu 20.04 with:

2.21.1-stable+timestamp.2020.11.28.04.10.44
(Running on nginx/1.18.0, Python 3.8.5)

Thoughts / Comments / Have you never read about this massive security hole 
you've just opened up?

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/6cd2a0ae-af07-4107-9098-579d2f7c2e14n%40googlegroups.com.

Reply via email to