Hello all, I’ve been testing Owncloud using the ESX VM appliance downloaded from their site, updated to Univention 4.4.2 errata 350 + docker container for Owncloud 10.2.1.1 (and another one for Redis).
After some struggle I’ve been able to integrate the Univention appliance with our internal AD domain, and now have a working Owncloud setup, with a non standard URL, /cloud instead of /owncloud.
In order to have the URL working, I had to manually edit (at host level) /etc/apache2/sites-enabled/000-default.conf
and /etc/apache2/sites-enabled/defalt-ssl.conf
so that the Apache reverse proxy can correctly process requests to my.domain.name/cloud
and forward them to the Owncloud container. In other words, I manually edited the directives within whose files from
ProxyPass /owncloud http://127.0.0.1:40001/owncloud retry=0
ProxyPassReverse /owncloud http://127.0.0.1:40001/owncloud
to
ProxyPass /cloud http://127.0.0.1:40001/cloud retry=0
ProxyPassReverse /cloud http://127.0.0.1:40001/cloud
And that works, but only in testing mode, since periodically 000-default.conf
and default-ssl.conf
are overwritten, and manual edits are lost.
So I went to the Univention templates folder, read the Python source, and found that 000-default.conf
and default-ssl.conf
are written using values from the app cache, as per the following snippet taken from /etc/univention/templates/files/etc/apache2/sites-available/000-default.d/10univention-appcenter
:
for app_id, container_port, host_port in app_ports():
app = Apps().find(app_id)
if app and app.auto_mod_proxy and app.has_local_web_interface():
web_interface = app.web_interface
scheme = app.web_interface_proxy_scheme
if scheme == 'both':
scheme = 'http'
if app.web_interface_port_http == container_port:
print '''
ProxyPass %(web_interface)s %(scheme)s://127.0.0.1:%(web_port)s%(web_interface)s retry=0
ProxyPassReverse %(web_interface)s %(scheme)s://127.0.0.1:%(web_port)s%(web_interface)s''' % {'id': app.id, 'web_interface': web_interface, 'web_port': host_port, 'scheme': scheme}
else:
# not relevant for mod_proxy
continue
All is clear up to this point, although not immediate for me (has been ages since I used python, and all in all I’m a Linux noob, but making a bif of exercise is always useful )
Where I got stuck is: how can I change the value of web_interface
?
From what I’ve seen the value comes directly from the app cache which mirrors the content of Univention’s repository, and there is no way to customize it.
So, although the appliance allows to customize the Owncloud app in order to change its overwrite.cli.url value, this happens within the Owncloud docker container. But the “glue” with the external world, that is the 000-default.conf
and ssl-default.conf
files at the host level, are not changed accordingly, and I couldn’t find a way to configure them correctly in an automatic way.
In the LDAP directory there is an object which represents the Owncloud app’s metadata, and it has a Web Interface attribute which I changed from /owncloud
to /cloud
.
In UCR, there is a variable ucs/web/overview/entries/service/owncloud/link
which I changed in the same way.
Maybe I did something wrong, but neither changes triggered any rewriting of 000-default.conf
and ssl-default.conf
.
At the current time, I’m using a brute-force solution: take 000-default.conf
and ssl-default.conf
, copy them to 0000-default.conf
and 0000-ssl-default.conf
, and edit them as needed
Since they are processed before the two other files, their <VirtualHosts …> directives (and ProxyPass / ProxyPassReverse within them) win, so my non default URL works correctly, but I would prefer an official solution. Is it possible at the current time?
Thank you for your help and support,
Andrea