# DNS and Discourse

**URL:** https://meta.discourse.org/t/dns-and-discourse/171559
**Category:** Self-hosting
**Created:** [November 28, 2020, 9:57am UTC](https://meta.discourse.org/t/dns-and-discourse/171559 "2020-11-28T09:57:37Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![aaronk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aaronk/32/201554_2.png) [@aaronk](https://meta.discourse.org/u/aaronk)
#### Post date: [November 28, 2020, 9:57am UTC](https://meta.discourse.org/t/dns-and-discourse/171559/1 "2020-11-28T09:57:37Z")

</div>

I use a virtual server from Host Europe. I have some question about the DNS and the smtp settings.

Here the DNS settings:

```
Hostname Record IP Address
forum.example.com A 178.77.99.191

```

Do I need a CNAME entry? If yes which is the right entry?

I added an email account [postmaster@example.com](mailto:postmaster@example.com) for the SMTP

```
DISCOURSE_DEVELOPER_EMAILS: 'forum@example.com'
DISCOURSE_SMTP_ADDRESS: mailout.example.com
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: postmaster@example.com
DISCOURSE_SMTP_PASSWORD: aUd34cdWKCu6CTjfoH7ykk 

```

After the start of Discourse I get the error message that the port 443 is already in use. Yes it is true. How to fix this problem?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 28, 2020, 10:22am UTC](https://meta.discourse.org/t/dns-and-discourse/171559/2 "2020-11-28T10:22:34Z")

</div>

Port 443 already in use could happen due to a number of reasons including another webserver already running on your server.

You can check if that’s the case by this command:

`netstat -alpn | grep 443`

---

<div class="post-metadata">

### Author: ![aaronk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/aaronk/32/201554_2.png) [@aaronk](https://meta.discourse.org/u/aaronk)
#### Post date: [November 28, 2020, 11:13am UTC](https://meta.discourse.org/t/dns-and-discourse/171559/3 "2020-11-28T11:13:11Z")

</div>

The httpd is running on 443. This is the website [example.com](http://example.com). The forum should run in a subdomain [forum.example.com](http://forum.example.com). Which Port I have to use?

Here is the output of netstat -alpn | grep 443

```
[root@vserver ~]# netstat -alpn | grep 443
tcp 0 0 0.0.0.0:8443 0.0.0.0:* LISTEN 28853/sw-cp-server: 
tcp 0 0 178.77.99.191:8443 185.243.71.165:58504 TIME_WAIT -                   
tcp 0 0 178.77.99.191:8443 185.243.71.165:58482 TIME_WAIT -                   
tcp 0 0 178.77.99.191:8443 185.243.71.165:58514 TIME_WAIT -                   
tcp6 0 0 :::443 :::* LISTEN 2517/httpd          
tcp6 0 0 :::8443 :::* LISTEN 28853/sw-cp-server: 
tcp6 0 0 178.77.99.191:443 185.243.71.165:46544 TIME_WAIT -                   
tcp6 0 0 178.77.99.191:443 185.243.71.165:46542 TIME_WAIT -

```

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [November 28, 2020, 12:25pm UTC](https://meta.discourse.org/t/dns-and-discourse/171559/4 "2020-11-28T12:25:34Z")

</div>

You’ll have to follow this guide to set up discourse alongside apache2.

> [@Set up Discourse on a server with existing Apache sites](https://meta.discourse.org/t/how-to-set-up-discourse-on-a-server-with-existing-apache-sites/30013):
>
> It’s not as daunting as it sounds! While this may sound a bit intimidating at first, it’s really not all that bad. You basically need to do two things: Install HAProxy (or an alternative) which will take over port 80 and then divert your Discourse traffic to your docker container, and all your other sites to your usual Apache set-up. Let Apache know which port to listen for. While this is only a rough guide, it should do a good job of pointing you in the right direction. Let’s get star…
