Re: [modwsgi] Really strange problem with passing SSL headers in from Apache

2017-11-14 Thread O haya
Ahh.  Ok.  I was still getting confused about the header names I had been 
trying to add and thought I had to somehow pass the environ into the Flask 
app, so I was going crazy trying to figure out how to do that.  

request.environ.get() works fine now in my Flask app :)!

Jim




On Tuesday, November 14, 2017 at 2:41:50 PM UTC-5, Graham Dumpleton wrote:
>
>
> On 15 Nov 2017, at 3:33 am, O haya <jim...@gmail.com > wrote:
>
> Ahh.  Ok, understood about the header names.
>
> I think that your environ.wsgi is Python, ultimately, we would want the:
>
> WSGIScriptAlias / /apps/flaskapps/helloflask/wsgi-scripts/environ.wsgi
>
> in the httpd-vhosts VirtualHost to point to a Flask app.  
>
>
> Flask is also a Python app. :-)
>
> In that case, do we have to do something in the .wsgi that the 
> WSGIScriptAlias is pointing to to pass any of the SSL_ headers to the Flask 
> app to make them available to the Flask app code?
>
> Or, does that happen automatically, and if so , how do we reference such 
> SSL_ header values from inside the Flask app?
>
>
> The contents of the environ dictionary are available in Flask as as 
> 'request.environ'. It is a normal Python dictionary. Just look the values 
> up in it.
>
> Graham
>
> I realize/guess that some of those questions may be a little off-topic 
> from pure "mod_wsgi" questions, but I hope that you can answer them.
>
> Thanks!
>
> Jim
>
> On Tuesday, November 14, 2017 at 4:02:58 AM UTC-5, Graham Dumpleton wrote:
>>
>> That is expected behaviour. Any headers using anything other than alpha 
>> numerics and dashes are thrown away.
>>
>> This is because to do otherwise opens up security issues, because 
>> multiple possible header keys could map to the same key name as anything 
>> except alpha numerics are mapped to underscores. A user could use this fact 
>> to send a X_SSL-CIPHER1 header which would map to same name as you are 
>> trying to use. If the user one overrides yours, then could be an issue.
>>
>> For that reason, any good web server, Apache and nginx included, now 
>> discards headers using anything other than alpha numerics and dashes when 
>> creating CGI like environ, such as occurs with WSGI. There is a CERT 
>> advisory about the problem somewhere.
>>
>> So don't use underscores in header names. Also try and use all the SSL_ 
>> values that are already passed in when:
>>
>> SSLOptions +StdEnvVars
>>
>> is used.
>>
>> On 14 Nov 2017, at 7:44 pm, O haya <jim...@gmail.com> wrote:
>>
>> Hi,
>>
>> Using your environ.wsgi, if I have:
>>
>> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
>>
>> RequestHeader set X-SSL-CIPHER1 "%{SSL_CLIENT_S_DN}s"
>> RequestHeader set X-SSL-CIPHER2 "%{SSL_CLIENT_I_DN}s"
>> RequestHeader set X-SSL-CIPHER3 "%{SSL_CLIENT_CERT}s"
>>
>> The headers with "X_SSL_" I get are:
>>
>> HTTP_X_SSL_CIPHER: 
>> HTTP_X_SSL_CIPHER1:
>> HTTP_X_SSL_CIPHER2:
>> HTTP_X_SSL_CIPHER3:
>>
>> [Notice the header names have underscores whereas the header name I had 
>> in the httpd-vhosts.conf had dashes ("-").
>>
>>
>> If I have:
>>
>> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
>>
>> RequestHeader set X-SSL-CLIENT_S_DN "%{SSL_CLIENT_S_DN}s"
>>  RequestHeader set X-SSL_CLIENT_I_DN "%{SSL_CLIENT_I_DN}s"
>>
>>
>> The only headers with "X_SSL_" I get are:
>>
>> HTTP_X_SSL_CIPHER: 
>> HTTP_X_SSL_PROTOCOL:
>>
>> Here is the full output:
>>
>> PID: 5271
>> UID: 502
>> GID: 500
>> CWD: /apps/flaskapps/helloflask/wsgi-scripts
>>
>> STDOUT: 
>> STDERR: 
>> ERRORS: 
>>
>> python.version: '3.6.3 (default, Nov  9 2017, 19:17:20) \n[GCC 4.4.7 
>> 20120313 (Red Hat 4.4.7-17)]'
>> python.prefix: '/apps/python-3.6.3'
>> python.path: ['/apps/flaskapps/helloflask/wsgi-scripts', 
>> '/apps/python-3.6.3/lib/python36.zip', '/apps/python-3.6.3/lib/python3.6', 
>> '/apps/python-3.6.3/lib/python3.6/lib-dynload', 
>> '/apps/python-3.6.3/lib/python3.6/site-packages', 
>> '/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi-4.5.20-py3.6-linux-x86_64.egg']
>>
>> apache.version: (2, 2, 29)
>> mod_wsgi.version: (4, 5, 20)
>>
>> mod_wsgi.process_group: webtool
>> mod_wsgi.application_group: 
>>
>> mod_wsgi.maximum_processes: 1
>> mod_wsgi.threads_per_process: 5
>> mod_wsgi.process_metrics: {'pid': 5271, 

Re: [modwsgi] Really strange problem with passing SSL headers in from Apache

2017-11-14 Thread O haya
Ahh.  Ok, understood about the header names.

I think that your environ.wsgi is Python, ultimately, we would want the:

WSGIScriptAlias / /apps/flaskapps/helloflask/wsgi-scripts/environ.wsgi

in the httpd-vhosts VirtualHost to point to a Flask app.  

In that case, do we have to do something in the .wsgi that the 
WSGIScriptAlias is pointing to to pass any of the SSL_ headers to the Flask 
app to make them available to the Flask app code?

Or, does that happen automatically, and if so , how do we reference such 
SSL_ header values from inside the Flask app?

I realize/guess that some of those questions may be a little off-topic from 
pure "mod_wsgi" questions, but I hope that you can answer them.

Thanks!

Jim

On Tuesday, November 14, 2017 at 4:02:58 AM UTC-5, Graham Dumpleton wrote:
>
> That is expected behaviour. Any headers using anything other than alpha 
> numerics and dashes are thrown away.
>
> This is because to do otherwise opens up security issues, because multiple 
> possible header keys could map to the same key name as anything except 
> alpha numerics are mapped to underscores. A user could use this fact to 
> send a X_SSL-CIPHER1 header which would map to same name as you are trying 
> to use. If the user one overrides yours, then could be an issue.
>
> For that reason, any good web server, Apache and nginx included, now 
> discards headers using anything other than alpha numerics and dashes when 
> creating CGI like environ, such as occurs with WSGI. There is a CERT 
> advisory about the problem somewhere.
>
> So don't use underscores in header names. Also try and use all the SSL_ 
> values that are already passed in when:
>
> SSLOptions +StdEnvVars
>
> is used.
>
> On 14 Nov 2017, at 7:44 pm, O haya <jim...@gmail.com > wrote:
>
> Hi,
>
> Using your environ.wsgi, if I have:
>
> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
>
> RequestHeader set X-SSL-CIPHER1 "%{SSL_CLIENT_S_DN}s"
> RequestHeader set X-SSL-CIPHER2 "%{SSL_CLIENT_I_DN}s"
> RequestHeader set X-SSL-CIPHER3 "%{SSL_CLIENT_CERT}s"
>
> The headers with "X_SSL_" I get are:
>
> HTTP_X_SSL_CIPHER: 
> HTTP_X_SSL_CIPHER1:
> HTTP_X_SSL_CIPHER2:
> HTTP_X_SSL_CIPHER3:
>
> [Notice the header names have underscores whereas the header name I had in 
> the httpd-vhosts.conf had dashes ("-").
>
>
> If I have:
>
> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
>
> RequestHeader set X-SSL-CLIENT_S_DN "%{SSL_CLIENT_S_DN}s"
>  RequestHeader set X-SSL_CLIENT_I_DN "%{SSL_CLIENT_I_DN}s"
>
>
> The only headers with "X_SSL_" I get are:
>
> HTTP_X_SSL_CIPHER: 
> HTTP_X_SSL_PROTOCOL:
>
> Here is the full output:
>
> PID: 5271
> UID: 502
> GID: 500
> CWD: /apps/flaskapps/helloflask/wsgi-scripts
>
> STDOUT: 
> STDERR: 
> ERRORS: 
>
> python.version: '3.6.3 (default, Nov  9 2017, 19:17:20) \n[GCC 4.4.7 
> 20120313 (Red Hat 4.4.7-17)]'
> python.prefix: '/apps/python-3.6.3'
> python.path: ['/apps/flaskapps/helloflask/wsgi-scripts', 
> '/apps/python-3.6.3/lib/python36.zip', '/apps/python-3.6.3/lib/python3.6', 
> '/apps/python-3.6.3/lib/python3.6/lib-dynload', 
> '/apps/python-3.6.3/lib/python3.6/site-packages', 
> '/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi-4.5.20-py3.6-linux-x86_64.egg']
>
> apache.version: (2, 2, 29)
> mod_wsgi.version: (4, 5, 20)
>
> mod_wsgi.process_group: webtool
> mod_wsgi.application_group: 
>
> mod_wsgi.maximum_processes: 1
> mod_wsgi.threads_per_process: 5
> mod_wsgi.process_metrics: {'pid': 5271, 'request_count': 0, 
> 'request_busy_time': 0.006062, 'memory_max_rss': 10698752, 'memory_rss': 
> 10702848, 'cpu_user_time': 0.01999552965164, 'cpu_system_time': 0.0, 
> 'restart_time': 1510648086.068054, 'current_time': 1510648090.617293, 
> 'running_time': 4, 'request_threads': 1, 'active_requests': 1, 'threads': 
> [{'thread_id': 1, 'request_count': 1}]}
> mod_wsgi.server_metrics: None
>
> apache.description: Apache/2.2.29 (Unix) mod_ssl/2.2.29 
> OpenSSL/1.0.1e-fips DAV/2 mod_wsgi/4.5.20 Python/3.6
> apache.build_date: Nov  9 2017 19:12:16
> apache.mpm_name: Prefork
> apache.maximum_processes: 256
> apache.threads_per_process: 1
>
> PATH: ['/apps/flaskapps/helloflask/wsgi-scripts', 
> '/apps/python-3.6.3/lib/python36.zip', '/apps/python-3.6.3/lib/python3.6', 
> '/apps/python-3.6.3/lib/python3.6/lib-dynload', 
> '/apps/python-3.6.3/lib/python3.6/site-packages', 
> '/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi-4.5.20-py3.6-linux-x86_64.egg']
>
> LANG: en_US.UTF-8
> LC_ALL: None
> sys.getdefaultencoding(): utf-8
> sys.getfilesystemen

Re: [modwsgi] Really strange problem with passing SSL headers in from Apache

2017-11-14 Thread O haya
SL_SECURE_RENEG: 'true'
SSL_SERVER_A_KEY: 'rsaEncryption'
SSL_SERVER_A_SIG: 'sha256WithRSAEncryption'
SSL_SERVER_CERT: '-BEGIN 
CERTIFICATE-\nMIIDijCCAnKgAwIBAgIGAV+opXRrMA0GCSqGSIb3DQEBCwUAMEkxCzAJBgNVBAYT.
.
.
.
\nwaGkjK2v4bAib8jakrudJfWBdFURfYbiYMzYw8pj5NHuJ8sl25V1n09bLv1aTw==\n-END 
CERTIFICATE-\n'
SSL_SERVER_I_DN: '/C=US/O=simplecao/OU=simplecaou/CN=simpleca'
SSL_SERVER_I_DN_C: 'US'
SSL_SERVER_I_DN_CN: 'simpleca'
SSL_SERVER_I_DN_O: 'simplecao'
SSL_SERVER_I_DN_OU: 'simplecaou'
SSL_SERVER_M_SERIAL: '015FA8A5746B'
SSL_SERVER_M_VERSION: '3'
SSL_SERVER_S_DN: '/C=US/CN=apache2.whatever.com'
SSL_SERVER_S_DN_C: 'US'
SSL_SERVER_S_DN_CN: 'apache2.whatever.com'
SSL_SERVER_V_END: 'May 24 01:15:38 2021 GMT'
SSL_SERVER_V_START: 'Nov 11 01:15:36 2017 GMT'
SSL_TLS_SNI: 'apache3.whatever.com'
SSL_VERSION_INTERFACE: 'mod_ssl/2.2.29'
SSL_VERSION_LIBRARY: 'OpenSSL/1.0.1e-fips'
UNIQUE_ID: 'WgqpGsCoApAAABSaB4AC'
apache.version: (2, 2, 29)
mod_wsgi.application_group: ''
mod_wsgi.callable_object: 'application'
mod_wsgi.daemon_connects: '1'
mod_wsgi.daemon_restarts: '0'
mod_wsgi.daemon_start: '1510648090610672'
mod_wsgi.enable_sendfile: '0'
mod_wsgi.handler_script: ''
mod_wsgi.ignore_activity: '0'
mod_wsgi.listener_host: ''
mod_wsgi.listener_port: '8443'
mod_wsgi.path_info: '/'
mod_wsgi.process_group: 'webtool'
mod_wsgi.queue_start: '1510648090610136'
mod_wsgi.request_handler: 'wsgi-script'
mod_wsgi.request_start: '1510648090609673'
mod_wsgi.script_name: ''
mod_wsgi.script_reloading: '1'
mod_wsgi.script_start: '1510648090616973'
mod_wsgi.thread_id: 1
mod_wsgi.thread_requests: 0
mod_wsgi.total_requests: 0
mod_wsgi.version: (4, 5, 20)
wsgi.errors: <_io.TextIOWrapper name='' encoding='utf-8'>
wsgi.file_wrapper: 
wsgi.input: 
wsgi.multiprocess: False
wsgi.multithread: True
wsgi.run_once: False
wsgi.url_scheme: 'https'
wsgi.version: (1, 0)

CVS_RSH: 'ssh'
G_BROKEN_FILENAMES: '1'
HISTCONTROL: 'ignoredups'
HISTSIZE: '1000'
HOME: '/home/oracle'
HOSTNAME: 'apache3.whatever.com'
LANG: 'en_US.UTF-8'
LD_LIBRARY_PATH: '/apps/httpd-2.2.29/lib'
LESSOPEN: '||/usr/bin/lesspipe.sh %s'
LOGNAME: 'oracle'
LS_COLORS: 
'rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:'
MAIL: '/var/spool/mail/oracle'
PATH: 
'/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin'
PWD: '/apps/flaskapps/helloflask/wsgi-scripts'
QTDIR: '/usr/lib64/qt-3.3'
QTINC: '/usr/lib64/qt-3.3/include'
QTLIB: '/usr/lib64/qt-3.3/lib'
SHELL: '/bin/bash'
SHLVL: '2'
SSH_ASKPASS: '/usr/libexec/openssh/gnome-ssh-askpass'
TERM: 'xterm'
USER: 'oracle'
_: '/apps/httpd-2.2.29/bin/httpd'


So it seems like mod_wsgi is passing the default headers but my app/code 
wasn't retrieving them correctly in my Flask app, but I am still not clear 
why the RequestHeaders directives don't seem to be working correctly in all 
cases?





On Saturday, November 11, 2017 at 3:39:40 PM UTC-5, Graham Dumpleton wrote:
>
> Can you use the test program at:
>
> https://github.com/GrahamDumpleton/mod_wsgi/blob/develop/tests/environ.wsgi
>
> behind your configuration and provide what it responds with back in the 
> browser.
>
> Change any values you think may be sensitive. It will be mainly the keys 
> rather than values am interested in.
>
> Graham
>
> On 12 Nov 2017, at 1:31 am, O haya <jim...@gmail.com > wrote:
>
> Hi Graham,
>
> FYI, I am going to be in-transit to another location in a bit, so I will 
> be slow to respond probably until tomorrow.
>
>
> On Saturday, November 11, 2017 at 9:21:26 AM UTC-5, O haya wrote:
>>
>> Hi,
>>
>> I already have the SSLOptions +StdEnvVars in the virtualhost and was not 
>> seeing the SSL_ headers.  That was why I 

Re: [modwsgi] Really strange problem with passing SSL headers in from Apache

2017-11-11 Thread O haya
Hi,

I already have the SSLOptions +StdEnvVars in the virtualhost and was not 
seeing the SSL_ headers.  That was why I started trying to add the 
RequestHeaders.

Thanks,
Jim

On Saturday, November 11, 2017 at 4:05:08 AM UTC-5, Graham Dumpleton wrote:
>
> Why fiddle with RequestHeader and using headers. The directive:
>
> SSLOptions +StdEnvVars
>
> should result in them being passed through in the WSGI environ dictionary 
> already.
>
> Graham
> 
>
> On 11 Nov 2017, at 4:03 pm, O haya <jim...@gmail.com > wrote:
>
> Hi,
>
> I built mod_wsgi using Python 3.6.3 and also with Apache 2.2.29.  The 
> Apache is configured for client-authenticated SSL, and I am trying to 
> configure Apache to pass some of the SSL_ variables to a small test Flask 
> application and I am having difficulty getting this working.
>
> Here is the VirtualHost:
>
> 
> Servername apache.whatever.com
> .
> .
> .
>
>
> WSGIDaemonProcess webtool user=myuser group=mygroup threads=5 
> home=/apps/flaskapps/helloflask/wsgi-scripts
> WSGIScriptAlias / /apps/flaskapps/helloflask/wsgi-scripts/webtool.wsgi
>
> # From: 
> https://stackoverflow.com/questions/20940651/how-to-access-apache-basic-authentication-user-in-flask
> #WSGIPassAuthorization On
>
> RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
> RequestHeader set X-SSL-CIPHER1 "%{SSL_CLIENT_S_DN}s"
> RequestHeader set X-SSL-CIPHER2 "%{SSL_CLIENT_I_DN}s"
> RequestHeader set X-SSL-CIPHER3 "%{SSL_CLIENT_CERT}s"
> #RequestHeader set X-SSL-CLIENT_S_DN "%{SSL_CLIENT_S_DN}s"
> #RequestHeader add X-SSL_CLIENT_S_DN "%{SSL_CLIENT_S_DN}e"
> #RequestHeader add X-MYSSL_CLIENT_S_DN 
> "fooo"
> # RequestHeader set X-SSL_CLIENT_I_DN "%{SSL_CLIENT_I_DN}e"
> # RequestHeader set X-SSL_SERVER_S_DN_OU "%{SSL_SERVER_S_DN_OU}e"
> # RequestHeader set X-SSL_CLIENT_VERIFY "%{SSL_CLIENT_VERIFY}e"
> # RequestHeader set X-SSL_CLIENT_CERT "%{SSL_CLIENT_CERT}e"
>
> 
> WSGIProcessGroup webtool
>
> SSLOptions +StdEnvVars +ExportCertData
>
> WSGIApplicationGroup %{GLOBAL}
> WSGIScriptReloading On
> Order allow,deny
> Allow from all
> 
>
> Note the bunch of RequestHeader directives.
>
> I originally started with only the 1st two:
>
> RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
>
> And that worked, i.e., my test Flask app was able to see those headers, 
> and dumped out those values.
>
> Then, I added a third one:
>
> RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
> RequestHeader set X-SSL-CLIENT_S_DN "%{SSL_CLIENT_S_DN}s"
>
> And bounced the Apache and tested, but I still only saw the first two 
> headers :(...
>
> I added the others that you see that are commented out, but still only saw 
> the first two headers in Flask.
>
> So, just on a whim, I tried copying the 2nd one, but changing the header 
> name slightly.
>
> RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
> RequestHeader set X-SSL-CIPHER1 "%{SSL_CLIENT_S_DN}s"
>
> And when I tested, I saw all 3 headers in Flask.
>
> So I tried changing the name of the third header:
>
> RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
> RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
> RequestHeader set X-SSL-CIPHER1_CLIENT_S_DN "%{SSL_CLIENT_S_DN}s"
>
> And then I saw only the first two headers in Flask.
>
> Change the third header name back to X-SSL-CIPHER1 and tested again, and 
> saw 3 headers.
>
> I don't understand why this is happening.  It seems like there is 
> something "special" about the header name in the RequestHeader that is 
> preventing the Apache sending any other header names?
>
> Any ideas why this might be the case?  I have worked with Apache for 
> awhile, and with RequestHeader in the past, and I don't recall anything 
> like this.
>
> Thanks,
> Jim
>
>
> -- 
> 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 .
> To post to this group, send email to mod...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/modwsgi.
> For more options, visit 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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] Really strange problem with passing SSL headers in from Apache

2017-11-10 Thread O haya
Hi,

I built mod_wsgi using Python 3.6.3 and also with Apache 2.2.29.  The 
Apache is configured for client-authenticated SSL, and I am trying to 
configure Apache to pass some of the SSL_ variables to a small test Flask 
application and I am having difficulty getting this working.

Here is the VirtualHost:


Servername apache.whatever.com
.
.
.


WSGIDaemonProcess webtool user=myuser group=mygroup threads=5 
home=/apps/flaskapps/helloflask/wsgi-scripts
WSGIScriptAlias / /apps/flaskapps/helloflask/wsgi-scripts/webtool.wsgi

# From: 
https://stackoverflow.com/questions/20940651/how-to-access-apache-basic-authentication-user-in-flask
#WSGIPassAuthorization On

RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
RequestHeader set X-SSL-CIPHER1 "%{SSL_CLIENT_S_DN}s"
RequestHeader set X-SSL-CIPHER2 "%{SSL_CLIENT_I_DN}s"
RequestHeader set X-SSL-CIPHER3 "%{SSL_CLIENT_CERT}s"
#RequestHeader set X-SSL-CLIENT_S_DN "%{SSL_CLIENT_S_DN}s"
#RequestHeader add X-SSL_CLIENT_S_DN "%{SSL_CLIENT_S_DN}e"
#RequestHeader add X-MYSSL_CLIENT_S_DN 
"fooo"
# RequestHeader set X-SSL_CLIENT_I_DN "%{SSL_CLIENT_I_DN}e"
# RequestHeader set X-SSL_SERVER_S_DN_OU "%{SSL_SERVER_S_DN_OU}e"
# RequestHeader set X-SSL_CLIENT_VERIFY "%{SSL_CLIENT_VERIFY}e"
# RequestHeader set X-SSL_CLIENT_CERT "%{SSL_CLIENT_CERT}e"


WSGIProcessGroup webtool

SSLOptions +StdEnvVars +ExportCertData

WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading On
Order allow,deny
Allow from all


Note the bunch of RequestHeader directives.

I originally started with only the 1st two:

RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"

And that worked, i.e., my test Flask app was able to see those headers, and 
dumped out those values.

Then, I added a third one:

RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
RequestHeader set X-SSL-CLIENT_S_DN "%{SSL_CLIENT_S_DN}s"

And bounced the Apache and tested, but I still only saw the first two 
headers :(...

I added the others that you see that are commented out, but still only saw 
the first two headers in Flask.

So, just on a whim, I tried copying the 2nd one, but changing the header 
name slightly.

RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
RequestHeader set X-SSL-CIPHER1 "%{SSL_CLIENT_S_DN}s"

And when I tested, I saw all 3 headers in Flask.

So I tried changing the name of the third header:

RequestHeader set X-SSL-PROTOCOL "%{SSL_PROTOCOL}s"
RequestHeader set X-SSL-CIPHER "%{SSL_CIPHER}s"
RequestHeader set X-SSL-CIPHER1_CLIENT_S_DN "%{SSL_CLIENT_S_DN}s"

And then I saw only the first two headers in Flask.

Change the third header name back to X-SSL-CIPHER1 and tested again, and 
saw 3 headers.

I don't understand why this is happening.  It seems like there is something 
"special" about the header name in the RequestHeader that is preventing the 
Apache sending any other header names?

Any ideas why this might be the case?  I have worked with Apache for 
awhile, and with RequestHeader in the past, and I don't recall anything 
like this.

Thanks,
Jim

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-09 Thread O haya
Oops - I have one more question:  I think that in the attempt just made, I 
had re-built the Apache and used the "--enable-shared" on the Apache 
configure.  Is that (using --enable-shared) necessary when building the 
Apache, in order for the mod_wsgi to work with the Apache?  I have to try 
later tonight, but just was wondering if you knew the answer to that?

The reason for this question is I am pretty sure they don't use 
"--enable-shared" when they build our Apaches.

Thanks for ALL of your help!

Jim

On Thursday, November 9, 2017 at 6:35:34 AM UTC-5, O haya wrote:
>
> Cool!  Worked!
>
> On Wednesday, November 8, 2017 at 7:04:46 PM UTC-5, Graham Dumpleton wrote:
>>
>> Running 'python setup.py install' with APXS environment variable set 
>> should also work.
>>
>> On 9 Nov 2017, at 11:03 am, O haya <jim...@gmail.com> wrote:
>>
>> YES!!  That did it and I was able to start Apache 2.4.29 after I added:
>>
>> LoadModule wsgi_module 
>> "/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
>>
>> to the httpd.conf, and this was even without needing to export 
>> LD_LIBRARY_PATH!
>>
>>
>> Now that I was able to do that, do you think that if I had exported the 
>> APXS that I could've used:
>>
>> python3.6 setup.py install
>>
>> instead of the "pip3.6 install mod_wsgi"?
>>
>> The reason I ask is that, at work, I don't think I'll be able to use 
>> pip3.6 since it looks like it needs to connect out.
>>
>> Thanks!
>>
>> Jim
>>
>>
>>
>> On Wednesday, November 8, 2017 at 6:38:40 PM UTC-5, Graham Dumpleton 
>> wrote:
>>>
>>>
>>> On 9 Nov 2017, at 10:37 am, O haya <jim...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I got this when I ran that:
>>>
>>> export AXPS=/apps/httpd-2.4.29/bin/apxs
>>>
>>> pip3.6 install --no-cache-dir mod_wsgi
>>> Requirement already satisfied: mod_wsgi in 
>>> /apps/python-3.6.3/lib/python3.6/site-packages
>>>
>>>
>>> Run:
>>>
>>> pip uninstall mod_wsgi
>>>
>>> first, or use:
>>>
>>> pip3.6 install --no-cache-dir --update mod_wsgi
>>>
>>>
>>>
>>> On Wednesday, November 8, 2017 at 6:10:12 AM UTC-5, Graham Dumpleton 
>>> wrote:
>>>>
>>>> Do not use code.google.com site for docs. The docs can be found by 
>>>> going to www.modwsgi.org.
>>>>
>>>> For creating a working Python installation read:
>>>>
>>>> 
>>>> http://blog.dscpl.com.au/2015/06/installing-custom-python-version-into.html
>>>>
>>>> Ignore that it talks about Docker. Information still relevant.
>>>>
>>>> Your 'ap_accept_lock_mech' issue is then likely due to using the wrong 
>>>> apxs program for the Apache install you want to use.
>>>>
>>>> Find the 'apxs' program for the Apache you want to use and then run 
>>>> 'pip' as:
>>>>
>>>> APXS=/some/path/apxs pip install --no-cache-dir mod_wsgi 
>>>>
>>>> You likely have a broken mod_wsgi compiled version cached and need for 
>>>> it to be skipped.
>>>>
>>>> Graham
>>>>
>>>> On 8 Nov 2017, at 5:17 pm, O haya <jim...@gmail.com> wrote:
>>>>
>>>> Oh oh, problem :(
>>>>
>>>> I added:
>>>>
>>>> LoadModule wsgi_module 
>>>> "/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>>>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
>>>>
>>>> to the new Apache 2.4.29 httpd.conf and then tried to start the Apache 
>>>> and I think that I am back to the same error from before:
>>>>
>>>> [oracle@apache1 bin]$ /apps/httpd-2.4.29/bin/apachectl start
>>>> httpd: Syntax error on line 168 of /apps/httpd-2.4.29/conf/httpd.conf: 
>>>> Cannot load /apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>>>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so into server: 
>>>> /apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>>>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so: undefined symbol: 
>>>> ap_accept_lock_mech
>>>>
>>>>
>>>> :(  ???
>>>>
>>>> Jim
>>>>
>>>>
>>>>
>&

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-09 Thread O haya
Cool!  Worked!

On Wednesday, November 8, 2017 at 7:04:46 PM UTC-5, Graham Dumpleton wrote:
>
> Running 'python setup.py install' with APXS environment variable set 
> should also work.
>
> On 9 Nov 2017, at 11:03 am, O haya <jim...@gmail.com > wrote:
>
> YES!!  That did it and I was able to start Apache 2.4.29 after I added:
>
> LoadModule wsgi_module 
> "/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
>
> to the httpd.conf, and this was even without needing to export 
> LD_LIBRARY_PATH!
>
>
> Now that I was able to do that, do you think that if I had exported the 
> APXS that I could've used:
>
> python3.6 setup.py install
>
> instead of the "pip3.6 install mod_wsgi"?
>
> The reason I ask is that, at work, I don't think I'll be able to use 
> pip3.6 since it looks like it needs to connect out.
>
> Thanks!
>
> Jim
>
>
>
> On Wednesday, November 8, 2017 at 6:38:40 PM UTC-5, Graham Dumpleton wrote:
>>
>>
>> On 9 Nov 2017, at 10:37 am, O haya <jim...@gmail.com> wrote:
>>
>> Hi,
>>
>> I got this when I ran that:
>>
>> export AXPS=/apps/httpd-2.4.29/bin/apxs
>>
>> pip3.6 install --no-cache-dir mod_wsgi
>> Requirement already satisfied: mod_wsgi in 
>> /apps/python-3.6.3/lib/python3.6/site-packages
>>
>>
>> Run:
>>
>> pip uninstall mod_wsgi
>>
>> first, or use:
>>
>> pip3.6 install --no-cache-dir --update mod_wsgi
>>
>>
>>
>> On Wednesday, November 8, 2017 at 6:10:12 AM UTC-5, Graham Dumpleton 
>> wrote:
>>>
>>> Do not use code.google.com site for docs. The docs can be found by 
>>> going to www.modwsgi.org.
>>>
>>> For creating a working Python installation read:
>>>
>>> 
>>> http://blog.dscpl.com.au/2015/06/installing-custom-python-version-into.html
>>>
>>> Ignore that it talks about Docker. Information still relevant.
>>>
>>> Your 'ap_accept_lock_mech' issue is then likely due to using the wrong 
>>> apxs program for the Apache install you want to use.
>>>
>>> Find the 'apxs' program for the Apache you want to use and then run 
>>> 'pip' as:
>>>
>>> APXS=/some/path/apxs pip install --no-cache-dir mod_wsgi 
>>>
>>> You likely have a broken mod_wsgi compiled version cached and need for 
>>> it to be skipped.
>>>
>>> Graham
>>>
>>> On 8 Nov 2017, at 5:17 pm, O haya <jim...@gmail.com> wrote:
>>>
>>> Oh oh, problem :(
>>>
>>> I added:
>>>
>>> LoadModule wsgi_module 
>>> "/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
>>>
>>> to the new Apache 2.4.29 httpd.conf and then tried to start the Apache 
>>> and I think that I am back to the same error from before:
>>>
>>> [oracle@apache1 bin]$ /apps/httpd-2.4.29/bin/apachectl start
>>> httpd: Syntax error on line 168 of /apps/httpd-2.4.29/conf/httpd.conf: 
>>> Cannot load /apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so into server: 
>>> /apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so: undefined symbol: 
>>> ap_accept_lock_mech
>>>
>>>
>>> :(  ???
>>>
>>> Jim
>>>
>>>
>>>
>>>
>>> On Wednesday, November 8, 2017 at 1:08:53 AM UTC-5, O haya wrote:
>>>>
>>>> Ok, I am re-reading your page:
>>>>
>>>> https://code.google.com/archive/p/modwsgi/wikis/InstallationIssues.wiki
>>>>
>>>> When I read before, I couldn't find any "config" directory under my new 
>>>> python dir, but I think that you mean this directory?
>>>>
>>>> [root@apache1 config-3.6m-x86_64-linux-gnu]# pwd
>>>> /apps/python-3.6.3/lib/python3.6/config-3.6m-x86_64-linux-gnu
>>>> [root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
>>>> total 15644
>>>> drwxr-xr-x  2 root root 4096 Nov  8 00:43 .
>>>> drwxr-xr-x 35 root root 4096 Nov  8 00:33 ..
>>>> -rw-r--r--  1 root root 3302 Nov  8 00:33 config.c
>>>> -rw-r--r--  1 root root 1621 Nov  8 00:33 config.c.in
>>>> -rwxr-xr-x  1 root root 7122 Nov  8 00:33 install-sh
>

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-08 Thread O haya
YES!!  That did it and I was able to start Apache 2.4.29 after I added:

LoadModule wsgi_module 
"/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"

to the httpd.conf, and this was even without needing to export 
LD_LIBRARY_PATH!


Now that I was able to do that, do you think that if I had exported the 
APXS that I could've used:

python3.6 setup.py install

instead of the "pip3.6 install mod_wsgi"?

The reason I ask is that, at work, I don't think I'll be able to use pip3.6 
since it looks like it needs to connect out.

Thanks!

Jim



On Wednesday, November 8, 2017 at 6:38:40 PM UTC-5, Graham Dumpleton wrote:
>
>
> On 9 Nov 2017, at 10:37 am, O haya <jim...@gmail.com > wrote:
>
> Hi,
>
> I got this when I ran that:
>
> export AXPS=/apps/httpd-2.4.29/bin/apxs
>
> pip3.6 install --no-cache-dir mod_wsgi
> Requirement already satisfied: mod_wsgi in 
> /apps/python-3.6.3/lib/python3.6/site-packages
>
>
> Run:
>
> pip uninstall mod_wsgi
>
> first, or use:
>
> pip3.6 install --no-cache-dir --update mod_wsgi
>
>
>
> On Wednesday, November 8, 2017 at 6:10:12 AM UTC-5, Graham Dumpleton wrote:
>>
>> Do not use code.google.com site for docs. The docs can be found by going 
>> to www.modwsgi.org.
>>
>> For creating a working Python installation read:
>>
>> 
>> http://blog.dscpl.com.au/2015/06/installing-custom-python-version-into.html
>>
>> Ignore that it talks about Docker. Information still relevant.
>>
>> Your 'ap_accept_lock_mech' issue is then likely due to using the wrong 
>> apxs program for the Apache install you want to use.
>>
>> Find the 'apxs' program for the Apache you want to use and then run 'pip' 
>> as:
>>
>>     APXS=/some/path/apxs pip install --no-cache-dir mod_wsgi 
>>
>> You likely have a broken mod_wsgi compiled version cached and need for it 
>> to be skipped.
>>
>> Graham
>>
>> On 8 Nov 2017, at 5:17 pm, O haya <jim...@gmail.com> wrote:
>>
>> Oh oh, problem :(
>>
>> I added:
>>
>> LoadModule wsgi_module 
>> "/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
>>
>> to the new Apache 2.4.29 httpd.conf and then tried to start the Apache 
>> and I think that I am back to the same error from before:
>>
>> [oracle@apache1 bin]$ /apps/httpd-2.4.29/bin/apachectl start
>> httpd: Syntax error on line 168 of /apps/httpd-2.4.29/conf/httpd.conf: 
>> Cannot load /apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so into server: 
>> /apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
>> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so: undefined symbol: 
>> ap_accept_lock_mech
>>
>>
>> :(  ???
>>
>> Jim
>>
>>
>>
>>
>> On Wednesday, November 8, 2017 at 1:08:53 AM UTC-5, O haya wrote:
>>>
>>> Ok, I am re-reading your page:
>>>
>>> https://code.google.com/archive/p/modwsgi/wikis/InstallationIssues.wiki
>>>
>>> When I read before, I couldn't find any "config" directory under my new 
>>> python dir, but I think that you mean this directory?
>>>
>>> [root@apache1 config-3.6m-x86_64-linux-gnu]# pwd
>>> /apps/python-3.6.3/lib/python3.6/config-3.6m-x86_64-linux-gnu
>>> [root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
>>> total 15644
>>> drwxr-xr-x  2 root root 4096 Nov  8 00:43 .
>>> drwxr-xr-x 35 root root 4096 Nov  8 00:33 ..
>>> -rw-r--r--  1 root root 3302 Nov  8 00:33 config.c
>>> -rw-r--r--  1 root root 1621 Nov  8 00:33 config.c.in
>>> -rwxr-xr-x  1 root root 7122 Nov  8 00:33 install-sh
>>> -rw-r--r--  1 root root 15874060 Nov  8 00:33 libpython3.6m.a
>>> lrwxrwxrwx  1 root root   19 Nov  8 00:43 libpython3.so -> 
>>> ../../libpython3.so
>>> -rw-r--r--  1 root root67977 Nov  8 00:33 Makefile
>>> -rwxr-xr-x  1 root root 7521 Nov  8 00:33 makesetup
>>> -rwxr-xr-x  1 root root 2050 Nov  8 00:33 python-config.py
>>> -rw-r--r--  1 root root10096 Nov  8 00:33 python.o
>>> -rw-r--r--  1 root root15322 Nov  8 00:33 Setup
>>> -rw-r--r--  1 root root  327 Nov  8 00:33 Setup.config
>>> -rw-r--r--  1 root root   41 Nov  8 00:33 Setup.local
>>>
>>> So I re-built Python 3.6.3, with the "--enable-shared" and I think I 
>>> figured out 

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-08 Thread O haya
Hi,

I got this when I ran that:

export AXPS=/apps/httpd-2.4.29/bin/apxs

pip3.6 install --no-cache-dir mod_wsgi
Requirement already satisfied: mod_wsgi in 
/apps/python-3.6.3/lib/python3.6/site-packages



On Wednesday, November 8, 2017 at 6:10:12 AM UTC-5, Graham Dumpleton wrote:
>
> Do not use code.google.com site for docs. The docs can be found by going 
> to www.modwsgi.org.
>
> For creating a working Python installation read:
>
> 
> http://blog.dscpl.com.au/2015/06/installing-custom-python-version-into.html
>
> Ignore that it talks about Docker. Information still relevant.
>
> Your 'ap_accept_lock_mech' issue is then likely due to using the wrong 
> apxs program for the Apache install you want to use.
>
> Find the 'apxs' program for the Apache you want to use and then run 'pip' 
> as:
>
> APXS=/some/path/apxs pip install --no-cache-dir mod_wsgi 
>
> You likely have a broken mod_wsgi compiled version cached and need for it 
> to be skipped.
>
> Graham
>
> On 8 Nov 2017, at 5:17 pm, O haya <jim...@gmail.com > wrote:
>
> Oh oh, problem :(
>
> I added:
>
> LoadModule wsgi_module 
> "/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"
>
> to the new Apache 2.4.29 httpd.conf and then tried to start the Apache and 
> I think that I am back to the same error from before:
>
> [oracle@apache1 bin]$ /apps/httpd-2.4.29/bin/apachectl start
> httpd: Syntax error on line 168 of /apps/httpd-2.4.29/conf/httpd.conf: 
> Cannot load /apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so into server: 
> /apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/
> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so: undefined symbol: 
> ap_accept_lock_mech
>
>
> :(  ???
>
> Jim
>
>
>
>
> On Wednesday, November 8, 2017 at 1:08:53 AM UTC-5, O haya wrote:
>>
>> Ok, I am re-reading your page:
>>
>> https://code.google.com/archive/p/modwsgi/wikis/InstallationIssues.wiki
>>
>> When I read before, I couldn't find any "config" directory under my new 
>> python dir, but I think that you mean this directory?
>>
>> [root@apache1 config-3.6m-x86_64-linux-gnu]# pwd
>> /apps/python-3.6.3/lib/python3.6/config-3.6m-x86_64-linux-gnu
>> [root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
>> total 15644
>> drwxr-xr-x  2 root root 4096 Nov  8 00:43 .
>> drwxr-xr-x 35 root root 4096 Nov  8 00:33 ..
>> -rw-r--r--  1 root root 3302 Nov  8 00:33 config.c
>> -rw-r--r--  1 root root 1621 Nov  8 00:33 config.c.in
>> -rwxr-xr-x  1 root root 7122 Nov  8 00:33 install-sh
>> -rw-r--r--  1 root root 15874060 Nov  8 00:33 libpython3.6m.a
>> lrwxrwxrwx  1 root root   19 Nov  8 00:43 libpython3.so -> 
>> ../../libpython3.so
>> -rw-r--r--  1 root root67977 Nov  8 00:33 Makefile
>> -rwxr-xr-x  1 root root 7521 Nov  8 00:33 makesetup
>> -rwxr-xr-x  1 root root 2050 Nov  8 00:33 python-config.py
>> -rw-r--r--  1 root root10096 Nov  8 00:33 python.o
>> -rw-r--r--  1 root root15322 Nov  8 00:33 Setup
>> -rw-r--r--  1 root root  327 Nov  8 00:33 Setup.config
>> -rw-r--r--  1 root root   41 Nov  8 00:33 Setup.local
>>
>> So I re-built Python 3.6.3, with the "--enable-shared" and I think I 
>> figured out where the 'config' dir you were referring to (above).
>>
>> As you can see, I have now added a softlink for libpython3.so but now I 
>> am still getting an error, even if run just "python3.6 -V":
>>
>> [root@apache1 config-3.6m-x86_64-linux-gnu]# python3.6 -V
>> python3.6: error while loading shared libraries: libpython3.6m.so.1.0: 
>> cannot open shared object file: No such file or directory
>>
>> So I added another softlink to "libpython3.6m.so.1.0":
>>
>>
>> [root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
>> total 15644
>> drwxr-xr-x  2 root root 4096 Nov  8 00:56 .
>> drwxr-xr-x 35 root root 4096 Nov  8 00:33 ..
>> -rw-r--r--  1 root root 3302 Nov  8 00:33 config.c
>> -rw-r--r--  1 root root 1621 Nov  8 00:33 config.c.in
>> -rwxr-xr-x  1 root root 7122 Nov  8 00:33 install-sh
>> -rw-r--r--  1 root root 15874060 Nov  8 00:33 libpython3.6m.a
>> lrwxrwxrwx  1 root root   26 Nov  8 00:56 libpython3.6m.so.1.0 -> 
>> ../../libpython3.6m.so.1.0
>> lrwxrwxrwx  1 root root   19 Nov  8 00:43 libpython3.so -> 
>> ../../libpython3.so
>> -rw-r--r--  1 root root67977 Nov  8 00:33 Makefile
>> -rwxr-xr-x  1 root r

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-07 Thread O haya
Oh oh, problem :(

I added:

LoadModule wsgi_module 
"/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so"

to the new Apache 2.4.29 httpd.conf and then tried to start the Apache and 
I think that I am back to the same error from before:

[oracle@apache1 bin]$ /apps/httpd-2.4.29/bin/apachectl start
httpd: Syntax error on line 168 of /apps/httpd-2.4.29/conf/httpd.conf: 
Cannot load 
/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
 
into server: 
/apps/python-3.6.3/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so:
 
undefined symbol: ap_accept_lock_mech


:(  ???

Jim




On Wednesday, November 8, 2017 at 1:08:53 AM UTC-5, O haya wrote:
>
> Ok, I am re-reading your page:
>
> https://code.google.com/archive/p/modwsgi/wikis/InstallationIssues.wiki
>
> When I read before, I couldn't find any "config" directory under my new 
> python dir, but I think that you mean this directory?
>
> [root@apache1 config-3.6m-x86_64-linux-gnu]# pwd
> /apps/python-3.6.3/lib/python3.6/config-3.6m-x86_64-linux-gnu
> [root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
> total 15644
> drwxr-xr-x  2 root root 4096 Nov  8 00:43 .
> drwxr-xr-x 35 root root 4096 Nov  8 00:33 ..
> -rw-r--r--  1 root root 3302 Nov  8 00:33 config.c
> -rw-r--r--  1 root root 1621 Nov  8 00:33 config.c.in
> -rwxr-xr-x  1 root root 7122 Nov  8 00:33 install-sh
> -rw-r--r--  1 root root 15874060 Nov  8 00:33 libpython3.6m.a
> lrwxrwxrwx  1 root root   19 Nov  8 00:43 libpython3.so -> 
> ../../libpython3.so
> -rw-r--r--  1 root root67977 Nov  8 00:33 Makefile
> -rwxr-xr-x  1 root root 7521 Nov  8 00:33 makesetup
> -rwxr-xr-x  1 root root 2050 Nov  8 00:33 python-config.py
> -rw-r--r--  1 root root10096 Nov  8 00:33 python.o
> -rw-r--r--  1 root root15322 Nov  8 00:33 Setup
> -rw-r--r--  1 root root  327 Nov  8 00:33 Setup.config
> -rw-r--r--  1 root root   41 Nov  8 00:33 Setup.local
>
> So I re-built Python 3.6.3, with the "--enable-shared" and I think I 
> figured out where the 'config' dir you were referring to (above).
>
> As you can see, I have now added a softlink for libpython3.so but now I am 
> still getting an error, even if run just "python3.6 -V":
>
> [root@apache1 config-3.6m-x86_64-linux-gnu]# python3.6 -V
> python3.6: error while loading shared libraries: libpython3.6m.so.1.0: 
> cannot open shared object file: No such file or directory
>
> So I added another softlink to "libpython3.6m.so.1.0":
>
>
> [root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
> total 15644
> drwxr-xr-x  2 root root 4096 Nov  8 00:56 .
> drwxr-xr-x 35 root root 4096 Nov  8 00:33 ..
> -rw-r--r--  1 root root 3302 Nov  8 00:33 config.c
> -rw-r--r--  1 root root 1621 Nov  8 00:33 config.c.in
> -rwxr-xr-x  1 root root 7122 Nov  8 00:33 install-sh
> -rw-r--r--  1 root root 15874060 Nov  8 00:33 libpython3.6m.a
> lrwxrwxrwx  1 root root   26 Nov  8 00:56 libpython3.6m.so.1.0 -> 
> ../../libpython3.6m.so.1.0
> lrwxrwxrwx  1 root root   19 Nov  8 00:43 libpython3.so -> 
> ../../libpython3.so
> -rw-r--r--  1 root root67977 Nov  8 00:33 Makefile
> -rwxr-xr-x  1 root root 7521 Nov  8 00:33 makesetup
> -rwxr-xr-x  1 root root 2050 Nov  8 00:33 python-config.py
> -rw-r--r--  1 root root10096 Nov  8 00:33 python.o
> -rw-r--r--  1 root root15322 Nov  8 00:33 Setup
> -rw-r--r--  1 root root  327 Nov  8 00:33 Setup.config
> -rw-r--r--  1 root root   41 Nov  8 00:33 Setup.local
> [root@apache1 config-3.6m-x86_64-linux-gnu]#
>
>
> but I still get an error:
>
> [root@apache1 config-3.6m-x86_64-linux-gnu]# python3.6 -V
> python3.6: error while loading shared libraries: libpython3.6m.so.1.0: 
> cannot open shared object file: No such file or directory
>
> I also added a softlink for libpython3.6m.so but same error??
>
> Then I added "export LD_LIBRARY_PATH=/apps/python-3.6.3/lib/" and then 
> "python3.6 -V" worked.
>
>
> Is THAT (adding the LD_LIBRARY_PATH necessary)?  
>
> Or, putting that another way, what did I do wrong that caused adding the 
> LD_LIBRARY_PATH to be a necessity?
>
>
>
>
>
>
>
>
>
>
>
> On Wednesday, November 8, 2017 at 12:21:05 AM UTC-5, O haya wrote:
>>
>> Correcting my memory... the "python3.6 setup.py" had the same problem 
>> (now I cannot recall how I got the "mod_wsgi-express start-server"  to 
>> work):
>>
>> r/wsgi_apache.o build/temp.linux-x86_64-3.6/src/server/wsgi_metrics.o 
>> build/temp

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-07 Thread O haya
Ok, I am re-reading your page:

https://code.google.com/archive/p/modwsgi/wikis/InstallationIssues.wiki

When I read before, I couldn't find any "config" directory under my new 
python dir, but I think that you mean this directory?

[root@apache1 config-3.6m-x86_64-linux-gnu]# pwd
/apps/python-3.6.3/lib/python3.6/config-3.6m-x86_64-linux-gnu
[root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
total 15644
drwxr-xr-x  2 root root 4096 Nov  8 00:43 .
drwxr-xr-x 35 root root 4096 Nov  8 00:33 ..
-rw-r--r--  1 root root 3302 Nov  8 00:33 config.c
-rw-r--r--  1 root root 1621 Nov  8 00:33 config.c.in
-rwxr-xr-x  1 root root 7122 Nov  8 00:33 install-sh
-rw-r--r--  1 root root 15874060 Nov  8 00:33 libpython3.6m.a
lrwxrwxrwx  1 root root   19 Nov  8 00:43 libpython3.so -> 
../../libpython3.so
-rw-r--r--  1 root root67977 Nov  8 00:33 Makefile
-rwxr-xr-x  1 root root 7521 Nov  8 00:33 makesetup
-rwxr-xr-x  1 root root 2050 Nov  8 00:33 python-config.py
-rw-r--r--  1 root root10096 Nov  8 00:33 python.o
-rw-r--r--  1 root root15322 Nov  8 00:33 Setup
-rw-r--r--  1 root root  327 Nov  8 00:33 Setup.config
-rw-r--r--  1 root root   41 Nov  8 00:33 Setup.local

So I re-built Python 3.6.3, with the "--enable-shared" and I think I 
figured out where the 'config' dir you were referring to (above).

As you can see, I have now added a softlink for libpython3.so but now I am 
still getting an error, even if run just "python3.6 -V":

[root@apache1 config-3.6m-x86_64-linux-gnu]# python3.6 -V
python3.6: error while loading shared libraries: libpython3.6m.so.1.0: 
cannot open shared object file: No such file or directory

So I added another softlink to "libpython3.6m.so.1.0":


[root@apache1 config-3.6m-x86_64-linux-gnu]# ls -al
total 15644
drwxr-xr-x  2 root root 4096 Nov  8 00:56 .
drwxr-xr-x 35 root root 4096 Nov  8 00:33 ..
-rw-r--r--  1 root root 3302 Nov  8 00:33 config.c
-rw-r--r--  1 root root 1621 Nov  8 00:33 config.c.in
-rwxr-xr-x  1 root root 7122 Nov  8 00:33 install-sh
-rw-r--r--  1 root root 15874060 Nov  8 00:33 libpython3.6m.a
lrwxrwxrwx  1 root root   26 Nov  8 00:56 libpython3.6m.so.1.0 -> 
../../libpython3.6m.so.1.0
lrwxrwxrwx  1 root root   19 Nov  8 00:43 libpython3.so -> 
../../libpython3.so
-rw-r--r--  1 root root67977 Nov  8 00:33 Makefile
-rwxr-xr-x  1 root root 7521 Nov  8 00:33 makesetup
-rwxr-xr-x  1 root root 2050 Nov  8 00:33 python-config.py
-rw-r--r--  1 root root10096 Nov  8 00:33 python.o
-rw-r--r--  1 root root15322 Nov  8 00:33 Setup
-rw-r--r--  1 root root  327 Nov  8 00:33 Setup.config
-rw-r--r--  1 root root   41 Nov  8 00:33 Setup.local
[root@apache1 config-3.6m-x86_64-linux-gnu]#


but I still get an error:

[root@apache1 config-3.6m-x86_64-linux-gnu]# python3.6 -V
python3.6: error while loading shared libraries: libpython3.6m.so.1.0: 
cannot open shared object file: No such file or directory

I also added a softlink for libpython3.6m.so but same error??

Then I added "export LD_LIBRARY_PATH=/apps/python-3.6.3/lib/" and then 
"python3.6 -V" worked.


Is THAT (adding the LD_LIBRARY_PATH necessary)?  

Or, putting that another way, what did I do wrong that caused adding the 
LD_LIBRARY_PATH to be a necessity?











On Wednesday, November 8, 2017 at 12:21:05 AM UTC-5, O haya wrote:
>
> Correcting my memory... the "python3.6 setup.py" had the same problem (now 
> I cannot recall how I got the "mod_wsgi-express start-server"  to work):
>
> r/wsgi_apache.o build/temp.linux-x86_64-3.6/src/server/wsgi_metrics.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_thread.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_memory.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_interp.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_server.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_stream.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_daemon.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_restrict.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_validate.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_buckets.o 
> build/temp.linux-x86_64-3.6/src/server/wsgi_logger.o -o 
> build/lib.linux-x86_64-3.6/mod_wsgi/server/
> mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so -L/apps/python-3.6.3/lib 
> -L/apps/python-3.6.3/lib/python3.6/config-3.6m -lpython3.6m
> /usr/bin/ld: /apps/python-3.6.3/lib/libpython3.6m.a(abstract.o): 
> relocation R_X86_64_32S against `_PyObject_NextNotImplemented' can not be 
> used when making a shared object; recompile with -fPIC
> /apps/python-3.6.3/lib/libpython3.6m.a: could not read symbols: Bad value
> collect2: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1
>
>
>
>
>
>
>
> On Wednesday, November 8, 2017 at 12:17:06 AM UTC-5, O haya wrote:
>>
>

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-07 Thread O haya
Correcting my memory... the "python3.6 setup.py" had the same problem (now 
I cannot recall how I got the "mod_wsgi-express start-server"  to work):

r/wsgi_apache.o build/temp.linux-x86_64-3.6/src/server/wsgi_metrics.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_thread.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_memory.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_interp.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_server.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_stream.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_daemon.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_restrict.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_validate.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_buckets.o 
build/temp.linux-x86_64-3.6/src/server/wsgi_logger.o -o 
build/lib.linux-x86_64-3.6/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so
 
-L/apps/python-3.6.3/lib -L/apps/python-3.6.3/lib/python3.6/config-3.6m 
-lpython3.6m
/usr/bin/ld: /apps/python-3.6.3/lib/libpython3.6m.a(abstract.o): relocation 
R_X86_64_32S against `_PyObject_NextNotImplemented' can not be used when 
making a shared object; recompile with -fPIC
/apps/python-3.6.3/lib/libpython3.6m.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1







On Wednesday, November 8, 2017 at 12:17:06 AM UTC-5, O haya wrote:
>
> Now I remember, this is what happened when I tried to run "pip3.6 install 
> mod_wsgi":
>
> server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so 
> -L/apps/python-3.6.3/lib -L/apps/python-3.6.3/lib/python3.6/config-3.6m 
> -lpython3.6m
> /usr/bin/ld: /apps/python-3.6.3/lib/libpython3.6m.a(abstract.o): 
> relocation R_X86_64_32S against `_PyObject_NextNotImplemented' can not be 
> used when making a shared object; recompile with -fPIC
> /apps/python-3.6.3/lib/libpython3.6m.a: could not read symbols: Bad 
> value
> collect2: ld returned 1 exit status
> error: command 'gcc' failed with exit status 1
>
> 
> Command "/apps/python-3.6.3/bin/python3.6 -u -c "import setuptools, 
> tokenize;__file__='/tmp/pip-build-lsdntr6f/mod-wsgi/setup.py';f=getattr(tokenize,
>  
> 'open', open)(__file__);code=f.read().replace('\r\n', 
> '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
> /tmp/pip-ltr8j01f-record/install-record.txt 
> --single-version-externally-managed --compile" failed with error code 1 in 
> /tmp/pip-build-lsdntr6f/mod-wsgi/
>
>
> I will try the setup.py next... I think that was the one that worked 
> better...
>
>
>
>
>
> On Wednesday, November 8, 2017 at 12:05:49 AM UTC-5, O haya wrote:
>>
>> Hi,
>>
>> Ok thanks for that info.
>>
>> I didn't get into detail earlier, but among the attempts that I tried to 
>> build mod-wsgi earlier, I actually DID get the "mod_wsgi-express 
>> start-server" to work, but then when I tried to add the LoadModule to my 
>> Apache 2.4.25, the Apache still failed again, for the same error (the one 
>> with "mech" in the error message).  The configuration is now gone (I 
>> restored a snapshot).
>>
>> I have to think about this some more :(...
>>
>> Jim
>>
>>
>> On Tuesday, November 7, 2017 at 11:28:13 PM UTC-5, Graham Dumpleton wrote:
>>>
>>> Short answer is you cannot use a mod_wsgi.so from a yum package against 
>>> anything but the binary distribution of Apache it was built for. You cannot 
>>> use it with a separate Apache you compiled from source code as how it was 
>>> built would likely be incompatible.
>>>
>>> I can only recommend you start out with the pip method for installation 
>>> as described in the issue at:
>>>
>>> * https://github.com/GrahamDumpleton/mod_wsgi
>>>
>>> as the easiest way to move forward.
>>>
>>> If you cannot get that working as I described such that 
>>> 'mod_wsgi-express start-server' does something, you need to provide the 
>>> details of what errors you are getting and what you were doing at that 
>>> point. I can't guess why you can't install it without seeing the errors.
>>>
>>> Also use either the mailing list or the issue, and not both.
>>>
>>> Graham
>>>
>>> On 8 Nov 2017, at 3:22 PM, O haya <jim...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> Re. why I was copying the mod_wsgi.so - that was mainly because I was 
>>> trying to get it into the Apache modules directory.  FYI, I also tried just 
>>> using the path+file to the mod_wsgi.so in the LoadModule, with same 
>

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-07 Thread O haya
Now I remember, this is what happened when I tried to run "pip3.6 install 
mod_wsgi":

server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so 
-L/apps/python-3.6.3/lib -L/apps/python-3.6.3/lib/python3.6/config-3.6m 
-lpython3.6m
/usr/bin/ld: /apps/python-3.6.3/lib/libpython3.6m.a(abstract.o): 
relocation R_X86_64_32S against `_PyObject_NextNotImplemented' can not be 
used when making a shared object; recompile with -fPIC
/apps/python-3.6.3/lib/libpython3.6m.a: could not read symbols: Bad 
value
collect2: ld returned 1 exit status
error: command 'gcc' failed with exit status 1


Command "/apps/python-3.6.3/bin/python3.6 -u -c "import setuptools, 
tokenize;__file__='/tmp/pip-build-lsdntr6f/mod-wsgi/setup.py';f=getattr(tokenize,
 
'open', open)(__file__);code=f.read().replace('\r\n', 
'\n');f.close();exec(compile(code, __file__, 'exec'))" install --record 
/tmp/pip-ltr8j01f-record/install-record.txt 
--single-version-externally-managed --compile" failed with error code 1 in 
/tmp/pip-build-lsdntr6f/mod-wsgi/


I will try the setup.py next... I think that was the one that worked 
better...





On Wednesday, November 8, 2017 at 12:05:49 AM UTC-5, O haya wrote:
>
> Hi,
>
> Ok thanks for that info.
>
> I didn't get into detail earlier, but among the attempts that I tried to 
> build mod-wsgi earlier, I actually DID get the "mod_wsgi-express 
> start-server" to work, but then when I tried to add the LoadModule to my 
> Apache 2.4.25, the Apache still failed again, for the same error (the one 
> with "mech" in the error message).  The configuration is now gone (I 
> restored a snapshot).
>
> I have to think about this some more :(...
>
> Jim
>
>
> On Tuesday, November 7, 2017 at 11:28:13 PM UTC-5, Graham Dumpleton wrote:
>>
>> Short answer is you cannot use a mod_wsgi.so from a yum package against 
>> anything but the binary distribution of Apache it was built for. You cannot 
>> use it with a separate Apache you compiled from source code as how it was 
>> built would likely be incompatible.
>>
>> I can only recommend you start out with the pip method for installation 
>> as described in the issue at:
>>
>> * https://github.com/GrahamDumpleton/mod_wsgi
>>
>> as the easiest way to move forward.
>>
>> If you cannot get that working as I described such that 'mod_wsgi-express 
>> start-server' does something, you need to provide the details of what 
>> errors you are getting and what you were doing at that point. I can't guess 
>> why you can't install it without seeing the errors.
>>
>> Also use either the mailing list or the issue, and not both.
>>
>> Graham
>>
>> On 8 Nov 2017, at 3:22 PM, O haya <jim...@gmail.com> wrote:
>>
>> Hi,
>>
>> Re. why I was copying the mod_wsgi.so - that was mainly because I was 
>> trying to get it into the Apache modules directory.  FYI, I also tried just 
>> using the path+file to the mod_wsgi.so in the LoadModule, with same 
>> symptoms.
>>
>> Re. was Apache installed by yum - no, it was built from the Apache 2.4.25 
>> source (originally from a tar.gz from apache.org).
>>
>> Re. "Are you also trying to install mod_wsgi using pip?" - I am not sure 
>> what you mean by that, but as I mentioned on the issues (which I assume you 
>> saw), after I failed trying to get the built-mod_wsgi.so (from yum install) 
>> working I tried building the mod_wsgi a number of times, including using 
>> the system.py approach, the pip install and also the configure/make/make 
>> altinstall - all failed.
>>
>> Re. "the Apache installation you are using is much older than the version 
>> the mod_wsgi module was compiled for." - The Apache I was trying was built 
>> from the 2.4.25 source.  Current Apache source on apache.org is 2.4.29, 
>> so it's not terribly old :).  So are you saying that you think that if I 
>> went to say build Apache 2.4.29 that the mod_wsgi from yum would work? 
>>
>> If so, I would try that, but FYI, our Apaches at work are even older that 
>> the 2.4.25, so if we want mod_wsgi for those would an older mod_wsgi 
>> (either rpm maybe or source) work with the older Apache?
>>
>> Thanks,
>> Jim
>>
>>
>> On Tuesday, November 7, 2017 at 6:51:38 PM UTC-5, Graham Dumpleton wrote:
>>>
>>> I am confused about why you are copying the mod_wsgi.so file anywhere. 
>>> When you install mod_wsgi using yum, it should put everything in the 
>>> correct place to start with.
>>>
>>> Are you also using Apache install by yum?

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-07 Thread O haya
Hi,

Ok thanks for that info.

I didn't get into detail earlier, but among the attempts that I tried to 
build mod-wsgi earlier, I actually DID get the "mod_wsgi-express 
start-server" to work, but then when I tried to add the LoadModule to my 
Apache 2.4.25, the Apache still failed again, for the same error (the one 
with "mech" in the error message).  The configuration is now gone (I 
restored a snapshot).

I have to think about this some more :(...

Jim


On Tuesday, November 7, 2017 at 11:28:13 PM UTC-5, Graham Dumpleton wrote:
>
> Short answer is you cannot use a mod_wsgi.so from a yum package against 
> anything but the binary distribution of Apache it was built for. You cannot 
> use it with a separate Apache you compiled from source code as how it was 
> built would likely be incompatible.
>
> I can only recommend you start out with the pip method for installation as 
> described in the issue at:
>
> * https://github.com/GrahamDumpleton/mod_wsgi
>
> as the easiest way to move forward.
>
> If you cannot get that working as I described such that 'mod_wsgi-express 
> start-server' does something, you need to provide the details of what 
> errors you are getting and what you were doing at that point. I can't guess 
> why you can't install it without seeing the errors.
>
> Also use either the mailing list or the issue, and not both.
>
> Graham
>
> On 8 Nov 2017, at 3:22 PM, O haya <jim...@gmail.com > wrote:
>
> Hi,
>
> Re. why I was copying the mod_wsgi.so - that was mainly because I was 
> trying to get it into the Apache modules directory.  FYI, I also tried just 
> using the path+file to the mod_wsgi.so in the LoadModule, with same 
> symptoms.
>
> Re. was Apache installed by yum - no, it was built from the Apache 2.4.25 
> source (originally from a tar.gz from apache.org).
>
> Re. "Are you also trying to install mod_wsgi using pip?" - I am not sure 
> what you mean by that, but as I mentioned on the issues (which I assume you 
> saw), after I failed trying to get the built-mod_wsgi.so (from yum install) 
> working I tried building the mod_wsgi a number of times, including using 
> the system.py approach, the pip install and also the configure/make/make 
> altinstall - all failed.
>
> Re. "the Apache installation you are using is much older than the version 
> the mod_wsgi module was compiled for." - The Apache I was trying was built 
> from the 2.4.25 source.  Current Apache source on apache.org is 2.4.29, 
> so it's not terribly old :).  So are you saying that you think that if I 
> went to say build Apache 2.4.29 that the mod_wsgi from yum would work? 
>
> If so, I would try that, but FYI, our Apaches at work are even older that 
> the 2.4.25, so if we want mod_wsgi for those would an older mod_wsgi 
> (either rpm maybe or source) work with the older Apache?
>
> Thanks,
> Jim
>
>
> On Tuesday, November 7, 2017 at 6:51:38 PM UTC-5, Graham Dumpleton wrote:
>>
>> I am confused about why you are copying the mod_wsgi.so file anywhere. 
>> When you install mod_wsgi using yum, it should put everything in the 
>> correct place to start with.
>>
>> Are you also using Apache install by yum?
>>
>> Are you also trying to install mod_wsgi using pip?
>>
>> That error indicates that the Apache installation you are using is much 
>> older than the version the mod_wsgi module was compiled for.
>>
>> Graham
>>
>> On 8 Nov 2017, at 10:37 AM, O haya <jim...@gmail.com> wrote:
>>
>> Hi,
>>
>> I am trying to use WSGI on Apache 2.4.x on CENTOS.
>>
>> I installed mod_wsgi using yum (yum install mod_wsgi), then I copied the 
>> mod_wsgi.so to the Apache modules dir and added a Load Module for mod_wsgi.
>>
>> However, when I try to start Apache I am getting this:
>>
>> /apps/apache/bin/apachectl start
>>
>> httpd: Syntax error on line 152 of /apps/apache/conf/httpd.conf: Cannot 
>> load modules/mod_wsgi.so into server: /apps/apache/modules/mod_wsgi.so: 
>> undefined symbol: ap_accept_lock_mech
>>
>> Can anyone tell me why this error is occurring and also, how can I get 
>> mod_wsgi to work?
>>
>> Thanks,
>> Jim
>>
>> -- 
>> 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.
>> To post to this group, send email to mod...@googlegroups.com.
>> Visit this group at https://groups.google.com/group/modwsgi.
>> For more options, visit https://groups.google.com/d/optout.
>>

Re: [modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-07 Thread O haya
Hi,

Re. why I was copying the mod_wsgi.so - that was mainly because I was 
trying to get it into the Apache modules directory.  FYI, I also tried just 
using the path+file to the mod_wsgi.so in the LoadModule, with same 
symptoms.

Re. was Apache installed by yum - no, it was built from the Apache 2.4.25 
source (originally from a tar.gz from apache.org).

Re. "Are you also trying to install mod_wsgi using pip?" - I am not sure 
what you mean by that, but as I mentioned on the issues (which I assume you 
saw), after I failed trying to get the built-mod_wsgi.so (from yum install) 
working I tried building the mod_wsgi a number of times, including using 
the system.py approach, the pip install and also the configure/make/make 
altinstall - all failed.

Re. "the Apache installation you are using is much older than the version 
the mod_wsgi module was compiled for." - The Apache I was trying was built 
from the 2.4.25 source.  Current Apache source on apache.org is 2.4.29, so 
it's not terribly old :).  So are you saying that you think that if I went 
to say build Apache 2.4.29 that the mod_wsgi from yum would work? 

If so, I would try that, but FYI, our Apaches at work are even older that 
the 2.4.25, so if we want mod_wsgi for those would an older mod_wsgi 
(either rpm maybe or source) work with the older Apache?

Thanks,
Jim


On Tuesday, November 7, 2017 at 6:51:38 PM UTC-5, Graham Dumpleton wrote:
>
> I am confused about why you are copying the mod_wsgi.so file anywhere. 
> When you install mod_wsgi using yum, it should put everything in the 
> correct place to start with.
>
> Are you also using Apache install by yum?
>
> Are you also trying to install mod_wsgi using pip?
>
> That error indicates that the Apache installation you are using is much 
> older than the version the mod_wsgi module was compiled for.
>
> Graham
>
> On 8 Nov 2017, at 10:37 AM, O haya <jim...@gmail.com > wrote:
>
> Hi,
>
> I am trying to use WSGI on Apache 2.4.x on CENTOS.
>
> I installed mod_wsgi using yum (yum install mod_wsgi), then I copied the 
> mod_wsgi.so to the Apache modules dir and added a Load Module for mod_wsgi.
>
> However, when I try to start Apache I am getting this:
>
> /apps/apache/bin/apachectl start
>
> httpd: Syntax error on line 152 of /apps/apache/conf/httpd.conf: Cannot 
> load modules/mod_wsgi.so into server: /apps/apache/modules/mod_wsgi.so: 
> undefined symbol: ap_accept_lock_mech
>
> Can anyone tell me why this error is occurring and also, how can I get 
> mod_wsgi to work?
>
> Thanks,
> Jim
>
> -- 
> 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 .
> To post to this group, send email to mod...@googlegroups.com 
> .
> Visit this group at https://groups.google.com/group/modwsgi.
> For more options, visit 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 modwsgi+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.


[modwsgi] mod_wsgi and Apache 2.4 on Centos 6.8 - undefined symbol: ap_accept_lock_mech

2017-11-07 Thread O haya
Hi,

I am trying to use WSGI on Apache 2.4.x on CENTOS.

I installed mod_wsgi using yum (yum install mod_wsgi), then I copied the 
mod_wsgi.so to the Apache modules dir and added a Load Module for mod_wsgi.

However, when I try to start Apache I am getting this:

/apps/apache/bin/apachectl start

httpd: Syntax error on line 152 of /apps/apache/conf/httpd.conf: Cannot 
load modules/mod_wsgi.so into server: /apps/apache/modules/mod_wsgi.so: 
undefined symbol: ap_accept_lock_mech

Can anyone tell me why this error is occurring and also, how can I get 
mod_wsgi to work?

Thanks,
Jim

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to modwsgi@googlegroups.com.
Visit this group at https://groups.google.com/group/modwsgi.
For more options, visit https://groups.google.com/d/optout.