Hi again. Well, I found out that one Apache instance can't handle applications with different python interpreters via mod_wsgi.
So, I decided to set up a virtual environment for a web2py instance running python3 applications with its own Apache and mod_wsgi. Since it is virtual environment, I decided if favour of pip instead of the operating system-specific packaging system. Apache+mod_wsgi and the script mod_wsgi-express (refer to http://blog.dscpl.com.au/2015/04/introducing-modwsgi-express.html) makes the process easier: Provided that the web2py for python3 apps is in /opt/web2py3, my steps were roughly: sudo apt-get install python3-pip virtualenvwrapper pip3 install --user --upgrade virtualenvwrapper cd ~/.local/bin mkvirtualenv -p /usr/bin/python3 /opt/python3env/web2py cd /opt/python3env/web2py/bin ./pip3 install mod_wsgi-httpd ./pip3 install mod_wsgi cd /opt/web2py3 /opt/python3env/web2py/bin/mod_wsgi-express \ --user www-data \ --group www-data \ --port 8830 \ --working-directory /opt/web2py3 --server-root /opt/python3env/web2py/etc --log-directory /opt/python3env/web2py/log --access-log --startup-log --rotate-logs start-server wsgihandler.py I will probably use one public IP address for web2py with python2-based apps served by the legacy Apache and a different IP address for python3-based apps served by the Apache from the virtual environment (configured as a bridge on the same network interface), so I can stick to default ports for HTTP and HTTPS, which seems a better solution than proxying from one Apache instance to the other. David On Monday, 11 November 2019 23:42:56 UTC+1, David Zejda wrote: > > Hello to all. > > I have a web2py with several apps on a production server behind Apache > accessed via wsgihandler. So far, all the apps have been developed for > python2. > > To support python3 apps (preferred for new projects), I set-up a separate > web2py directory and adjusted the Apache configs respectively. > > The question is - how to set this new web2py instance to run on python3? > > For compatibility reasons, /usr/bin/env python still translates to python > 2 interpreter. > > Do I have to change all the #!/usr/bin/env python lines in web2py sources > to point to python3 instead? > Or where else can I specify the python version? > > Thank you very much for an answer in advance! > > David > -- 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/a4aff89d-0f78-45f2-a81a-1c3f58179a44%40googlegroups.com.