# Wanting to run Discourse alongside apache

**URL:** https://meta.discourse.org/t/wanting-to-run-discourse-alongside-apache/125075
**Category:** Self-hosting
**Created:** [August 7, 2019, 1:38am UTC](https://meta.discourse.org/t/wanting-to-run-discourse-alongside-apache/125075 "2019-08-07T01:38:18Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![lucasbasquerotto](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lucasbasquerotto/32/133376_2.png) [@lucasbasquerotto](https://meta.discourse.org/u/lucasbasquerotto)
#### Post date: [August 8, 2019, 1:42pm UTC](https://meta.discourse.org/t/wanting-to-run-discourse-alongside-apache/125075/11 "2019-08-08T13:42:57Z")

</div>

Make sure to:

1. Comment out all ssl templates in the `templates` (in `app.yml`) . If you are using letsencrypt you will have two:

```plaintext
# - "templates/web.ssl.template.yml"
# - "templates/web.letsencrypt.ssl.template.yml"

```

1. Add a socket template:

```plaintext
- "templates/web.socketed.template.yml" 

```

1. Comment out all exposed ports:

```plaintext
# - "80:80" # http
# - "443:443" # https

```

(or you may expose other ports like `8080:80` and `8443:443` and instead of using a socket in the next step you can redirect to an upstream that points to `localhost:80` and/or `localhost:443`)

1. You have:

```plaintext
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock;

```

I think you need to add **:** at the end of the socket:

```plaintext
proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:;

```

1. You need to have the ssl certificate files at `/var/discourse/shared/standalone/ssl/`. Do you have them? I’m assuming you already own the domain `a1rp.xyz` and read about how to generate ssl certificates in the letsencrypt site. Also keep in mind that discourse handles the renewal of certificates for you in the default install, but in you case you would have to handle it (with a cronjob, for example), otherwise your certificates will expire after 3 months.

See:

> [@Run other websites on the same machine as Discourse](https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247/182):
>
> The guide in the first post is great and, on the whole, still works just fine sunny There are three things worth noting: I initially missed some of the app.yml changes. There are 3 things you need to change in your app.yml. If you miss any of these things it won’t work: Comment out all ssl templates in the templates. If you are using letsencrypt you will have two:# - "templates/web.ssl.template.yml" # - "templates/web.letsencrypt.ssl.template.yml" Add a socket template:- "templates/web…

---

_[View the full topic](https://meta.discourse.org/t/wanting-to-run-discourse-alongside-apache/125075)._
