> On 4 Jun 2017, at 4:50 AM, Vishnu Prasad <[email protected]> wrote:
> 
> I download mod_wsgi and ran python setup.py install. As per your suggestion, 
> am moving away from simple httpserver to Flask enabled one. 
> 
> I get following on running module-config
> LoadFile "/Users/vph/anaconda/lib/libpython3.6m.dylib"
> LoadModule wsgi_module 
> "/Users/vph/anaconda/lib/python3.6/site-packages/mod_wsgi-4.5.16-py3.6-macosx-10.7-x86_64.egg/mod_wsgi/server/mod_wsgi-py36.cpython-36m-darwin.so"
> WSGIPythonHome "/Users/vph/anaconda"
> 
> I got the following on running install-module
>  sudo mod_wsgi-express install-module
> LoadFile "/Users/vph/anaconda/lib/libpython3.6m.dylib"
> LoadModule wsgi_module 
> "/usr/libexec/apache2/mod_wsgi-py36.cpython-36m-darwin.so"
> WSGIPythonHome "/Users/vph/anaconda"

You do not need to do both of these, you only do one.

In both cases you need to copy the output and put it in your Apache config file.

> My apache2 httpd.conf is :
> LoadModule wsgi_module 
> "/usr/libexec/apache2/mod_wsgi-py36.cpython-36m-darwin.so"
> 

In other words, this is incomplete, as you didn't copy the LoadFile and 
WSGIPythonHome directives in the Apache configuration.

Note that the order is important and must be done as shown.

If you are on MacOS X, I am not even sure how running mod_wsgi-express 
install-module even worked.

MacOS X System Integrity Protection (SIP), unless they changed it in Sierra, 
prohibits you from install extra Apache modules into the system Apache modules 
directory.

Thus on MacOS X, you must use the mod_wsgi-express module-config method as the 
install-module method would usually fail.


> 
> If I start mod_wsgi, get following.
> Server URL         : http://localhost:8000/ <http://localhost:8000/>
> Server Root        : /tmp/mod_wsgi-localhost:8000:501
> Server Conf        : /tmp/mod_wsgi-localhost:8000:501/httpd.conf
> Error Log File     : /tmp/mod_wsgi-localhost:8000:501/error_log (warn)
> Request Capacity   : 5 (1 process * 5 threads)
> Request Timeout    : 60 (seconds)
> Startup Timeout    : 15 (seconds)
> Queue Backlog      : 100 (connections)
> Queue Timeout      : 45 (seconds)
> Server Capacity    : 20 (event/worker), 20 (prefork)
> Server Backlog     : 500 (connections)
> Locale Setting     : en_US.UTF-8

Just remember that you don't need to worry about mod_wsgi-express start-server 
if you are going to manually configure the system Apache and use it alone.

You could still use mod_wsgi-express start-server for development, but not for 
permanent running of the site if setting up system Apache to do it.

> 
> However, when I run sudo apachectl configtest, get following which suggests 
> something wrong. 
> httpd: Syntax error on line 172 of /private/etc/apache2/httpd.conf: Cannot 
> load /usr/libexec/apache2/mod_wsgi-py36.cpython-36m-darwin.so into server: 
> dlopen(/usr/libexec/apache2/mod_wsgi-py36.cpython-36m-darwin.so, 10): Library 
> not loaded: @rpath/libpython3.6m.dylib\n  Referenced from: 
> /usr/libexec/apache2/mod_wsgi-py36.cpython-36m-darwin.so\n  Reason: image not 
> found
> 
> How do I fix this ? I am using default apache2 coming with os, command for 
> apachectl -V gives following:
> Server version: Apache/2.4.16 (Unix)
> Server built:   Jul 22 2015 21:03:09
> Server's Module Magic Number: 20120211:47
> Server loaded:  APR 1.4.8, APR-UTIL 1.5.2
> Compiled using: APR 1.4.8, APR-UTIL 1.5.2
> Architecture:   64-bit
> Server MPM:     prefork
>   threaded:     no
>     forked:     yes (variable process count)
> Server compiled with....
>  -D APR_HAS_SENDFILE
>  -D APR_HAS_MMAP
>  -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
>  -D APR_USE_FLOCK_SERIALIZE
>  -D APR_USE_PTHREAD_SERIALIZE
>  -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
>  -D APR_HAS_OTHER_CHILD
>  -D AP_HAVE_RELIABLE_PIPED_LOGS
>  -D DYNAMIC_MODULE_LIMIT=256
>  -D HTTPD_ROOT="/usr"
>  -D SUEXEC_BIN="/usr/bin/suexec"
>  -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
>  -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
>  -D DEFAULT_ERRORLOG="logs/error_log"
>  -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
>  -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"
> 
> 
>  python -V
> Python 3.6.1 :: Anaconda 4.4.0 (x86_64)
> Please do help, am stuck.
> 
> 
> 
> 
> 
> 
> 
> 
> -- 
> 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