Score:2

Is it possible to install and use Dokku on a server that already has Apache2 configured with VirtualHosts running?

in flag

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.

Score:0
hu flag

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.

in flag
Thanks for your reply, I will try and I'll let you know.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.