# Host Multiple Websites with Different Domains (Solved)

**URL:** https://discuss.freedombox.org/t/host-multiple-websites-with-different-domains-solved/2365
**Category:** Tips and Tricks
**Created:** [November 22, 2022, 6:21pm UTC](https://discuss.freedombox.org/t/host-multiple-websites-with-different-domains-solved/2365 "2022-11-22T18:21:46Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Ged](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/ged/32/999_2.png) [@Ged](https://discuss.freedombox.org/u/Ged)
#### Post date: [November 22, 2022, 6:21pm UTC](https://discuss.freedombox.org/t/host-multiple-websites-with-different-domains-solved/2365/1 "2022-11-22T18:21:46Z")

</div>

**Problem Description**  
I am trying to host a second static website with a different domain.

**Steps to Reproduce**

1. Managed to get LetsEncrypt Certificate for a second domain.
2. Created a virtual host under apache with necessary second domain directory and configuration [as described here](https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-ubuntu-20-04/)
3. Restarted apache2
4. Cant access my new static website

**Expected Results**  
I expect to be able to host and access multiple domains.

**Actual results**  
I get a “site unavailabe” message in my browser.

**Information**

- _FreedomBox version_: Debian GNU/Linux 11 (bullseye) and FreedomBox version 22.24
- _Hardware_: Pi4
- _How did you install FreedomBox?_: downloading testing images from [https://freedombox.org](https://freedombox.org)’

---

<div class="post-metadata">

### Author: ![Ged](https://discuss.freedombox.org/user_avatar/discuss.freedombox.org/ged/32/999_2.png) [@Ged](https://discuss.freedombox.org/u/Ged)
#### Post date: [November 22, 2022, 8:56pm UTC](https://discuss.freedombox.org/t/host-multiple-websites-with-different-domains-solved/2365/2 "2022-11-22T20:56:18Z")

</div>

Thanks to some remarks from @etienne in regard to overriding the freedombox config files ([Reference Post](https://discuss.freedombox.org/t/problem-to-configure-static-website-with-apache/2353)) the issue seems to be solved with the following steps:

- Introduce your new domain under Plinth \> Configure \> Domain Name _(i.e. [custom.com](http://custom.com))_  
_This will trigger LetsEncrypt to obtain a certificate for your new domain_  
_Once you get the certificate, you may revert back to your initial domain to access FBX._
- Follow steps in [this](https://linuxize.com/post/how-to-set-up-apache-virtual-hosts-on-ubuntu-20-04/) guide to create the folder structure for your new website.  
When creating your `conf` file, name it with a prefix of `01-` _(i.e. 01-custom.com.conf)._
- The contents of your `01-custom.com.conf` should be in line with the below:

```auto
<VirtualHost *:443>
    ServerName custom.com
    ServerAlias www.custom.com
    ServerAdmin webmaster@custom.com
    DocumentRoot /var/www/custom.com/public_html

    <Directory /var/www/custom.com/public_html>
        Options -Indexes +FollowSymLinks
        AllowOverride All
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/custom.com-error.log
    CustomLog ${APACHE_LOG_DIR}/custom.com-access.log combined

SSLCertificateFile /etc/letsencrypt/live/custom.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/custom.com/privkey.pem
</VirtualHost>

```

If you’ve adjusted your DNS settings correctly, you should access [custom.com/index.html](http://custom.com/index.html) from the external network.
