3

I am trying to set up Apache as a frontend proxy to a Docker app. I have done this several times in the past, but for some reason, the new Ubuntu VPS I have is not co-operating. I'm using Apache/2.4.18.

I am using this vhost:

<VirtualHost *:80>
    ServerName blog.example.com

    ProxyPass / http://127.0.0.1:8083/
    ProxyPassReverse / http://127.0.0.1:8083/

</VirtualHost>

I have enabled the necessary modules:

a2enmod proxy
a2enmod proxy_html
a2enmod xml2enc

Apache starts up fine, but I get this error in the logs, plus the standard 500 crash message in the browser:

AH01144: No protocol handler was valid for the URL /. If you are using a DSO version of mod_proxy, make sure the proxy submodules are included in the configuration using LoadModule.

This problem is mentioned a lot on the web, but the advice basically reflects the contents of the error message, which is that I need to ensure the proxy modules are loaded. I can confirm 100% they are loaded - in fact, if I replicate the LoadModule commands in my vhost config, Apache won't start, because the modules are already loaded.

They also look loaded from here too:

$ apachectl -M | grep proxy
 proxy_module (shared)
 proxy_html_module (shared)

I can confirm the Docker app is serving an HTTP response (I don't think it's getting that far anyway):

root@agnes:~# wget localhost:8083
--2018-04-02 19:04:46--  http://localhost:8083/
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8083... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7 [text/html]
Saving to: ‘index.html’

index.html                                                  100%[=========================================================================================================================================>]       7  --.-KB/s    in 0s      

2018-04-02 19:04:46 (1.20 MB/s) - ‘index.html’ saved [7/7]

root@agnes:~# cat index.html 
Hello

I am rather stuck as to what other problem I could be having. Researching the problem further is not trivial, since search engine results are drowned out by a common answer that does not seem to apply in my case.

halfer
  • 161
  • 1
  • 5
  • 25
  • I am entirely stuck on this problem. While waiting for potential answers, I have been trying to set up Traefik to do the same thing. This is not as trivial as Apache normally is, and although I also have some Traefik experience, it will not ingest my PEM certificates, and the log messages are somewhat vague, and do not help with trying to track the problem down. What other options do I have that will work without the need for assistance? Are there other simple frontend options out there? – halfer Apr 03 '18 at 12:12
  • I should say I am loathe to try something new, since I may be storing up problems for myself later on by committing to something that will break down the line. I have a new thing to try with Traefik, but an answer is still sought on this post. How can I get some more eyeballs? 9 views in a day is not much (at least if my Stack Overflow experience is anything to go by). – halfer Apr 03 '18 at 12:45
  • I have made a breakthrough with Traefik, so it looks like that is going to win the horse race. That's probably a nicer solution anyway, since it is supplied in a Dockerised form by default, and is of a lighter weight than Apache. So, while this question can stand on the basis it may be helpful to someone in the future, I will give up with trying to fix it myself. – halfer Apr 03 '18 at 20:58

1 Answers1

2

You need to load mod_proxy_http to be able to proxy the http protocol.

vick
  • 171
  • 4