2

Posted this on StackOverflow, but realized it probably belongs here:

I have a Ubuntu (now upgrading it to 22.04) server that runs several virtual hosts with php applications. I'd like to run a couple of node applications (I am converting the old php ones to node) on it, and I'd like to use dokku to keep them separated one from the others. Is there a way to have both Apache (and its virtual hosts) and Dokku running on the same server, and both responding to port 80? I was thinking that maybe running Dokku on a port different than 80 and having a reverse proxy on apache might work, but I am not sure and don't have any experience on this.

1 Answers1

0

Hiho.

You have nearby answered your own question. Ports are bound to a service, so you can´t reuse them in another service.

I would suggest: Setting up dokku as docker container running on a different port (like the example in documentation: https://dokku.com/docs/getting-started/install/docker/

Afterwards create a virtualHosts entry for a specific domain or reuse an existing one to ProxyPass your requests to local docker container of dokku.

Don´t forget to enable the apche modules for proxyPass:

  • mod_proxy
  • mod_proxy_http

For http virtualHost:

ProxyRequests Off
<Location "/">
    ProxyPass "http://127.0.0.1:8080/"
    ProxyPassReverse "http://127.0.0.1:8080/"
</Location>

For https virtualHost:

ProxyRequests Off
<Location "/">
    SSLProxyEngine On
    ProxyPass "http://127.0.0.1:8443/"
    ProxyPassReverse "http://127.0.0.1:8443/"
</Location>

For SSH you can use the port 3022 like noted in the install documentation.

OR

like i did it on my GitLab installation i´ve reconfigured my normal SSH port of the OS to a high port number and mapped the port 22 to the docker container.

DJSnoopy
  • 16
  • 1
  • 6