32 Commits

Author SHA1 Message Date
Takashi Kajinami
e61fb1e4e2 apache: Add support for RequestHeader statements
This change introduces the new parameter to override
the apache::vhost::request_headers parameter, which is used to define
RequestHeader statements in vhost configuration.

Change-Id: I360b18acdf974bf3cdc9f8e817b66cd85f116afd
2021-12-09 01:19:11 +00:00
Tobias Urdin
342f4f0b04 Add ssl_verify_client to wsgi::apache
Change-Id: Iee9f8e0d87310e099185044f1cc1939a03aa9977
2020-10-14 11:20:21 +02:00
Andy Botting
a2e9ebc745 Add the aliases param to pass through to apache
This commit adds a new 'aliases' parameter for passing through to
the Apache vhost config.

Change-Id: Ibe841397e064bbda54bddbb83f8885b5451cbd6d
2020-09-18 10:08:27 +10:00
Takashi Kajinami
10af7893ed Add support for setenv parameter in apache
Change-Id: I0ac20540603d9682354b90f06a852a53d74767e3
2020-09-06 23:37:13 +09:00
Takashi Kajinami
556f742e5e Remove usage of apache::vhost::wsgi_daemon_process_options
because apache::vhost::wsgi_daemon_process_options has been deprecated
in puppetlabs-apache[1].

[1] 0d5e0bef88

Change-Id: I0a233190d2a1c9d96128d99e1ac1a612161a7446
2020-05-18 23:08:30 +00:00
Cédric Jeanneret
ad48860b75 Ensure no directory listing is active
By default, puppetlabs-apache module enables Indexes option, which can
lead in data/structure leak.

The following patch disable that option on a global base, since we
shouldn't need such a feature.

Closes-Bug: #1854442
Change-Id: Icba53f4e32237556608f4cb6dcd9da1a71705c19
2019-12-03 08:38:29 +01:00
Cédric Jeanneret
55668d9f33 Allow to activate WSGIImportScript option
This should prevent slow loading on the first request, especially
annoying when this first request is done by a healthcheck launched by an
inflight validation.

This patch is a reaction to the whole issue raised by the new nova
inflight validations[1], followed by some discussions in order to get a
faster application loading.

[1] https://review.opendev.org/#/q/status:merged+project:openstack/tripleo-heat-templates+branch:master+topic:bug/1842687
Related-Bug: #1843555

Change-Id: I27e37e30823c4312d9d7a93f18fe0f930ce70c49
2019-10-09 16:05:24 +02:00
Tobias Urdin
6eaab435b2 Add spec testing for multiple bind_port
Adds simple spec test for multiple ports in
the bind_port. The change in puppet-keystone
will need to support multiple ports so we
ensure nobody breaks this.

Change-Id: Ie2ab4641b0829b872fee0dea3aab236455eb3266
2018-12-05 22:09:06 +00:00
Tobias Urdin
4d08ab70cb Cleanup spec testing
Change-Id: I3c13fc2f8bc3582fd72206b3c711ff5863943b09
2018-11-01 17:54:51 +01:00
Javier Pena
33b05434f3 Make sure the wsgi script dir mode is 0755
When the system-wide umask setting is more restrictive than the
default setting, the wsgi script directory permissions may not allow
the apache process to access them, resulting in errors.

A similar fix was applied to Keystone some time ago, see [1].

[1] - 4f15fb64b1

Change-Id: Ie9769657dc530bc895a3119b3e458864a8b5f293
2018-10-03 15:16:58 +02:00
Tobias Urdin
809396defb Add support for multiple WSGI script aliases
This patch adds a new parameter named custom_wsgi_script_aliases
to the openstacklib::wsgi::apache class. This can be used to specify
extra WSGI script alias statements for the apache::vhost resource
which is merged with the default one calculated using $path,
$wsgi_script_dir and $wsgi_script_file.

This is the final piece to be able to move keystone::wsgi::apache
over to using openstacklib::wsgi::apache.

