This topic describes how to use Drupal to deploy an e-commerce website on an ECS instance that runs CentOS 7.
You must have registered an Alibaba Cloud account before you follow the instructions provided in the tutorial. If not, create a new Alibaba Cloud account first.
Drupal is a free and 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.
The procedure described in this topic is applicable to users that are familiar with Alibaba Cloud ECS instances and Linux, but new to website construction on ECS instances.
- Operating system: CentOS 7.2
- Apache: Apache 2.4.25
- MySQL: MySQL 5.7.17
- PHP: 7.1.1
- Drupal: 8.1.1
Step 1: Activate an ECS instance
Activate an ECS instance to build a small-sized website for personal use. Later, you can upgrade the instance or optimize the architecture based on your needs.
Step 2: Deploy the web environment
- Image deployment
- Deployment by using an installation package
- Manual deployment: Build the environment by using the source code or Yellowdog Update, Modified (YUM).
For new users, we recommend that you use an image to deploy the web environment. This is an easy way to set up a web environment. If you have some basic knowledge of Linux operations and maintenance, you can use an installation package, the source code, or the YUM utility to customize the web environment. This topic describes how to build a Drupal website by using an image.
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- On the Instances page, click .
- In the Image section of the Custom Launch tab, choose .
- Enter LAMP in the search bar and select the image that matches your operating system. Select
a LAMP image that is suitable for CentOS 7.2.
You can also go to Alibaba Cloud Marketplace to search for and purchase the images that you want to use.
- Click Apply.
- On the Custom Launch page, scroll down to the Image section. The custom image you purchased is automatically selected. Complete other settings and activate the ECS instance as instructed. For more information, see Create an instance by using the provided wizard.
Step 3: Install Drupal
To install Drupal, perform the following steps:
- Download the Drupal installation package:
- Decompress the package to your website root directory:
mv drupal-8.1.1/* /var/www/html/
- Specify the owner and group of the sites directory:
chown -R apache:apache /var/www/html/sites
- Restart the Apache service:
# /etc/init.d/httpd restart
- In the address bar of your browser, enter <Public IP address of an ECS instance>/index. php to go to the Drupal installation page. Select the required language from the Choose
Language drop-down list, and click Save and continue.
- Select Standard, and click Save and continue.
- Enter database information, and click Save and continue.
Note After you log on to the MySQL database, you can run the following commands to set the database information:
- DBNAME: database name
- UAERNAME: username
- IP: localhost or 127.0.0.1 for a local host
- YOURPASSWORD: database password
mysql> CREATE DATABASE DBNAME; mysql> CREATE USER UAERNAME; mysql> GRANT ALL PRIVILEGES ON *. * TO 'UAERNAME'@'IP' IDENTIFIED BY 'YOURPASSWORD' WITH GRANT OPTION; mysql> FLUSH PRIVILEGES;
- After the installation is complete, go to the website settings page, enter site information, and then click Save and continue.