I am trying to set up Discourse docker on my existing server. I am not running any other docker containers.
My server runs Apache (WordPress websites) and some other web services.
I can’t figure out how to route my subdomain ‘forum.rebelscience.club’ to my docker container.
When I am asked this:
Hostname for your Discourse? [discourse.example.com]: forum.rebelscience.club
This is what I see:
Checking your domain name . . .
WARNING: Port 443 of computer does not appear to be accessible using hostname: forum.rebelscience.club.
WARNING: Connection to http://forum.rebelscience.club (port 80) also fails.
This suggests that forum.rebelscience.club resolves to some IP address that does not reach this
machine where you are installing discourse.
The first thing to do is confirm that forum.rebelscience.club resolves to the IP address of this server.
You usually do this at the same place you purchased the domain.
If you are sure that the IP address resolves correctly, it could be a firewall issue.
A web search for "open ports YOUR CLOUD SERVICE" might help.
This tool is designed only for the most standard installations. If you cannot resolve
the issue above, you will need to edit containers/app.yml yourself and then type
./launcher rebuild app
I am not sure how to set this up. Ports 80/443 are available, but they are pointed to my main domain, not my subdomain.
This topic has been discussed extensively here at meta; and you can search meta for apache reverse proxy and find a number of comprehensive and very detailed topics.
In a nutshell, you need to set up your apache server virtual host to operate as a reverse proxy to Discourse.
The exact apache2 configurations for this setup have been posted on meta a number of times.
Sorry, I should have mentioned I have looked at/tried a few solutions from this forum and Digital Ocean too. But I still can’t get it to work. I have never set up docker before.
Let me share my current settings:
/ets/hosts:
127.0.0.1 forum.rebelscience.club
Hosts file, DNS record work as I had phpBB running there today. Now I am trying to point it to a docker with Discourse.
In the case (example configuration) above, you should only expose port 8081 on Docker (and not port 80 or port 443).
Ports 80 and 443 are exposed by the reverse proxy outside the container and that traffic is proxied to port 8081 (in your example above), the port you have exposed inside (mapped to 80 inside).
This will work only if you have mapped port 80 inside the container to port 8081 (exposed to the host).
expose:
- "8081:80" # http
Hope this helps.
PS: @rebelCoder, your apache2 configuration on the SSL side is missing a lot of configuration info you need.