Change-Id: I31096140a6f355ec99496053fb06ce6c73094180
2018-04-23 22:37:41 +02:00
Tobias Urdin
2b239ef5e7 Add support for keystone options to wsgi::apache
This patch adds the params that keystone currently
supports to openstacklib::wsgi::apache so we can move
keystone::wsgi::apache to using this and not drop
any existing available options.

Change-Id: Ifb988fedce958d2607365634efeccf2d7b88d073
2018-04-16 08:44:02 +02:00
melissaml
53ec7a288c fix a typo in documentation
Change-Id: I677b7dc998efdf28b84f157aa0bbb5ea1dc910e3
2018-03-23 08:12:25 +08:00
Juan Antonio Osorio Robles
546eb8fb41 Allow setting log files for apache vhost
This allows the setting of the error and access file logs, as well as
the access log format. This was done in a similar fashion as one can
configure these ones in the keystone wsgi manifest.

Change-Id: I5e7d3588b7b3b106813d6d37b55aa812273d04d6
2017-10-05 14:24:47 +03:00
Juan Antonio Osorio Robles
ca0bf6ea34 apache wsgi: Exchange defaults for workers and threads
Due to Python's GIL [1], we can't use multiple threads for running
OpenStack services without a performance penalty, since the execution
ends up serialized, which defeats the purpose.

Instead, we should use several processes, since this approach doesn't
have this limitation.

[1] https://wiki.python.org/moin/GlobalInterpreterLock

Change-Id: I09b4dfa0873c5a086d4492a7e2ebb72460e507c9
2017-09-19 15:12:36 +00:00
Benedikt Trefzer
8832df01b0 add parameter to overwrite/add wsgi process options
Add two parameters to apache wsgi to allow overwrite
    and/or add additional wsgi process options.

Change-Id: I41914ce3361988d5db1695f09d21209772fdf548
2017-08-16 06:54:10 +02:00
ZhongShengping
7ce50f94b8 Update resource references for dependencies
The latest version of puppet now reports these as catalog failures so
this change removes the unnecessary references and the references
should be updated.

Change-Id: Id09c3358c5843510e6a2a8c0e2d4aeb3607e098b
Closes-Bug: #1702964
2017-07-11 17:23:15 +08:00
Benedikt Trefzer
75aa4228e9 fix copy of wsgi file beeing a symlink
if wsgi_script file is a symlink to another file (eg.
in a virtual environment) the file resource copied the
symlink instead of creating a new file.

This patch ensures, that symlinks are followed and a
ordinary file is created instead of copying the symlink.

Change-Id: I53e59dbfb8810a519fce24e1e381e0f83c5a1c29
2017-06-28 11:34:22 +02:00
Xing Zhou
ed9c5cf626 Add customization for wsgi process display name
when ceilometer api is deployed in httpd, however
 the process name is like '/usr/sbin/httpd -DFOREGROUND',
it is ambiguous and make monitoring more difficult.
the aodh, gnocchi module are also like that.
so we should set an appropriate name for wsgi process.

Change-Id: I5e8c9be062a88e9ed6442e6cbce6573fba385030
Related-Bug: #1626550
2016-12-15 15:25:11 +08:00
Juan Antonio Osorio Robles
3388c98ab0 Add wsgi_chunked_request option for apache vhost resource
This sets the WSGIChunkedRequest setting in the vhost, which is
something that services like glance need when running over httpd.

Change-Id: I1c8816e9e5a9a38a3a86f3c0c5016df18f09ea62
2016-11-17 10:42:33 +02:00
Juan Antonio Osorio Robles
59ee7b0930 Add support for allow_encoded_slashes for apache
This ends up as the AllowEncodedSlashes option in the vhost.

Change-Id: I9a9246522810de546a7c460ab1133d6bf9081a15
2016-11-10 15:34:19 +02:00
Alex Schultz
525d77195e Improve tests with rspec-puppet-facts
This change updates the tests to use rspec-puppet-facts when doing
different OS testing. Additionally as part of this change, there are
improvements to the openstacklib::policycrd testing which uncovered
issues with the verify_contents catalog test. The verify_contents calls
have been replaced with heredocs to better test when multiple services
are excluded.

