From 02fe94acabd76ccb35b10f20534b6ec46f392773 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Tue, 19 Jul 2011 04:17:17 -0400 Subject: remove process=1 option; see http://stackoverflow.com/questions/6703850/cant-get-pyramid-to-work-with-mod-wsgi --- docs/tutorials/modwsgi/index.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index 6e3e4ce37..485eec169 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -102,8 +102,7 @@ commands and files. # play badly with C extensions. WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On - WSGIDaemonProcess pyramid user=chrism group=staff processes=1 \ - threads=4 \ + WSGIDaemonProcess pyramid user=chrism group=staff threads=4 \ python-path=/Users/chrism/modwsgi/env/lib/python2.6/site-packages WSGIScriptAlias /myapp /Users/chrism/modwsgi/env/pyramid.wsgi -- cgit v1.2.3 From cfb2b5596b8ef366aeef3bce5b61eafc7a2f175d Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 6 Oct 2011 03:05:29 -0400 Subject: remove all reference to the paster command-line utility --- docs/tutorials/modwsgi/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index 485eec169..fd6fd5884 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -64,7 +64,7 @@ commands and files. .. code-block:: text $ cd ~/modwsgi/env - $ bin/paster create -t pyramid_starter myapp + $ bin/pcreate -s starter myapp $ cd myapp $ ../bin/python setup.py install -- cgit v1.2.3 From f8869cb0664506204b22aa791003a6d5f8ded58c Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 6 Oct 2011 03:22:35 -0400 Subject: remove stray references to Paste --- docs/tutorials/modwsgi/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index fd6fd5884..c2baa5bd8 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -77,7 +77,7 @@ commands and files. application = get_app( '/Users/chrism/modwsgi/env/myapp/production.ini', 'main') - The first argument to ``get_app`` is the project Paste configuration file + The first argument to ``get_app`` is the project configuration file name. It's best to use the ``production.ini`` file provided by your scaffold, as it contains settings appropriate for production. The second is the name of the section within the .ini file -- cgit v1.2.3 From 49ebfee8804717e9e6d3346eff71a20f34ed6256 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Fri, 11 May 2012 16:45:10 -0400 Subject: add link to explanation --- docs/tutorials/modwsgi/index.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index c2baa5bd8..e070f8eda 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -99,7 +99,8 @@ commands and files. .. code-block:: apache # Use only 1 Python sub-interpreter. Multiple sub-interpreters - # play badly with C extensions. + # play badly with C extensions. See + # http://stackoverflow.com/a/10558360/209039 WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On WSGIDaemonProcess pyramid user=chrism group=staff threads=4 \ -- cgit v1.2.3 From 14f9fe44ec75c055d89374a7852e1ca2af0ff31c Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Wed, 25 Jul 2012 14:02:10 -0500 Subject: add logging call to wsgi setup --- docs/tutorials/modwsgi/index.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index e070f8eda..d11167344 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -73,9 +73,10 @@ commands and files. .. code-block:: python - from pyramid.paster import get_app - application = get_app( - '/Users/chrism/modwsgi/env/myapp/production.ini', 'main') + from pyramid.paster import get_app, setup_logging + ini_path = '/Users/chrism/modwsgi/env/myapp/production.ini' + setup_logging(ini_path) + application = get_app(ini_path, 'main') The first argument to ``get_app`` is the project configuration file name. It's best to use the ``production.ini`` file provided by your @@ -85,6 +86,10 @@ commands and files. ``application`` is important: mod_wsgi requires finding such an assignment when it opens the file. + The call to ``setup_logging`` initializes the standard library's + `logging` module to allow logging within your application. + See :ref:`logging_config`. + #. Make the ``pyramid.wsgi`` script executable. .. code-block:: text -- cgit v1.2.3 From 75633b695b50fa97ccd49be703a1b645f558cf77 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 13 Sep 2012 02:26:53 -0400 Subject: remove chmod --- docs/tutorials/modwsgi/index.rst | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index d11167344..301c6b4ed 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -90,12 +90,7 @@ commands and files. `logging` module to allow logging within your application. See :ref:`logging_config`. -#. Make the ``pyramid.wsgi`` script executable. - - .. code-block:: text - - $ cd ~/modwsgi/env - $ chmod 755 pyramid.wsgi + There is no need to make this script executable. #. Edit your Apache configuration and add some stuff. I happened to create a file named ``/etc/apache2/other/modwsgi.conf`` on my own -- cgit v1.2.3 From b9065f5cbeeccac0d47f6571b28b32d99f09dc9a Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 13 Sep 2012 02:33:25 -0400 Subject: mention non-support of SELinux-enabled systems --- docs/tutorials/modwsgi/index.rst | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index 301c6b4ed..8c1baf518 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -7,12 +7,14 @@ Running a :app:`Pyramid` Application under ``mod_wsgi`` It allows :term:`WSGI` programs to be served using the Apache web server. -This guide will outline broad steps that can be used to get a -:app:`Pyramid` application running under Apache via ``mod_wsgi``. -This particular tutorial was developed under Apple's Mac OS X platform -(Snow Leopard, on a 32-bit Mac), but the instructions should be -largely the same for all systems, delta specific path information for -commands and files. +This guide will outline broad steps that can be used to get a :app:`Pyramid` +application running under Apache via ``mod_wsgi``. This particular tutorial +was developed under Apple's Mac OS X platform (Snow Leopard, on a 32-bit +Mac), but the instructions should be largely the same for all systems, delta +specific path information for commands and files. A caveat: this tutorial +doesn't anticipate use of systems like Fedora and/or Red Hat Enterprise Linux +or other with SELinux enabled by default; those systems will need "special +loving" that are outside the scope of this short tutorial. .. note:: Unfortunately these instructions almost certainly won't work for deploying a :app:`Pyramid` application on a Windows system using @@ -90,7 +92,7 @@ commands and files. `logging` module to allow logging within your application. See :ref:`logging_config`. - There is no need to make this script executable. + There is no need to make the ``pyramid.wsgi`` script executable. #. Edit your Apache configuration and add some stuff. I happened to create a file named ``/etc/apache2/other/modwsgi.conf`` on my own -- cgit v1.2.3 From b262065e9b0805d2fe6245e31295d63bdc3183ef Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 13 Sep 2012 02:46:20 -0400 Subject: hailmary --- docs/tutorials/modwsgi/index.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index 8c1baf518..b08383580 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -93,6 +93,10 @@ loving" that are outside the scope of this short tutorial. See :ref:`logging_config`. There is no need to make the ``pyramid.wsgi`` script executable. + However, you'll need to make sure that *two* users have access to change + into the ``~/modwsgi/env`` directory: your current user (mine is + ``chrism`` and the user that Apache will run as often named ``apache`` or + ``httpd``). Make sure both of these users can "cd" into that directory. #. Edit your Apache configuration and add some stuff. I happened to create a file named ``/etc/apache2/other/modwsgi.conf`` on my own -- cgit v1.2.3 From 8a939c76f43b58c5216eca2428adef9838c50c35 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Thu, 13 Sep 2012 02:54:44 -0400 Subject: remove selinux caveat --- docs/tutorials/modwsgi/index.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index b08383580..a22f12610 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -11,10 +11,7 @@ This guide will outline broad steps that can be used to get a :app:`Pyramid` application running under Apache via ``mod_wsgi``. This particular tutorial was developed under Apple's Mac OS X platform (Snow Leopard, on a 32-bit Mac), but the instructions should be largely the same for all systems, delta -specific path information for commands and files. A caveat: this tutorial -doesn't anticipate use of systems like Fedora and/or Red Hat Enterprise Linux -or other with SELinux enabled by default; those systems will need "special -loving" that are outside the scope of this short tutorial. +specific path information for commands and files. .. note:: Unfortunately these instructions almost certainly won't work for deploying a :app:`Pyramid` application on a Windows system using -- cgit v1.2.3 From f73f0e332658fac2583f51247dcd49bd36d63ce4 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Wed, 13 Mar 2013 23:05:17 +0200 Subject: consistency: use $VENV whenever virtualenv binaries are used --- docs/tutorials/modwsgi/index.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index a22f12610..e0021f8db 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -53,7 +53,7 @@ specific path information for commands and files. .. code-block:: text $ cd ~/modwsgi/env - $ bin/easy_install pyramid + $ $VENV/bin/easy_install pyramid #. Create and install your :app:`Pyramid` application. For the purposes of this tutorial, we'll just be using the ``pyramid_starter`` application as @@ -63,9 +63,9 @@ specific path information for commands and files. .. code-block:: text $ cd ~/modwsgi/env - $ bin/pcreate -s starter myapp + $ $VENV/bin/pcreate -s starter myapp $ cd myapp - $ ../bin/python setup.py install + $ $VENV/bin/python setup.py install #. Within the virtualenv directory (``~/modwsgi/env``), create a script named ``pyramid.wsgi``. Give it these contents: -- cgit v1.2.3 From 2ded59ba248156d92e0f5a8e6c991af93b38384c Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Fri, 16 Aug 2013 01:26:05 -0700 Subject: remove --no-site-packages and add usage note --- docs/tutorials/modwsgi/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index e0021f8db..ddd968927 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -46,7 +46,7 @@ specific path information for commands and files. $ cd ~ $ mkdir modwsgi $ cd modwsgi - $ /usr/local/bin/virtualenv --no-site-packages env + $ /usr/local/bin/virtualenv env #. Install :app:`Pyramid` into the newly created virtualenv: -- cgit v1.2.3 From 3c6d7e587142a884710cc4a41c12c7b26547fc44 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Thu, 7 Apr 2016 15:58:14 -0700 Subject: replace easy_install/setup.py with pip --- docs/tutorials/modwsgi/index.rst | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index ddd968927..1a149b44a 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -1,7 +1,7 @@ .. _modwsgi_tutorial: Running a :app:`Pyramid` Application under ``mod_wsgi`` -========================================================== +======================================================= :term:`mod_wsgi` is an Apache module developed by Graham Dumpleton. It allows :term:`WSGI` programs to be served using the Apache web @@ -30,11 +30,11 @@ specific path information for commands and files. for your platform into your system's Apache installation. #. Install :term:`virtualenv` into the Python which mod_wsgi will - run using the ``easy_install`` program. + run using pip. .. code-block:: text - $ sudo /usr/bin/easy_install-2.6 virtualenv + $ sudo /usr/bin/pip install virtualenv This command may need to be performed as the root user. @@ -53,7 +53,7 @@ specific path information for commands and files. .. code-block:: text $ cd ~/modwsgi/env - $ $VENV/bin/easy_install pyramid + $ $VENV/bin/pip install pyramid #. Create and install your :app:`Pyramid` application. For the purposes of this tutorial, we'll just be using the ``pyramid_starter`` application as @@ -65,7 +65,7 @@ specific path information for commands and files. $ cd ~/modwsgi/env $ $VENV/bin/pcreate -s starter myapp $ cd myapp - $ $VENV/bin/python setup.py install + $ $VENV/bin/pip install -e . #. Within the virtualenv directory (``~/modwsgi/env``), create a script named ``pyramid.wsgi``. Give it these contents: @@ -131,4 +131,3 @@ serve up a :app:`Pyramid` application. See the `mod_wsgi configuration documentation `_ for more in-depth configuration information. - -- cgit v1.2.3 From d67566acebf890a603fad0e9069d5e131dfb5b31 Mon Sep 17 00:00:00 2001 From: Steve Piercy Date: Tue, 12 Apr 2016 06:43:38 -0700 Subject: one does not simply "create a virtualenv". one should "create a virtual environment". - Fixes #2483 --- docs/tutorials/modwsgi/index.rst | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index 1a149b44a..0885a42ab 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -24,21 +24,15 @@ specific path information for commands and files. system. If you do not, install Apache 2.X for your platform in whatever manner makes sense. +#. It is also assumed that you have satisfied the + :ref:`requirements-for-installing-packages`. + #. Once you have Apache installed, install ``mod_wsgi``. Use the (excellent) `installation instructions `_ for your platform into your system's Apache installation. -#. Install :term:`virtualenv` into the Python which mod_wsgi will - run using pip. - - .. code-block:: text - - $ sudo /usr/bin/pip install virtualenv - - This command may need to be performed as the root user. - -#. Create a :term:`virtualenv` which we'll use to install our +#. Create a :term:`virtual environment` which we'll use to install our application. .. code-block:: text @@ -46,9 +40,9 @@ specific path information for commands and files. $ cd ~ $ mkdir modwsgi $ cd modwsgi - $ /usr/local/bin/virtualenv env + $ python3 -m venv env -#. Install :app:`Pyramid` into the newly created virtualenv: +#. Install :app:`Pyramid` into the newly created virtual environment: .. code-block:: text @@ -67,7 +61,7 @@ specific path information for commands and files. $ cd myapp $ $VENV/bin/pip install -e . -#. Within the virtualenv directory (``~/modwsgi/env``), create a +#. Within the virtual environment directory (``~/modwsgi/env``), create a script named ``pyramid.wsgi``. Give it these contents: .. code-block:: python -- cgit v1.2.3 From a4f54c5a7adbee3f37a98498ed41039621c9e549 Mon Sep 17 00:00:00 2001 From: Bert JW Regeer Date: Sun, 10 Apr 2016 20:55:13 -0600 Subject: Replace Python 2.6 with 2.7 --- docs/tutorials/modwsgi/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/tutorials/modwsgi') diff --git a/docs/tutorials/modwsgi/index.rst b/docs/tutorials/modwsgi/index.rst index 0885a42ab..3cc182d13 100644 --- a/docs/tutorials/modwsgi/index.rst +++ b/docs/tutorials/modwsgi/index.rst @@ -101,7 +101,7 @@ specific path information for commands and files. WSGIApplicationGroup %{GLOBAL} WSGIPassAuthorization On WSGIDaemonProcess pyramid user=chrism group=staff threads=4 \ - python-path=/Users/chrism/modwsgi/env/lib/python2.6/site-packages + python-path=/Users/chrism/modwsgi/env/lib/python2.7/site-packages WSGIScriptAlias /myapp /Users/chrism/modwsgi/env/pyramid.wsgi -- cgit v1.2.3