This topic describes how to use Drupal to deploy an e-commerce website on a CentOS
7 ECS instance.
Prerequisites
- An Alibaba Cloud account is created. To create an Alibaba Cloud account, go to the
account registration page.
- An ECS instance that has a public IP address is created and deployed with a LAMP environment.
For more information, see Build a LAMP environment.
Background information
Drupal is an open source content management framework (CMF) written in PHP. Drupal
consists of a content management system (CMS) and a PHP development framework. You
can use Drupal to build dynamic websites that provide various features and services.
Drupal is commonly used in a variety of applications, from personal blogs to large
communities.
This topic is intended for users who are familiar with Linux, but new to web development
on Alibaba Cloud ECS instances. You can also build a Drupal website based on an Alibaba
Cloud Marketplace image. For more information, see Build a Drupal website based on an Alibaba Cloud Marketplace image.
Configuration
The following instance configurations and software versions are used in the example.
The operations may vary depending on your instance configurations and software versions.
- Instance type: ecs.c6.large
- Operating system: CentOS 7.8 64-bit
- Apache HTTP Server: 2.4.6
- MySQL: 5.7.31
- PHP: 7.0.33
- Drupal: 8.1.1
Configure the database information
- Use a local browser to access http://<Public IP address of the instance>/phpMyAdmin.
- Use the username and password of a MySQL database to log on to phpMyAdmin.
- At the top of the page, click SQL.
- Create a database and user for Drupal.
Enter the following SQL statement in the editor:
CREATE DATABASE <DrupalDBName>;
CREATE user '<UserName>'@'<IP>' IDENTIFIED BY '<UserPassWord>';
FLUSH PRIVILEGES;
Specify the parameters in the SQL statement:
<DrupalDBName>
: Specify a name for the database.
<UserName>
: Specify a user for the database.
<IP>
: Specify the IP address of the local host or 127.0.0.1.
<UserPassWord>
: Specify a password for the database.
Note You can execute the show variables like 'validate_password%';
SQL statement to query the password strength rules for the database.
- Click Go.
Install Drupal
- Connect to an ECS instance in which an LAMP environment is deployed.
- Download and configure Drupal.
- Download the Drupal installation package.
cd
wget http://ftp.drupal.org/files/projects/drupal-8.1.1.zip
- Decompress the Drupal installation package and move the installation files to the
root directory of your Apache website.
yum install unzip -y
unzip drupal-8.1.1.zip
mv drupal-8.1.1/* /var/www/html
- Modify the owner and group of the sites directory.
chown -R daemon:daemon /var/www/html/sites
- Restart the Apache service.
- Use a browser to access the website and install Drupal.
- User a local browser to access <Public IP address of the ECS instance> and go to the Drupal installation page. Select the installation language from the
Choose language drop-down list, and then click Save and continue.
- Select Standard, and click Save and continue.
- Enter the information of the configured database, click Save and continue.
- After the installation is complete, go to the website settings page, enter website
information, and then click Save and continue.
What to do next
After the installation is complete, you can customize your website pages.