In the first instance you should ensure things work with a WSGI hello world, no 
Flask framework. This ensures setup with Anaconda Python is okay, which 
sometimes doesn't always work because of stupid things Anaconda Python does 
which breaks the ability to use it in embedded systems.

As to deploying Flask, the Flask documentation has details:

* http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/ 
<http://flask.pocoo.org/docs/0.12/deploying/mod_wsgi/>

Also ensure you read:

* 
http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html 
<http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html>

so you are setting up any Python virtual environment correctly as guides for 
frameworks often don't suggest the preferred method, or simply don't address it.

Graham

> On 7 May 2017, at 8:00 AM, Brian Lehman <[email protected]> wrote:
> 
> Thanks Graham. So everything is installed. Being brand new to this world, I'm 
> looking for a tutorial to (and please forgive me as I'm likely using the 
> wrong terminology) see how to tell Apache to use mod_wsgi to run my flask 
> app. I'm guessing that I need to change some config files in Apache to use my 
> conda environment and then write some .wsgi file? However, I'm seeing quite a 
> few different threads on this subject. Any advice is greatly appreciated.   
> 
> ## get apache2
> sudo apt-get install apache2
> sudo apt-get install apache2-dev
> 
> ## get mod_wsgi
> pip install mod_wsgi
> 
> #force load Anaconda's shared library
> mod_wsgi-express module-config
> 
> ## start/restart apache
> sudo service apache2 restart 
> 
> On Thursday, May 4, 2017 at 4:22:08 PM UTC-6, Graham Dumpleton wrote:
> As per instructions in:
> 
>     https://pypi.python.org/pypi/mod_wsgi 
> <https://pypi.python.org/pypi/mod_wsgi>
> 
> You need to ensure you have the 'dev' packages for Apache installed.
> 
> If you are running Debian or Ubuntu Linux with Apache 2.4 system packages, 
> regardless of which Apache MPM is being used, you would need both:
> 
>     apache2
>     apache2-dev
> 
> Note that if using Anaconda Python, after having installed mod_wsgi with pip, 
> ensure you run:
> 
>     mod_wsgi-express module-config
> 
> to show the configuration you need to include in the system Apache if you 
> intend manually configuring it for mod_wsgi, instead of using 
> 'mod_wsgi-express start-server'.
> 
> This is necessary as Anaconda Python can require extra configuration 
> directives to force load its shared library. That command should output the 
> appropriate lines, although just check that the generated line for LoadFile 
> directive actually points at a valid path. Seen one report where for Anaconda 
> Python the path it generated was wrong and it had to be changed.
> 
> Graham
> 
>> On 5 May 2017, at 2:54 AM, Brian Lehman <the.lehm...@ <>gmail.com 
>> <http://gmail.com/>> wrote:
>> 
>> Good day. When I try to pip install mod_wsgi inside of an anaconda env 
>> called test1.0 on an aws ec2 instance w/ ubuntu, I get the folowing error. 
>> Any suggestions?
>> 
>> (test1.0) ubuntu$ python --version 
>> 
>> Python 3.6.1 :: Continuum Analytics, Inc.
>> 
>> (test1.0) ubuntu$ 
>> 
>> (test1.0) ubuntu$ 
>> 
>> (test1.0) ubuntu$ pip install mod_wsgi
>> 
>> Collecting mod_wsgi
>> 
>>   Using cached mod_wsgi-4.5.15.tar.gz
>> 
>>     Complete output from command python setup.py egg_info:
>> 
>>     Traceback (most recent call last):
>> 
>>       File "<string>", line 1, in <module>
>> 
>>       File "/tmp/pip-build-80walwu3/mod-wsgi/setup.py", line 164, in <module>
>> 
>>         'missing Apache httpd server packages.' % APXS)
>> 
>>     RuntimeError: The 'apxs' command appears not to be installed or is not 
>> executable. Please check the list of prerequisites in the documentation for 
>> this package and install any missing Apache httpd server packages.
>> 
>>     
>>     ----------------------------------------
>> 
>> Command "python setup.py egg_info" failed with error code 1 in 
>> /tmp/pip-build-80walwu3/mod-wsgi/
>> 
>> 
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "modwsgi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to modwsgi+u...@ <>googlegroups.com <http://googlegroups.com/>.
>> To post to this group, send email to mod...@ <>googlegroups.com 
>> <http://googlegroups.com/>.
>> Visit this group at https://groups.google.com/group/modwsgi 
>> <https://groups.google.com/group/modwsgi>.
>> For more options, visit https://groups.google.com/d/optout 
>> <https://groups.google.com/d/optout>.
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] 
> <mailto:[email protected]>.
> To post to this group, send email to [email protected] 
> <mailto:[email protected]>.
> Visit this group at https://groups.google.com/group/modwsgi 
> <https://groups.google.com/group/modwsgi>.
> For more options, visit https://groups.google.com/d/optout 
> <https://groups.google.com/d/optout>.

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to