Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the wsgi_script_aliases need to support array type of value #1609

Merged
merged 1 commit into from
Jul 18, 2017

Conversation

netman2k
Copy link
Contributor

Hi,

Recently, I found out that the wsgi_script_aliases parameter only supports string type of the value.
I only want to set the process-group with a WSGIScriptAlias in the HTTPD conf. as below

WSGIScriptAlias / /usr/local/djangoweb/wsgi.py process-group=djangoweb-admin

To accomplish this, I create the DSL code like this and the Puppet applies it without any error

::apache::vhost { $title :
    ip                          => $listen_ip,
    port                        => $port,
    servername                  => $server_name,
    serveraliases               => $server_aliases,
    serveradmin                 => $server_admin,
    docroot                     => $doc_root,
    wsgi_daemon_process         => $wsgi_daemonprocess_name,
    wsgi_daemon_process_options => $_wsgidaemonprocess_opts,
    wsgi_process_group          => $wsgi_daemonprocess_group,
    wsgi_script_aliases         => {
      '/' => '/usr/local/djangoweb/wsgi.py 'process-group=djangoweb-admin'
    },

But If I see the HTTPD daemon log, I can see this kind of message.

Apr 14 07:13:34 webapp.example.net httpd[18717]: Invalid option to WSGI script alias definition.

Cause the module created this in the configuration file.

WSGIScriptAlias / "/usr/local/djangoweb/wsgi.py process-group=djangoweb-admin"

So I changed the template file, _wsgi.erb. now it checks the value before applying the value directly.
After changed I can accomplish my desire state

::apache::vhost { $title :
    ip                          => $listen_ip,
    port                        => $port,
    servername                  => $server_name,
    serveraliases               => $server_aliases,
    serveradmin                 => $server_admin,
    docroot                     => $doc_root,
    wsgi_daemon_process         => $wsgi_daemonprocess_name,
    wsgi_daemon_process_options => $_wsgidaemonprocess_opts,
    wsgi_process_group          => $wsgi_daemonprocess_group,
    wsgi_script_aliases         => {
      '/' => [ 
         '/usr/local/djangoweb/wsgi.py', 
         'process-group=djangoweb-admin'
      ]
    },

@eputnam
Copy link
Contributor

eputnam commented Jul 18, 2017

@netman2k , thanks for the PR!

@eputnam eputnam merged commit 87cd2dc into puppetlabs:master Jul 18, 2017
@netman2k
Copy link
Contributor Author

netman2k commented Jul 18, 2017 via email

cegeka-jenkins pushed a commit to cegeka/puppet-apache that referenced this pull request Jul 15, 2020
the wsgi_script_aliases need to support array type of value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants