This topic describes how to use Drupal to deploy an e-commerce website on a CentOS 7 ECS instance.

Prerequisites

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 use Alibaba Cloud Marketplace images to quickly build a Drupal website. For more information, see Build a Drupal website based on an Alibaba Cloud Marketplace image.

Configurations

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.2 64-bit
  • Apache 2.4.43
  • MySQL 5.6.24
  • PHP 7.0.32
  • Drupal 8.1.1

Configure the database information

  1. Access http://<the public IP address of the instance>/phpMyAdmin through a local browser.
  2. Use the username and password of a MySQL database to log on to phpMyAdmin.
  3. At the top of the page, click SQL.
  4. Create a database and user for Drupal.
    Enter the following SQL statements in the field and configure the following parameters:
    • DrupalDBName: Specify a name for the database.
    • UserName: Specify a user for the database.
    • IP address: Specify localhost or 127.0.0.1 for the local host.
    • UserPassWord: Specify a password for the database.
    CREATE DATABASE drupalDBName;
    CREATE USER UserName;
    GRANT ALL PRIVILEGES ON *. * TO 'UserName'@'IP' IDENTIFIED BY 'UserPassWord' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
  5. Click Go.

Install Drupal

  1. Connect to an ECS instance in which an LAMP environment is deployed.
    For more information about the remote connection methods, see Connect to a Linux instance from the console.
  2. Download and configure Drupal.
    1. Download the Drupal installation package.
      wget http://ftp.drupal.org/files/projects/drupal-8.1.1.zip
    2. Decompress the package to your website root directory.
      yum install unzip -y
      unzip drupal-8.1.1.zip 
      mv drupal-8.1.1/* /usr/local/apache2/htdocs
    3. Modify the owner and group of the sites directory.
      chown -R daemon:daemon /usr/local/apache2/htdocs/sites
    4. Restart the Apache service.
      systemctl restart httpd
  3. Access Drupal through a browser and install Drupal.
    1. Access <the public IP address of the ECS instance> through a local browser to go to the Drupal installation page. Select the required language from the Choose language drop-down list, and then click Save and continue.
      Select the required language
    2. Select Standard, and click Save and continue.
    3. Enter the information of the configured database, click Save and continue.
    4. 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.