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 WHM — NOT Root WHM — for that server.
Create the cPanel User Account
- Click on List Accounts.
- Click Create a New Account.
- Under Domain Information :
- Type your domain name into the domain input box.
- Save whatever you use for the username and password somewhere safe.
- Under Package, click on Select Options Manually
- Under Manual Resource Options :
- Optionally set a disk space quota - internally we like
50000
MB (50
GB), but this heavily depends on the project - Set both Maxed Parked Domains and Max Addon Domains to unlimited
- Optionally set a disk space quota - internally we like
- Disable Dedicated IP, unless this contract included a dedicated server.
- Enable Shell Access
- 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.)
- Under DNS Settings :
- Enable DKIM
- Enable SPF
- Click Create
- Return to List Accounts from the left panel.
- 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.
- Under the account’s cPanel Dashboard, click on Domains.
- Click on Create A New Domain.
- Type your subdomain in the Domain box. We recommend
notifications.website.com
(replacingwebsite.com
with your own domain name). You will want to save this somewhere for later reference. - Uncheck the Share document root option.
- Click on Submit.
- Return to the cPanel Dashboard and click on Email Accounts.
- Click on the + Create button.
- Select the subdomain you setup earlier from the dropdown list labeled Domain.
- Type in a username — we like
hello
oralerts
- 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.
- Click on the + Create button.
- 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
- Under the account’s cPanel Dashboard, click on MySQL® Databases.
- Under Create Database, type the suffix you want to use and click Create Database. We generally use
db
for the suffix. - 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.
- 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.
- If you have database tables you want to import, you can now return to the cPanel dashboard and click on PHPMyAdmin to do so.
- 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 toutf8mb4_unicode_ci
.
Create the Symfony Project Structure
- Under the account’s cPanel Dashboard, click on File Manager.
-
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.): -
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 toprod
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
andTURNSTILE_SECRET_KEY
should be updated to the turnstile widget for the site setup in the Cloudflare dashboard.GA4_PROPERTY_ID
,GA4_CLIENT_ID
, andGOOGLE_AUTH_CONFIG
should be configured to match their Google Analytics account and Google Developer Console project.
-
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.
Symbolically Link the Apache Root Project
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.*
- Under the account’s cPanel Dashboard, click on Domains.
- 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. - Return to the account’s cPanel Dashboard and click on Terminal.
-
Start by deleting
public_html
(if it is not in use) by running: -
Create the symbolic link by running:
Authorize IWW Composer Packages
- Under the account’s cPanel Dashboard, click on Terminal.
- Run the following, which will add our repman.io authorization token to the user’s composer config: