abry.rath of UNION Developers
11/1/2018 - 5:28 PM

Liquidweb Server Setup

Steps/checklist for creating a new site on an existing server on Liquidweb

Setting up a new server on Liquidweb

  1. Log in to vps1.union.co WHM (1password)
  2. Create a new Account (Account Functions > Create a New Account)
    1. Fill in domain
    2. Generate a password in 1password, and use the new password
      1. Duplicate an existing cPanel entry in 1password to ensure you are using the correct format
    3. Add a new email address (will be created below)
    4. Package: default
    5. Click 'Create'
  3. List accounts and verify the new account is shown (Account Information > List Accounts)
  4. From List Accounts, go to the new cPanel by clicking the CP Icon
  5. Create a Production and Staging Database/User
    1. MySQL Database Wizard
      1. Step 1: Create A Database
        1. Enter a database name, e.g. _prod or _staging
      2. Step 2: Create Database Users
        1. Use the same username as the database, generate a password in 1password just like the cPanel entry
      3. Grant all privileges for the user and continue
  6. Configure SSH keys
    1. SSH into the server using the cPanel username/password, e.g. ssh-copy-id <username>@domain; ssh <username>@domain
    2. Generate a new key pair
      1. ssh-keygen, use defaults (press Enter until complete)
      2. cat ~/.ssh/id_rsa.pub and copy the output (this is the server's public key)
    3. Log in to Beanstalk with the Admin user (in 1password)
      1. Add a new SSH key (paste from the output in 6.2.2)
    4. Get the Beanstalk deployment SSH key from Account > Security > Account-wide deployment key
      1. Copy and paste (append) this value to the newly provisioned site
        1. SSH into the server (if not already connected)
        2. vi ~/.ssh/authorized_keys and paste the Beanstalk deployment key
  7. Create a sites/ directory and clone the repository for production and staging
    1. SSH into the server (if not already connected)
    2. Create the sites directory mkdir -p ~/sites
    3. Clone the production repo cd ~/sites && git clone <repo_url> -b master <production_url>
    4. Clone the staging repo cd ~/sites && git clone <repo_url> -b staging <staging_url>
    5. Perform site-specific tasks in each site, e.g. create .env file with DB credentials, etc.
  8. Create Beanstalk deployments for each site
    1. Self-explanatory, check another site's deployment for specifics
    2. Test deployments

Recommended Settings (varies by site requirements)

New sites should use PHP-FPM.

For production sites on their own VPS, we want to increase the PHP-FPM max children and max requests.

  1. Enable PHP-FPM:
    1. Go to MultiPHP Manager
    2. Set the appropriate PHP version
    3. Toggle PHP-FPM (last table column)
  2. Tweak FPM Settings
    1. From the MultiPHP Manager, click 'Edit PHP-FPM' in the last table column
    2. Set Max Requests = 500 (May vary based on requirements)
    3. Set Max Children = 20 (May vary basd on requirements)
    4. Save Configuration