Although Acquia maintains the core platform of Site Factory, you have the freedom to develop your websites to meet your specific needs, including selecting a Drupal distribution to use for the websites on your platform.
If you have some websites running different major versions of Drupal, and others requiring Drupal 7, you must manage them in separate Site Factory stacks. A single stack can only operate one major version of Drupal at a time. For more information, see Using Site Factory Stacks.
To ensure your websites using a custom distribution can communicate with Site Factory and the Site Factory Management Console, you must install the Acquia Connector module in your distribution’s code.
Drupal 7-based distribution instructions
For Drupal 7 installation and configuration instructions with Site Factory, see Building your Drupal 7 distribution.
Although Site Factory uses Drupal’s native multisite features for governance and resource efficiency, the distribution of Drupal used by Site Factory is ultimately your responsibility. You must remember your Site Factory-hosted websites will have separate databases, content, and user account—they are all in a single multi-tenant application. When granting Drupal users elevated platform admin or site builder permissions, these permissions may include permission to run PHP code using Drupal’s user interface, based on your configuration.
Acquia recommends the following security practices:
To install a Drupal 9 or later distribution in your Site Factory codebase and prepare it for use:
Add your SSH key to Cloud Platform, and then clone the website’s code repository to your local machine.
On your local machine, delete all files and subdirectories in the
docroot
directory you cloned from Site Factory. When
removing its contents, don’t delete the actual docroot
directory.
You can run the following Git command from the docroot
directory
to remove the files:
git rm -r * .htaccess .gitignore
Do not run the previous Git command after you have installed your Drupal
distribution in the docroot
directory.
Move your custom Drupal distribution into the now empty docroot
directory.
After moving the distribution, the docroot
directory should contain the
distribution’s index.php
file, along with all other files and
subdirectories.
Install the Site Factory Connector module to your codebase as described in Updating with the acsf-init command.
Ensure each of the following files can be read, written to, and executed by its owner, its group, and by other users:
hooks/common/pre-web-activate/000-acquia-deployment.php
hooks/common/post-db-copy/000-acquia_required_scrub.php
To set the correct permissions on Unix-like operating systems, use a command like the following example:
chmod 0755 [file names]
After installing your distribution, you must configure it for use.
To configure your Drupal 9 or later distribution for use with your websites, you can either use BLT, or you can use a manual process.
To configure your distribution with BLT, perform the following steps as described in the BLT documentation after configuring BLT:
From the project’s docroot
directory, run blt acsf:init
.
Create a profile using the Drupal Console. For more information about installation profiles, see Installation profiles on Site Factory.
Add acsf
as a dependency for your profile.
Edit the blt/project.yml
file. In the project
section, edit
the profile
key to use the newly created custom profile based on
the following example, replacing mycustomprofile
with the name of
your profile:
project:
machine_name: blted8
prefix: BLT
human_name: 'BLTed 8'
profile:
name: mycustomprofile
Save your changes.
Deploy to your Git repository with the blt deploy
command, or
through your continuous integration configuration.
If you use continuous integration, push your build artifact to your production or non-production environment.
If your custom distribution includes more than one installation profile, enable any installation profiles you want available to website builders when creating new websites.
Your new custom Drupal distribution is now configured and available for use.
If you do not use BLT to manage your distribution, complete the following steps to configure your new distribution:
Configure your installation profiles to require the module using the
appropriate instruction by adding the following line to your profile’s
installation profile file at
profiles/[profilename]/[profilename].info.yml
, where [profilename]
is the name of your profile:
- acsf
Run the following Drush command from the docroot
directory to
initialize your custom distribution:
drush --include=/path/to/acsf/acsf_init acsf-init
Note
This command does not bootstrap a Drupal website, so you must run it
with the --include
argument pointing to
acsf/acsf_init/acsf_init
.
The previous Drush command creates several directories, and then copies files Site Factory requires for its tasks, including locating the correct database credentials.
Run the following Drush command from the docroot
directory to
ensure everything is in order before you commit the custom
distribution to the repository:
drush --include=/path/to/acsf/acsf_init acsf-init-verify
The command should return the following result:
acsf-init required files ok
Commit and push your custom distribution’s files to Site Factory.
Update your Production environment with the custom distribution’s files that you just pushed.
If your custom distribution includes more than one installation profile, enable any installation profiles you want available to website builders when creating new websites.
Your new custom Drupal distribution is now configured and available for use.
Note
Single sign-on for applications running Drupal 9 or later requires special configuration. For configuration information, see Setting up single sign-on.
After installing and configuring your new Drupal distribution, website builders can select the distribution for their use when creating new websites. For more information about selecting your custom profile when creating a new Site Factory website, see Managing installation profiles in your Factory.