Full TranscriptionTechnical Terms GlossaryStep-by-Step Server SetupSSL Certificate ConfigurationDatabase Setup

Step-by-Step Server Setup

Introduction

This guide will walk you through the process of setting up a new server project on the Pro Server. We will cover everything from initial configuration to SSL certificate setup and database configuration.

Prerequisites

Before you begin, ensure you have access to the following:

  • Pro Server repository (server provisioning scripts)
  • Ansible installed
  • 1Password Command-Line Interface configured

Step 1: Copy Configuration Files

  1. Navigate to the server provisioning scripts repository.
  2. Locate the SiteVarsExamples directory.
  3. Copy the example_production.yml file from SiteVarsExamples to SiteVars.
cp SiteVarsExamples/example_production.yml SiteVars/

Step 2: Edit Configuration File

  1. Open the copied example_production.yml file in a text editor.
  2. Update the webhost_alias to match one of the available Pro Servers. For example, vp82.
webhost_alias: vp82
  1. Set the environment_name to production.
  2. Update the project_name to your project name, e.g., example.
  3. Configure the domains section with your project's domains.
domains:
  - example.at
  - www.example.at
  1. Define the prefixes for your project.
prefixes:
  - example_production
  - example_production/current

Step 3: Configure SSL Certificates

  1. In the dehydrated section, list all domains for SSL certificate generation.
dehydrated:
  domains:
    - example.at
    - www.example.at
    - example.com
    - www.example.com
  1. Set up HTTP to HTTPS redirects in the redirects section.
redirects:
  - from: http://example.at
    to: https://example.at
  - from: http://www.example.at
    to: https://example.at
  - from: http://example.com
    to: https://example.com
  - from: http://www.example.com
    to: https://example.com

Step 4: Exclude Cache Parameters

  1. Specify any URL query parameters that should not create new cache entries in the nginx_cache_exclude_params section.
nginx_cache_exclude_params:
  - date

Step 5: Configure Database

  1. Set the database name and username in the mariadb section.
mariadb:
  name: example-production
  user: example-production
  1. Encrypt and set the database password using Ansible Vault.
source env-rc
ansible-vault encrypt_string 'your_password' --name 'password'

Copy the encrypted password and paste it in the password field.

password: !vault |
          $ANSIBLE_VAULT;1.1;AES256
          6137336639663764373365396132636662313230333132313431313730383533
          3832373535396238633731313530663730646137303966390a3333326166643136
          663937623566353163643862643334343036363136333461613834323633343264
          6439653134336231350a3131653630326631376634393834326430656135376237
          3732

Step 6: Provision and Configure Site

  1. Run the provision_and_configure_site.yml playbook to provision and configure the site.
ansible-playbook provision_and_configure_site.yml -e project=example_production
  1. Ensure DNS settings point to the server for SSL certificate validation.

Conclusion

You have now successfully set up a new server project on the Pro Server. If you encounter any issues, refer to the Full Transcription or the Technical Terms Glossary for additional information.

Read more

Full Transcription

Technical Terms Glossary

Step-by-Step Server Setup

SSL Certificate Configuration

Database Setup

Made with VideoToPage.com