Xibo CMS1.8.1 Rewrite Base Option?

It’s not obvious to me how to alias or otherwise change the Document Root in the docker package, previously this was done in the .htaccess file. Proxy pass seems to be working however when accessing localhost/xibo/ it redirects me to localhost/login. My apache config looks like

<Location /xibo/>
    Order allow,deny
    Allow from all
    ProxyPass http://localhost:8081/
    ProxyPassReverse http://localhost:8081/

Can you try directly modifying the .htaccess file in the container and see if that works?

To do so, run docker ps

Find the name of the container with web_1 in it, and then run

docker exec -ti name bash

substituting the container name for name.

That will get you a prompt. From there, run

vi /var/www/cms/web/.htaccess

Move to the # at the start of the RewriteBase line, hit x, then Escape key, :wq Enter key.

If editing that works, I can look at making that configurable somehow.

After changing that I get a 500 error when trying to access http://localhost:8081/xibo/ (proving out the docker paths before I move on to the reverse proxy stuff). The apache log in the container indicates a internal redirect recursion issue. Any additional info you would like me to collect?

I don’t think it would work if you accessed it in that way. You need the reverse proxy infront to strip off the /xibo from the URLs coming in to Slim.

In that case with the change you suggested the reverse proxy is still redirecting to http://externalServerName/login instead of http://externalServerName/xibo/login. Relative path issue?

I don’t know I’m afraid then without sinking some time in to mocking it up here and trying it.

You could try in addition modifying /etc/apache/sites-enabled/000-default.conf to add

Alias /xibo /var/www/cms/web

To the VirtualHost section.

Then docker-compose stop
docker-compose start

And then see if it’s working in the /xibo directory locally, and via the reverse proxy.

That solved it.

So the final solution was to add an alias to the 000-default.conf, define the RewriteBase in the .htaccess file, and alter my hosts apache site config to be as follows.

<Location /xibo/>
    Order allow,deny
    Allow from all
    ProxyPass http://localhost:8081/xibo/
    ProxyPassReverse http://localhost:8081/xibo/

Thanks for the help. For others it may be convenient to provide a means to configure that through the docker config in future versions.

1 Like

Sure. Now we have a template I can work something out. Thank you.

This is now in the 1.8.2 image

Simply add a line


to the end of your config.env file before starting the upgrade.

1 Like