Change-Id: I86bae2b16026e15b6e4445f3749419b8802bc94d
2016-10-26 17:49:59 -06:00
Maksym Yatsenko
a5f39c6233 Change worker defaults to ::os_workers
This patch changes the default worker count from ::processorcount to the
new ::os_workers fact. ::os_workers is based on the number of processors
(currently cpu/4) but is capped at a maximum of 8 worker processors.
This is a much more reasonable default in general and prevents excessive
resource consumption on systems with a large number of CPUs.

Change-Id: I458791aa8027cffeeec49698b302cb96ae5af2e2
2016-10-10 19:34:03 +03:00
Ben Nemec
b61adb6257 Make Apache vhost respect X-Forwarded-Proto header
Without this, some OpenStack services will return invalid URLs if
you are using SSL termination at a proxy in front of the service.

Change-Id: I3ee6b5838f4703e3b8b1b6632dd45c94057b2202
Closes-Bug: 1597935
2016-07-11 21:07:20 +00:00
iberezovskiy
177604c189 Adapt openstacklib tests for a new concat version
Change-Id: I1e159105a52f8126528aae96415dbb1e73cfb111
2016-05-24 17:47:48 +00:00
Sergey Kolekonov
2ff3a400f8 Pass necessary options to Apache when using WSGI
It's recommended to use WSGIApplicationGroup and WSGIPassAuthorization
options when a service is running under Apache.

Change-Id: Ia6bacab44c1d25f0253c84183f4a561d7682c6e8
2015-10-09 13:24:29 +03:00
vsaienko
670e2de5ad Allow to path custom fragment to vhost
Add possibility to pass custom_fragment to apache::vhost
  in order to provide lines, that are not supported by module.
  (for example LimitRequestFieldSize for keystone)

Change-Id: Ib199dc75c17de0bcdc385afcc33cb3854668a1b2
2015-09-21 16:52:10 +03:00
Colleen Murphy
11d033131e Correct wsgi_daemon_process_options key
'owner' is not a valid option for the WSGIDaemonProcess directive. The
correct option is 'user' [1]. Trying to set 'owner' causes the service
to be unable to start. This patch corrects that option name.

[1] https://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIDaemonProcess

Change-Id: I907fbcb48db823ea8f5caca4496efaaa456ef69c
2015-04-07 14:18:11 -07:00
Gael Chamoulaud
3fa6399cad spec: updates for rspec-puppet 2.x and rspec 3.x
This patch aim to update our specs test in order to work with the rspec-puppet
release 2.0.0, in the mean time, we update rspec syntax order to be prepared
for rspec 3.x move.

In details:
* Upgrade and pin rspec-puppet from 1.0.1 to 2.0.0
* Convert 'should' keyword to 'is_expected.to' (prepare rspec 3.x)
* Fix spec tests for rspec-puppet 2.0.0
* Clean Gemfile (remove over-specificication of runtime deps of
  puppetlabs_spec_helper)

Change-Id: Ice356e35a65204a62e47f49dd4f5816208a6dace
Signed-off-by: Gael Chamoulaud <gchamoul@redhat.com>
2015-03-31 12:13:33 +02:00
Emilien Macchi
210980fa01 wsgi/apache: add more WSGI params
For backward compatibility with puppet-keystone, we need to add more
parameters.

Change-Id: Iba3a15c4d90c2a5c284b91d6803d7478e5e95eeb
2014-12-30 18:06:22 -05:00
Emilien Macchi
c6b739f6ad wsgi/apache: do not harcode "wsgi" in service name
Because of backward compatibility with puppet-keystone, we should not
hardcode the name of the service.

Change-Id: Icf2356ea13344a57ed46b18a277e4534e510873c
2014-12-30 16:57:41 -05:00
Emilien Macchi
99bb19a0c4 Implement openstacklib::wsgi::apache
Allow to serve a service with apache mod_wsgi like.
This code will be consummed by OpenStack project that allow to run a
service as a WSGI process.

Change-Id: Ib606df7d6ceec1db032c8e133598056878df0a01
2014-12-30 13:06:12 -05:00