Where to host static site alongside Discourse Installation?

(Mack Nelson) #1

Hey guys, I’ve got a Discourse install running through DigitalOcean at http://forums.existencerp.com/.

I want to eventually integrate Discourse into a mostly otherwise static site on the same DigitalOcean Droplet. This static site would point towards existencerp.com.

Any ideas on how to best go about this? Thanks :slight_smile:

(Rafael dos Santos Silva) #2

You will need a new webserver on the server, serving Discourse and your new page.

I recommend using this:

(Mack Nelson) #3

Gotcha, will check it out and get back to you with results. Thanks :slight_smile:

(Mack Nelson) #4

Hey @Falco, I followed your instructions, and my site is now running with SSL automatically as promised!

However, I’m a bit stuck on how/where to put my static website, and how/where to create a virtual IP of sorts in order for my domain to point to it. Any help or pointers on where to read up on this would be very helpful. Thank you for recommending Caddy, I can already tell it’s going to be very helpful :slight_smile:

(Rafael dos Santos Silva) #5

Good to hear!

You will need to change your Caddyfile to something like:

forums.existencerp.com {
  proxy / unix:/sock/nginx.http.sock {

existencerp.com {
  root /var/www/existencerp

and run command to

docker run -d \
    -v /var/caddy/Caddyfile:/etc/Caddyfile \
    -v /var/caddy:/root/.caddy \
    -v /var/discourse/shared/standalone:/sock \
    -v /var/www/existencerp:/var/www/existencerp \
    -p 80:80 -p 443:443 \
    -p 80:80/udp -p 443:443/udp \
    --restart=always \
    --name caddy \
    --entrypoint "/usr/bin/caddy" \
    abiosoft/caddy -quic -email MYEMAILHERE@gmail.com -agree --conf /etc/Caddyfile --log stdout

with the static files at /var/www/existencerp

(Mack Nelson) #6

I edited the file and created the folder, and I tried running the command and received this error:

"docker: Error response from daemon: Conflict. The name "/caddy" is already in use by container fe15c8619bfa4752707d4b52c87893311b646c38fb2aba644a8c808fee362f74. You have to remove (or rename) that container to be able to reuse that name..
See 'docker run --help'."

Any idea on what’s causing the issue? I’ll keep looking for a fix. Thanks for your help so far.

(Rafael dos Santos Silva) #7

Run this command before the docker run ...:

docker stop caddy; docker rm caddy

(Mack Nelson) #8

Hmm. Forgive me for my ignorance. I have run the command you have told me to, as well as the command that threw the error, and I recieved this single line:


And I have pointed existencerp.com to the IP address stated. I am getting a 404 Not Found error. I have attached a screenshot:

I feel like I’m close. Maybe my files are not in the right place? index.html is directly within the folder var/www/existence, along with my assets folder. Any idea? I’ll keep toying at it and report back if I happen to fix it. Thank you for your help, again :smiley:

(Mack Nelson) #9

Nevermind @Falco! Got it figured out :slight_smile: Turns out I just screwed up my Caddyfile.

Thanks for all of your help :smiley: