Skip to content

Preparing the cPanel User Environment

Required Information

You will need to have your domain name handy for the following steps. During the development phase, we generally create a temporary subdomain to use such as projectname.iwwsite.com. Refer to your domain registrar for more.

Once you’ve decided which server your project will live on, open WHMNOT Root WHM — for that server.

Create the cPanel User Account

  1. Click on List Accounts.
  2. Click Create a New Account.
  3. Under Domain Information :
    • Type your domain name into the domain input box.
    • Save whatever you use for the username and password somewhere safe.
  4. Under Package, click on Select Options Manually
  5. Under Manual Resource Options :
    • Optionally set a disk space quota - internally we like 50000MB (50GB), but this heavily depends on the project
    • Set both Maxed Parked Domains and Max Addon Domains to unlimited
  6. Disable Dedicated IP, unless this contract included a dedicated server.
  7. Enable Shell Access
  8. Under Mail Routing Settings select the option that you need :
    • Use Local Mail Exchanger if the project is using cPanel’s built-in email
    • Use Remote Mail Exchanger if the project is sending email with an external resource (Postmark, SendGrid, Google Business, Microsoft 365 Business, etc.)
  9. Under DNS Settings :
    • Enable DKIM
    • Enable SPF
  10. Click Create
  11. Return to List Accounts from the left panel.
  12. Record the listed IP Address of the account somewhere safe — you will need this later.

Create the SMTP Email Outbox

You can skip this step if you already have SMTP credentials for an external email account that will be used.

We recommend using a subdomain for application email accounts. This allows users to later use an external email service for their main domain with less hassle & migration work.

  1. Under the account’s cPanel Dashboard, click on Domains.
  2. Click on Create A New Domain.
  3. Type your subdomain in the Domain box. We recommend notifications.website.com (replacing website.com with your own domain name). You will want to save this somewhere for later reference.
  4. Uncheck the Share document root option.
  5. Click on Submit.
  6. Return to the cPanel Dashboard and click on Email Accounts.
  7. Click on the + Create button.
  8. Select the subdomain you setup earlier from the dropdown list labeled Domain.
  9. Type in a username — we like hello oralerts
  10. Enter a password — avoid using special characters if you can help it, as it will prevent the need to later URL encode your credentials. Letters and numbers! Save this somewhere close, as you will need it later.
  11. Click on the + Create button.
  12. Now click on the Connect Devices button next to the email account you set up and record the Secure SSL/TLS Outgoing Server credentials somewhere safe, as you will also need this later.

Create the Database

  1. Under the account’s cPanel Dashboard, click on MySQL® Databases.
  2. Under Create Database, type the suffix you want to use and click Create Database. We generally use db for the suffix.
  3. Under MySQL Users, create a new Username and Password. Try to avoid special characters in the password so that you don’t have to URL encode it later. Click Create User.
  4. Under Add User To Database, select the user and the database you just made and click Add. Add the permissions your application needs when interacting with the database.
  5. If you have database tables you want to import, you can now return to the cPanel dashboard and click on PHPMyAdmin to do so.
  6. IMPORTANT: Ensure the database collation is set to utf8mb4_unicode_ci to avoid encoding issues. You can do this by clicking on the database name in PHPMyAdmin, then clicking on the Operations tab, and setting the collation to utf8mb4_unicode_ci.

Create the Symfony Project Structure

  1. Under the account’s cPanel Dashboard, click on File Manager.
  2. In the user’s home directory, create the following file and folder structure (We name the directory @symfony, but you can use another name if needed.):

    📁 (/home/username)
    └── 📁 @symfony/    perm: 0750
        ├── 📁 public/  perm: 0750
        └── 📄 .env     perm: 0644
    
  3. Copy the contents of your local .env into the one you created on the server. You will need to adjust several values to use production services instead of local development services. Here are just some examples of values you may need to adjust:

    • APP_ENV must be set to prod
    • DATABASE_URL should be updated to a valid database URL.
    • MAILER_FROM should be updated to the appropriate sender name and address.
    • MAILER_DSN should be updated with a valid mailer DSN.
    • TURNSTILE_SITE_KEY and TURNSTILE_SECRET_KEY should be updated to the turnstile widget for the site setup in the Cloudflare dashboard.
    • GA4_PROPERTY_ID, GA4_CLIENT_ID, and GOOGLE_AUTH_CONFIG should be configured to match their Google Analytics account and Google Developer Console project.
  4. From this point, you can use whatever method you like to copy the rest of your local project into the above folders. We recommend setting up automatic deployments from Github, which we will cover later.

By default, InMotion’s Apache server is configured with a document root (usually public_html). We want to make it so that whenever Apache loads that folder, it will instead load @symfony/public. We can do that by creating a symlink in the filesystem.*

  1. Under the account’s cPanel Dashboard, click on Domains.
  2. Note the name of the Document Root for the domain you are targeting. The next steps will assume this value is public_html. If it isn’t, then replace those instances with the document root that you see.
  3. Return to the account’s cPanel Dashboard and click on Terminal.
  4. Start by deletingpublic_html (if it is not in use) by running:

    rm -rf public_html
    
  5. Create the symbolic link by running:

    ln -s @symfony/public public_html
    

Authorize IWW Composer Packages

  1. Under the account’s cPanel Dashboard, click on Terminal.
  2. Run the following, which will add our repman.io authorization token to the user’s composer config:
    composer config --global --auth http-basic.integrated-webworks.repo.repman.io token $(wget -qO- https://stat.iwwsite.com/api/composer/auth)