Docker container & Apache2

Problems with installing OpenKM? No problemo, the solution is closer than you think.
Forum rules
Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
Post Reply
sscala
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: Fri Jan 29, 2021 2:22 pm

Docker container & Apache2

Post by sscala »

Linux Ubuntu:

I am trying to install the openkm-ce Docker-container container and use the regular (as in not a Docker container) Apache2 reverse proxy to allow external access.

The login-page does open, but when I try to log in as okmAdmin, the login-screen reloads (with a new session ID).

I started the docker container with:

Code: Select all

docker run --name openkm-ce -p 127.0.0.1:8080:8080 openkm/openkm-ce
I added the 127.0.0.1 in order to prevent direct access to the container from external sources.

The Apache-config file looks like this:

Code: Select all

<VirtualHost *:80>
  ServerName openkm.mydomain.com
  RedirectMatch ^/$ /OpenKM

  ProxyPreserveHost Off
  ProxyRequests Off

  ProxyPass / http://127.0.0.1:8080/
  ProxyPassReverse / http://127.0.0.1:8080/

  ErrorLog /var/log/apache2/openkm-error.log
  CustomLog /var/log/apache2/openkm-access.log combined
</VirtualHost>
The "openkm.mydomain.com" is one of multiple domains pointing to the server.

Has anyone sucessfully managed to do this?
pavila
Moderator
Moderator
Posts: 3113
Joined: Tue Dec 11, 2007 6:02 pm
Location: Alicante, Spain
Contact:

Re: Docker container & Apache2

Post by pavila »

AFAIK it should work. Which error is showing?
sscala
Fresh Boarder
Fresh Boarder
Posts: 6
Joined: Fri Jan 29, 2021 2:22 pm

Re: Docker container & Apache2

Post by sscala »

It does not show any error. The openkm-error.log is clear and the openkm-access.log shows that it just opens another session after sending the login-data.

I just played around with the apache-conf-file and found a "solution":

It will work as long as you do not use "openkm" as subdomain. "doc.mydomain.com" e.g. works perfectly fine.

I have no idea why.
pavila
Moderator
Moderator
Posts: 3113
Joined: Tue Dec 11, 2007 6:02 pm
Location: Alicante, Spain
Contact:

Re: Docker container & Apache2

Post by pavila »

I think this is due to the default hostname. Try changing it with the --hostname parameter when creating the container.

Regards.
Post Reply