Bug 984713

Summary: add a mod_wsgi build for the python 2.7 SCL
Product: Red Hat Software Collections Reporter: Rob Millner <rmillner>
Component: mod_wsgiAssignee: Jan Kaluža <jkaluza>
Status: CLOSED ERRATA QA Contact: Branislav Náter <bnater>
Severity: medium Docs Contact:
Priority: unspecified    
Version: python27CC: admiller, aog2000a, bgollahe, bkabrda, drieden, jkejda, lightdot, mfisher, nobody+bgollahe, python-maint, riehecky, vondruch
Target Milestone: ---   
Target Release: 1.1   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: python27-mod_wsgi-3.4-10.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-06-04 07:26:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
SCL spec file for mod_wsgi 3.4 none

Description Rob Millner 2013-07-15 19:08:56 UTC
Created attachment 773875 [details]
SCL spec file for mod_wsgi 3.4

OpenShift on RHEL 6 is trying to deploy the Python 2.7 SCL environment instead of the hand maintained community cartridge.

We would like mod_wsgi for this environment.  I've created a package, built and tested it but need it to be built by Brew in the SCL environment and managed properly for inclusion into OpenShift.

The package I wrote creates mod_wsgi as "python27-mod_wsgi" in the regular Apache modules directory and does not load it into Apache by default.  That can certainly change as necessary but its what we'd prefer for OpenShift.

Comment 2 Bohuslav "Slavek" Kabrda 2013-07-19 11:13:55 UTC
So, after playing around with mod_wsgi + SCLs, here's a little analysis:

- Usable for both python27 and python33 (some minor patching for Python 3).
- Needs to be build separately for each Python runtime.
- If multiple mod_wsgi are installed (that includes two SCL mod_wsgi or system+SCL mod_wsgi), each one _must_ have it's own Apache instance with own httpd.conf (if we don't want to modify the current one, which we don't).
- Seems pretty ok from packaging/maintenance POV (no additional deps, little to no bugs).

Comment 3 Rob Millner 2013-07-23 21:31:51 UTC
Would you mind attaching any modifications to the spec file and patches.  We're going ahead with our own build for testing and would like to make sure there are no surprises.  Thanks!

Comment 4 Rob Millner 2013-07-23 22:27:44 UTC
An ETA for this package would be really helpful for our planning.  Thanks!

Comment 5 Bohuslav "Slavek" Kabrda 2013-07-24 07:41:01 UTC
For ETA, I think you'll need to talk to Brian Gollager (requesting needinfo from him so that he knows about this bug).

For the technical part: my specfile is a not working ATM, I built the package pretty much the same way you did and then I moved the files around by hand to make things work. Basically, what you need to do is:
1) Build mod_wsgi against scl python (correct in your specfile).
2) Place built mod_wsgi in correct location (I'd say using /opt/... is better than using the system dir).
3) Create a new httpd.conf (preferably in /opt/.../etc/httpd/conf) file that you will use to run the new apache instance.
4) Create wsgi.conf (in /opt/.../etc/httpd/conf.d) that will load the mod_wsgi built in step 2) (note that this will require using full path to mod_wsgi.so).
5) Run a new apache instance with the new httpd.conf.

This is what you need to do to not break system mod_wsgi (and _probably_ what we will do in RHSCL if adding mod_wsgi). If you are sure that you will only use the collection mod_wsgi, you can probably skip moving the files around, creating new httpd.conf etc - pretty much what you do in your specfile.

Comment 6 Rob Millner 2013-08-01 19:35:40 UTC
We're rolling our own version to continue testing and will switch to the official SCL version when its ready.

Comment 7 Rob Millner 2013-08-06 18:29:34 UTC
We're sticking with module installation as:
/usr/lib64/httpd/modules/python27-mod_wsgi.so

Files in /usr/lib64/httpd/modules/* get a specific SELinux tag as Apache modules.  If the official SCL package places the module in the SCL build root instead, please ensure that it works with SELinux in enforcing mode.  Thanks!

Comment 8 Vít Ondruch 2013-08-13 07:22:10 UTC
Why not use passenger to serve WSGI [1]? If I am not mistaken, OpenShift already supports passenger ... just saying


[1] http://www.modrails.com/documentation/Users%20guide%20Apache.html#_deploying_a_wsgi_python_application

Comment 9 Rob Millner 2013-08-13 16:52:40 UTC
We have use cases where Apache mod_wsgi is preferred; though the latest version of our cartridge also allows the end-user to stand up their own framework and stand-alone Passenger would be an option.

Comment 15 Ariel 2014-03-27 16:12:48 UTC
I've seen there is a new Python 2.7 SCL version available (using the Repo:
http://people.redhat.com/bkabrda/python27-rhel-6/ )
but the mod WSGI package python27-mod_wsgi is not there.

That package was however available in the "candidate" Repo
http://people.redhat.com/bkabrda/rhscl-1.1-rhel-6-candidate-python27/

Is there any problem with that package, or what is the current status?

Thanks a lot for your answer and your work! :)

Comment 16 Marcela Mašláňová 2014-03-27 17:55:54 UTC
Thank you for your interest in SCL. We don't plan to maintain packages on our private pages anymore. You can:
1/ buy a subscription
2/ wait for official start of our upstream pages http://softwarecollections.org/ (now Beta). We will be posting our upstream SCL there in few weeks.

Comment 17 errata-xmlrpc 2014-06-04 07:26:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2014-0610.html