You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Building websites
Setting up a Drupal website
Copy page
Download PDF
Setting up a Drupal website
Drupal is an open-source content management framework written in PHP, consisting of a content management system and a PHP development framework. Drupal integrates powerful and freely configurable features, supporting website projects ranging from personal blogs to large community-driven sites and other various application types.​
Software versions​
  • Operating system: In the example provided in this topic, CentOS 7.6 is used.​
  • Apache: A web server with stable performance. In the example provided in this topic, Apache 2.4.6 is used.​
  • MySQL/MariaDB: A database management system. In the example provided in this topic, MySQL 14.14 is used.​
  • PHP: A server-side scripting language embedded in HTML documents. In the example provided in this topic, PHP 7.0.33 is used.​
  • Drupal: In the example provided in this topic, Drupal 8.1.1 is used.​
Prerequisites​
A Linux instance is purchased and a LAMP environment is set up. For more information, see Setting up a LAMP environment (CentOS 7).​
Step 1: Create a database for Drupal​
  1. Execute the following command to access the MySQL database as the root user. The password of the root user is the one you specified during MySQL configuration.​
  • ​
    mysql -u root -p​
    ​
  1. Execute the following command to create a database for Drupal.​
  • ​
    create database database_name;​
    ​
  1. Create a user for the database created for Drupal.​
  • ​
    create user 'username'@'localhost' identified by 'Password';​
    ​
  1. Grant all permissions to the user.​
  • ​
    grant all privileges on database name.* to 'username'@'localhost';​
    ​
  1. Execute the following command to make the preceding commands take effect.​
  • ​
    flush privileges;​
    ​
  1. Execute the following command to exit the MySQL database.​
  • ​
    exit​
    ​
Step 2: Download and configure Drupal​
  1. Execute the following command to download Drupal.​
  • ​
    wget http://ftp.drupal.org/files/projects/drupal-8.1.1.zip​
    ​
  1. Execute the following command to decompress the Drupal installation package.​
  • ​
    unzip drupal-8.1.1.zip​
    ​
  1. Execute the following command to move the Drupal files to the website root directory.​
  • ​
    mv drupal-8.1.1/ /var/www/html/drupal​
    ​
  1. Execute the following command to enter the website root directory of Drupal.​
  • ​
    cd /var/www/html/drupal​
    ​
  1. Execute the following command to download the Chinese translation package.​
  • ​
    wget -P sites/default/files/translations https://ftp.drupal.org/files/translations/8.x/drupal/drupal-8.7.8.zh-hans.po​
    ​
  1. Modify the Drupal configuration file.​
  1. Execute the following command, and press the i key to enter the edit mode.​
  • ​
    vim /etc/httpd/conf/httpd.conf​
    ​
  1. Change the AllowOverride None setting in the specified location in the following figure to AllowOverride All.​
  • ​alt​​
  1. Press Esc, enter :wq, and press Enter to save and exit the file.​
  1. Execute the following command to modify user permissions on the website root directory.​
  • ​
    chown -R apache:apache /var/www/html/drupal​
    ​
  1. Execute the following command to restart the Apache service.​
  • ​
    systemctl restart httpd​
    ​
Step 3: Install Drupal​
  1. In your local browser, enter http://<ECS instance EIP>/drupal to access the Drupal website.​
  1. Select the installation language, and click the "Save and Continue" button.​
  1. Select the standard installation method, and click the "Save and Continue" button.​
  1. Configure the database, enter the database name, username, and password specified in Step 2: Download and configure Drupal. Then, click the "Save and Continue" button.​
  1. Wait until the website and the translation package are installed. Then, configure the website information based on your business requirements and click the "Save and Continue" button.​
  1. After the installation is complete, you are automatically logged in to the website. You can specify custom settings for the website based on your business requirements.​
Step 4 (Optional): Enable HTTPS for the website.​
When a user accesses your website over the HTTP protocol, the browser warns the user that the connection is not secure. We recommend that you enable HTTPS secure communication for your website. This ensures encrypted data transmission between users and your website, effectively defending against network hijacking, information leakage, and other threats.​
To enable HTTPS, you need to deploy an SSL certificate on your website. You can apply for a free SSL certificate in the Volcano Engine Certificate Center. For more information, see Applying for free certificate and Downloading and installing certificate.​
Last updated: 2026.06.18 19:52:58