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
- Navigate to the
server provisioning scripts
repository. - Locate the
SiteVarsExamples
directory. - Copy the
example_production.yml
file fromSiteVarsExamples
toSiteVars
.
cp SiteVarsExamples/example_production.yml SiteVars/
Step 2: Edit Configuration File
- Open the copied
example_production.yml
file in a text editor. - Update the
webhost_alias
to match one of the available Pro Servers. For example,vp82
.
webhost_alias: vp82
- Set the
environment_name
toproduction
. - Update the
project_name
to your project name, e.g.,example
. - Configure the
domains
section with your project's domains.
domains:
- example.at
- www.example.at
- Define the
prefixes
for your project.
prefixes:
- example_production
- example_production/current
Step 3: Configure SSL Certificates
- In the
dehydrated
section, list all domains for SSL certificate generation.
dehydrated:
domains:
- example.at
- www.example.at
- example.com
- www.example.com
- 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
- 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
- Set the database name and username in the
mariadb
section.
mariadb:
name: example-production
user: example-production
- 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
- 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
- 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.