--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/564513EF.8050508%40verizon.net.
For more options, visit https://groups.google.com/d/optout.
Setup for Django development system
OS Debian Linux 8 (jessie) using systemd, not init.d
Python 3.4.2
Django 1.8.5
Apache2 2.4.10 Debian (mmm-worker)
mod_wsgi 4.3.0
Postgresql 9.4.5
Two virtual environments: archive (actual project) and mysite (django tutorial). Setup done with python3 -m venv <project name>. There seems to be some variation between this setup and the one using virtualenv. Confusing.
pip3 install mod_wsgi in each environment
Run mod_wsgi-express with install-module and setup-server for each.
In /etc/apache2/envvars the following environmental variables are set.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
In /etc/apache2/apache2.conf the following environmental variables are used to set user and group.
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
But starting from within the project with mod_wsgi-express start-server gives:
WARNING: When running as the 'root' user, it is required that the options '--user' and '--group' be specified to mod_wsgi-express.
Starting with apachectl start or python manage.py runserver give no errors. Both servers work.
Questions:
What user is apache running as if started with apachectl?
What user is apache running as if started with python manage.py runserver?
How do I assure that Apache is running as www-data?
Do I need to start Apache with mod_wsgi-express --user www-data --group www-data or is python manage.py runserver good enough?
Answers to these questions would be very very helpful
Gary R
On Thu, Nov 12, 2015 at 2:34 PM, Gary Roach <gary71...@verizon.net> wrote:
Setup for Django development system
OS Debian Linux 8 (jessie) using systemd, not init.d
Python 3.4.2
Django 1.8.5
Apache2 2.4.10 Debian (mmm-worker)
mod_wsgi 4.3.0
Postgresql 9.4.5
Two virtual environments: archive (actual project) and mysite (django tutorial). Setup done with python3 -m venv <project name>. There seems to be some variation between this setup and the one using virtualenv. Confusing.
Somewhat, yes, although both are effectively the same process. You end up with the same thing either way, though. The 'old' way of installing the virtualenv packages and then creating the virtualenv with external shell commands was integrated natively into Python 3 (ie your python3 -m venv command), hence the confusion.
pip3 install mod_wsgi in each environment
Run mod_wsgi-express with install-module and setup-server for each.
That's interesting, I've never heard of mod_wsgi-express. From a quick google though, it appears it should only be used for testing a mod_wsgi installation, not for production runs. Generally things work the other way around (Apache configured to use the mod_wsgi module as it is needed).
In /etc/apache2/envvars the following environmental variables are set.
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
In /etc/apache2/apache2.conf the following environmental variables are used to set user and group.
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
But starting from within the project with mod_wsgi-express start-server gives:
WARNING: When running as the 'root' user, it is required that the options '--user' and '--group' be specified to mod_wsgi-express.
Starting with apachectl start or python manage.py runserver give no errors. Both servers work.
Questions:
What user is apache running as if started with apachectl?
This tends to be distribution specific. Most often it will be www, or www-data. The serivce user account is generally specified by the service daemon management system configuration scripts for Apache/httpd (Systemd in this case).What user is apache running as if started with python manage.py runserver?
It isn't. The runserver command is running its own bare-bones web server that is built into Python/Django (WEBrick IIRC, or at least it was previously). Only to be used for development, not for production.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2Be%2BciU_fL8tQETwtnv8Xjdw%3DGa7H9_MMipGq94gdg4M51P4VQ%40mail.gmail.com.