Jump to content

Topic on Talk:Meza/Flow

[WiP] Changes to Apache config to accommodate non-mediawiki web-apps

1
Revansx (talkcontribs)

Meza is optimized to manage a pure mediawiki farm. As a result, some changes have to be made to allow other web-apps to function on a meza managed server. The good news is that meza doesn't touch any folders that it doesn't need to, so non-meza web content in non-meza folders is safe from being modified by deployments. The only thing you have to do is update meza's apache config to configure access to the non-meza content. That said, here are my notes on how to alter the meza default apache configuration to enable other apps to function on a meza managed server:

Example: You want to host a non-meza app called "Foo" at https://www.MezaServer.com/Foo.

To accomplish this, changes need to be made to the following 2 meza managed files:

  1. /opt/meza/src/roles/apache-php/templates/httpd.conf.j2
  2. /opt/meza/src/roles/htdocs/templates/.htaccess.j2

Changes to httpd.conf.j2:

add the text shown at the bottom of the VirtualHost definition

# main handling via http
Listen 8080
<VirtualHost *:8080>

        ...existing stuff...

        # add the following "Alias" and "Directory" definition at the bottom of the webroot VirtualHost definition
        Alias /foo /opt/foo/
        <Directory /opt/foo/>
                AllowOverride All
                Options Indexes FollowSymLinks
                Require all granted
                Options All -Indexes
        </Directory>

</VirtualHost>

Changes to .htaccess.j2:

add a Rewrite Condition above the RewriteRule that alters the mediawiki path

# mod_rewrite
<IfModule mod_rewrite.c>

    ...existing stuff...

    # Taken from MediaWiki.org [[Extension:Simple Farm]]
    #
    # Redirect virtual wiki path to physical wiki path. There
    # can be no wiki accessible using this path.
    ...tbd... RewriteRule ^(?!mediawiki(?:/|$))[^/]+(?:/(.*))?$ mediawiki/$1

</IfModule>

Reply to "[WiP] Changes to Apache config to accommodate non-mediawiki web-apps"