Bug 1288397 - [RFE] Add LoadModule xsendfile to httpd.conf
Summary: [RFE] Add LoadModule xsendfile to httpd.conf
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 2.x
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: ---
Assignee: John W. Lamb
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-12-04 06:08 UTC by Jaspreet Kaur
Modified: 2019-09-12 09:28 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-01-12 22:02:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jaspreet Kaur 2015-12-04 06:08:14 UTC
Description of problem:

How to add xsendfile module in Openshfit Online application. At present we can't edit httpd.conf file so as to add below content  :

LoadModule xsendfile_module modules/mod_xsendfile.so
XSendFile on
XSendFilePath /var/lib/openshift/5265721be0b8cd1843000043/app-root/repo/wsgi


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. httpd.conf is read only at present :

ls -ltra
total 24
-rw-r--r--. 1 root 565fd0e92d5271ee99000020  9975 Dec  3 00:19 httpd.conf
drwxr-xr-x. 2 root 565fd0e92d5271ee99000020    46 Dec  3 00:19 .
-rw-r--r--. 1 root 565fd0e92d5271ee99000020 10150 Dec  3 00:19 httpd_nolog.conf
drwxr-xr-x. 5 root 565fd0e92d5271ee99000020    56 Dec  3 00:19 ..


2.
3.

Actual results:

Cant edit httpd.conf file.


Expected results:

Adding the above content in httpd.conf file should work and load the module

Additional info:

Comment 1 Andy Grimm 2015-12-04 13:57:16 UTC
The httpd.conf file being read-only is very intentional.  The files in etc/conf.d are writable by the gear, but they are intended to be autogenerated (and the conf.d directory itself is not writable by the gear, to prevent the addition of extra config files).

I think that what you really mean to ask for is an option to allow the configuration lines you've specified to be written to one of the autogenerated files -- probably conf.d/openshift.conf ; I think that an environment variable might be the best way to accomplish this, as there are security implications to turning this on, and not every user will want it.

Comment 2 Jaspreet Kaur 2015-12-07 05:50:36 UTC
Hello,

Thanks for the update.

yes, Probably a way to enable any module in web framework. In my customer's case it is xsendfile module. 

Having a environment variable to enable the modules would be a good way to accomplish this.

Regards,
Jaspreet

Comment 4 John W. Lamb 2015-12-10 15:25:12 UTC
I've been talking this over with the team, trying to determine if this is an RFE - it is. This does seem like a useful feature to add, but the process for adding a new feature like this can take some time.

A potentially quicker solution would be for the customer to resolve this by creating a custom cartridge: https://developers.openshift.com/en/get-involved-extend-openshift.html#_build_a_cartridge

The user seems to be working with the Python cartridge, so they could start by creating a new github repo based on the official origin-server python cart code here: https://github.com/openshift/origin-server/tree/master/cartridges/openshift-origin-cartridge-python

From there, they could add the necessary logic to enable XSendFile and set the correct XSendFile path to the openshift.conf.erb template: https://github.com/openshift/origin-server/blob/master/cartridges/openshift-origin-cartridge-python/usr/versions/shared/etc/conf.d/openshift.conf.erb

The user will need to take care not to hardcode the XSendFile path, but rather derive it from env vars, e.g. $OPENSHIFT_REPO_DIR

Comment 8 John W. Lamb 2016-01-12 22:02:38 UTC
The v3 Online Beta will provide far more latitude for customizing apache configs, among other things. Since this issue will be addressed in a future release, I'm going to close the bug as DEFERRED.


Note You need to log in before you can comment on or make changes to this bug.