Managing Sites

On the Opalstack hosting platform, websites are built by assigning domains and subdomains to sets of applications and URI paths known as site routes.

This approach enables you to build any type of site from a simple static home page to a complex web application. For example a single site could have all of the following:

  • https://domain.com/ served by a static application
  • https://domain.com/blog/ served by a WordPress application.
  • https://domain.com/api/ served by a WSGI server running a Flask application

Adding Sites

1

First, create the shell users, applications, and domains that you want to use for your site.

2

Click on Site Routes in the control panel sidebar.

3

Click the button labeled "+ Add Site Route" in the upper-left corner of the content area.

4

Enter a descriptive label for your site in the Name field.

5

Select your desired IP address for the site from the Server IP list.

6

Configure your HTTPS options:

  • Let's Encrypt: if you want Opalstack to automatically provision and manage a free Let's Encrypt SSL certificate for your site, then set the Let's Encrypt slider to on. Note: this option is available only for domains that are using Opalstack's name servers. If your site uses domains domain uses external name servers and attempt to save your site with LE enabled, DNS verification for LE will fail for those domains and the control panel will notify you of this.
  • Other certificates: if you have an existing SSL certificate that you'd like to use for your site, then select it from the Certificate list.
  • No HTTPS: if you don't want to use HTTPS for your site then select the No HTTPS option from the Certificate list.
  • Redirect to HTTPS: if you want all traffic to your site to be redirected to HTTPS, then set the Redirect to HTTPS slider to on.

Note: The Redirect to HTTPS option can only be set on sites that have an existing certificate attached to them. If you want to use this option in conjunction with a new Let's Encrypt certificate, you must first turn on LE for the site and then come back to this setting after the site is saved and the certificate has been generated.

7

Create your site routes in the Application Routing Info section:

  1. Select the application that you want to serve from the site.
  2. Enter the URI path from which the application will be served. For example, if you want to serve your application from the root of the site, you would enter / as the URI path.
  3. Click the "+ Add Route" button below the route list if you want to assign more routes to the site.

You can remove a route from a site by clicking the "Delete" button to the right of the desired route. Note that this does not delete the application assigned to the route - it only removes it from the site.

8

Assign your domains in the Domain Info section:

  1. Select the domain or subdomain you want to use from the domain list.
  2. Click the "+ Add Domain" button below the domain list if you want to assign more domains or subdomains to the site.

You can remove a domain from a site by clicking the "Delete" button to the right of the desired domain. Note that this does not delete the domain assigned to the site - it only removes it from the site.

9

When you are finished, click the "Save" button.

Note that when you save a site, several operations are triggered behind the scenes:

  • We generate DNS A records for the domains and subdomains attached to the site.
  • We provision a new Let's Encrypt certificate if you selected that option.
  • We generate web server configuration and push it to the web server.
  • We update configuration

It can take a few minutes for all of these operations to complete, so please wait at least 2-3 minutes for your new site to go live.

Editing Sites

You can edit existing sites to assign new applications to them, change their HTTPS options, etc.

1

Click on Site Routes in the control panel sidebar.

2

Optional: If you'd like to preview the the site configuration to see the apps that are attached to a site then click on the triangle icon in the left column of the row for the desired site. This will expand the row to show more details on the site.

3

Click the Edit icon near the right end of the row for the site that you want to edit.

4

Edit your site's configuration as desired. The available options are described in the previous section "Adding Sites".

5

When you are finished, click the "Save" button.

Deleting Sites

1

Click on Site Routes in the control panel sidebar.

2

Click the Delete icon near the right end of the row for the site that you want to delete.

A confirmation dialog will appear.

3

Type "I confirm" in the confirmation dialog.

After you have typed the confirmation phrase, the field border will turn green and a "Delete" button will appear.

4

Click the "Delete" button to delete the site.

Note that deleting a site does not delete the domains, applications, and certificates attached to the site - it only deletes the site definition from the control panel.