Sites

On the Opalstack hosting platform, websites are built by assigning domains and subdomains to sets of applications and URL paths.

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 Domains in the dashboard sidebar.

  3. Click the button labeled "Add Site" in the upper-right corner of the content area.

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

  5. Select the site server from the Server list.

  6. Select the site IP address for the site from the IPv4 address list.

  7. If you want Opalstack to generate and manage a free SSL certificate for your site then select the Automatic Let's Encrypt Certificate option.

  8. If you have your own SSL certificate that you want to use for the site, then deselect the Automatic Let's Encrypt Certificate option and select your certificate from the Certificate list. See Managing SSL Certificates for more information.

  9. If you want all site traffic to be directed to HTTPS, then select the Encrypt All Traffic option.

  10. Click the "Add Domain to Site" button to assign domains to the site. Assigned domains can be unassigned by clicking the delete button (a trash bin) that appears next to the assigned domain. Doing so does not delete the domain itself, in only removes it from the site configuration.

  11. Click the "Add Application to Site" button to assign applications to their URLs on the site. Assigned apps can be unassigned by clicking the delete button (a trash bin) that appears next to the assigned apps. Doing so does not delete the app itself, it only removes it from the site configuration.

    1. Select the application that you want to serve from the site.
    2. Enter the URL 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 URL path.

      Important

      URL paths are not folders or directories on the server. They are the URLs from which your site will serve the assigned applications. For example, if you have an app named blog and want to serve that at http://domain.com/ then use / as the URL path.

  12. When you are finished, click the "Add Site" button. The new site record will appear in the site list and its status will update to show you when the site is ready. The domains and subdomains assigned to the site will show an activity indicator in the domain list, indicating that the automatically-generated DNS records for your site domains are being updated.

Editing Sites

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

  1. Click on Domains in the dashboard sidebar.

  2. Click the Edit icon for the site in the lower section of the page.

  3. Edit your site's configuration as desired. The available options are described in Adding Sites.

  4. When you are finished, click the "Update Site" button.

Viewing API Details for Sites

You can view the API details for your sites via your Opalstack dashboard.

  1. Click on Domains in the dashboard sidebar.

  2. Click the API icon (brackets) for the site in the lower section of the page. A window with the JSON API representation of the site will appear.

  3. When you are finished, click the "Close" button.

Deleting Sites

  1. Click on Domains in the dashboard sidebar.

  2. Click the delete icon (a trash bin) for your site in the lower section of the page.

  3. A confirmation prompt will appear. Click the "Delete Site" button to confirm the operation, or click the cancel button to cancel it.

  4. The site will disappear from the site list a few seconds later.

Note that deleting a site does not delete the domains, applications, and certificates attached to the site - it only deletes the site configuration from the dashboard and removes the site from the web server configuration.