Toggle navigation

Drupal Image Guide

Version 8.2.6

Websoft9 Drupal is a pre-configured, ready to run image for running Drupal on Alibaba Cloud.

Drupal is content management software. It’s used to make many of the websites and applications you use every day. Drupal has great standard features, like easy content authoring, reliable performance, and excellent security. But what sets it apart is its flexibility; modularity is one of its core principles. Its tools help you build the versatile, structured content that dynamic web experiences need.

Software Version: Drupal8.2.6
Software directory: /data/wwwroot/default/drupal

Basic software environment: LAMP
PHP Configuration File: /usr/local/php/etc/php.ini
Virtual host Configuration File directory: /usr/local/apache/conf/vhost.sh
Virtual host Configuration Command: /root/oneinstack/vhost

Database install directory: /usr/local/mysql
Database data directory: /data/mysql
Database Configuration File: /etc/my.cnf

After the installation of Image,please verify it

  • Login on Alibaba Cloud console,get you Internet IP Address
  • Open you Chrome or Firefox on your local PC,visit the http://Internet IP Address/
  • If verify successfully,you can enter the boot page of Websoft9 below
  • If no response from browser,please check the Security Group settings to ensure that port 80 is been allowed

This Image use MySQL for database

#default user/password:root/123456

MySQL User Guide: Click here

Step1. Create a database

1.login in MySQL:

Method 1:Use following URL to open phpMyAdmin page: http://< Public net IP >/phpMyAdmin

Method 2:Use SSH command to login in.

mysql -uroot –p                      #enter mysql console

 #default user/password:root/123456            More MySQL User Guide: Click here

 

2.create a database:

MySQL [(none)]> create database mydbname;

MySQL [(none)]> show databases;

 

3.Create a Database User and grants permissions to the User:

MySQL [(none)]> grant all privileges on mydbname.* to username@’localhost’ identified by ‘userpassword’;

MySQL [(none)]> flush privileges;

MySQL [(none)]> exit;

before2

Step2. Add a virtual host

Use SSH Command to Add a virtual host:

[root@iZbp1i4rjdsy216yq7lgucZ ~]# cd /root/oneinstack

[root@iZbp1i4rjdsy216yq7lgucZ oneinstack]# ./vhost.sh

Step3. Install Drupal

Open your domain name via browser:
1. Choose a language,Click “Save and continue”;

2. Click “Save and continue”;

3. Fill in your Database configuration, Click “Save and continue”;

4. The page appears, please wait a moment;

5. Fill in your Site configuration, Click “Save and continue”;


6. OK, it has been installed successfully.

Modules provide functionality to your site, and the ‘core modules’, which are included in a standard installation, provide all of the basic functions that most sites need.

Some of the core modules, however, are not enabled (turned on) by default. Therefore, you might want to examine the module list on the ‘Extend’ page of your site to see whether or not some functionality you seek is available from a core module that is not enabled, before you spend time investigating contrib modules.

Install Module

  1. Enter the Module page of Drupal,search the Module suitable for the core compatibility
  2. Get one Module’s url address or download it.
    e.g.https://ftp.drupal.org/files/projects/admin_toolbar-8.x-1.19.tar.gz
  3. Go to your ‘Extend’ page, and near the page-top, just under the word ‘Extend’, you should see the button/link “Install new module”.
  4. Paste the URL, which you have ‘copied’, into the box for: ‘Install from a URL’.
  5. or upload the module file *.tar.gz file, or the *.zip file. (Windows: use *.zip) and click the “Install” button
  6. On the next page that loads, you will see “Installation was completed successfully.”
  7. Click the link “Enable newly added modules” to return to the Drupal ‘Extend’ page.

note:If you do not see the button/link “Install new module” at the top of the ‘Modules’ page, return above to this page’s section Enable the Drupal core module ‘Update manager’ ⤴ and carefully follow all of the steps outlined there.

Enable Module

You should enable the module after the installation of module

  1. go to Administration->Manage->Extend,you can see the modules list
  2. select the module which you want to enable
  3. Click the “Install” button,you will receive the message like “2 modules have been enabled: Admin Toolbar, Admin Toolbar Extra Tools.”

Drupal places all core code and themes under a directory named /core/ and all contrib or custom themes in webroot directory /themes. /sites/all/themes

Install Themes

You can install the themes online that similar with the Module’s installation

  1. Enter the Themes page of Drupal,search the Module suitable for the core compatibility
  2. Get one Theme’s URL address or download it.
    e.g.https://ftp.drupal.org/files/projects/adminimal_theme-8.x-1.3.tar.gz
  3. Administration->Appearance,sytem list all the themes for you.Click the “Install the theme”
  4. Paste the URL, which you have ‘copied’, into the box for: ‘Install from a URL’.
  5. or upload the Theme file *.tar.gz file, or the *.zip file. (Windows: use *.zip) and click the “Install” button
  6. On the next page that loads, you will see “Installation was completed successfully.”

 

Complete Theme Installtaon

You should enable the module after the installation of module

  1. go to Administration->Appearance,you can see the modules list
  2. Find the “Uninstalled themes”,and the “install” link on the your theme
  3. then select one theme as “Set as default”

You must do some backups for any restore later,it is very import.

Any backup method of Drupal,you should backup program files and databases.

 

Manual Backup

  1. Download the entire Drupal file in you root dictionary by FTP or other tools
  2. Visit http://< Public net IP >/phpMyAdmin,login in to the phpMyAdmin Panel
  3. Select you database,then Export
  4. Click “go” button,then download the backup file

Using Module:Backup and Migrate

Backup and Migrate is a very popular Module for Backup of Drupal.It can back up and restore your Drupal MySQL database, code, and files or migrate a site between environments. Backup and Migrate supports gzip, bzip and zip compression as well as automatic scheduled backups.

With Backup and Migrate you can dump some or all of your database tables to a file download or save to a file on the server or offsite, and to restore from an uploaded or previously saved database dump. You can choose which tables and what data to backup and cache data is excluded by default.

How to use it?

  • Install Backup and Migrate online
  • go to Administrator->Configuration->Development,open the “Backup and Migrate”
  • Use the backup policy settings and backup capabilities

 

Update and upgrade are different in Drupal

‘Update’ Drupal Core: a ‘minor’ version change

Strictly speaking, ‘updating’ refers to taking your site from one ‘minor’ version to another, as for example, from Drupal 7 version d7.1, to d7.2; or from Drupal 8 version d8.0.0 to d8.1.3, etc.
Upgrade’ Drupal Core: a ‘major’ version change

The difference between Drupal 6, Drupal 7, and Drupal 8 is that each of those are considered a different ‘Major’ version of Drupal.

Upgrade: Switching from Drupal 6 to Drupal 7, or from Drupal 6 to Drupal 8, or from Drupal 7 to Drupal 8 is an ‘upgrade’.

Update

When you get the Update tips like ” There is a security update available for your version of Drupal. To ensure the security of your server, you should update immediately! See the available updates page for more information and to install your missing updates.”You should consider the updating of Drupal.

go to Administrator->update,get the accurate version update information

How to update?please read the document below

Follow these instructions:

  1. Make a backup of your Drupal instance (database). (For ex: with MySQL)
  2. Download the latest release of your current Drupal version.
  3. Extract the [tar ball or zip] Drupal package.
  4. Set your site on maintenance mode (For ex: How on D7)
  5. Delete all the files & folders inside your original Drupal instance except for /sites and its sub-folders. This assumes that all of your custom work – including themes – is in the recommended spot – the /sites folder tree. If you have made custom changes elsewhere you will need to either preserve them or plan to replace them later. Warning: If your Drupal installation is built from a distribution your site will break if you delete the /profiles folder. Don’t delete the profile folder that corresponds to the distribution you installed, for example /profiles/kickstart if you installed Drupal Commerce Kickstart.
  6. Copy all the folders and files except /sites from inside the extracted Drupal package [tar ball or zip package] into your original Drupal instance location.
  7. Some updates do not include changes to setting.php and some do. If the update release includes changes to settings.php you will need to replace your old settings.php in …/sites/default/ with the new one, and then edit the site-specific entries (eg database name, user, and password) in the setting file.
  8. If you have modified files such as .htaccess or robots.txt re-apply those changes to the new files.
  9. If you have a favicon.ico file that was deleted replace it too
  10. Login to your site as administrator or as user no 1
  11. Run update.php by navigating to http://yourdrupalsitename/update.php and follow the process to update your Drupal instance
  12. Disable maintenance mode

Upgrade

The process of upgrading to the latest version of Drupal can vary in difficulty depending on the complexity of your current installation. This guide aims to help you plan for and complete a successful upgrade regardless of the size or complexity of your current site.

Any Drupal upgrade has four general steps: Planning, Preparing your current site for upgrade, Upgrading, and Testing.

Read more from Upgrade to Drupal 8

When install new Module from back-end it will not successful,may be the permissions of file and folder is not appropriate,you should change it

Web site root permissions to follow:
file 644, folder 755 ,Permissions Users and groups www
If there is a file permissions problem, execute the following three commands:

chown -R www.www /data/wwwroot/default/drupal
find /data/wwwroot/default/drupal -type d -exec chmod 755 {} \;
find /data/wwwroot/default/drupal -type f -exec chmod 644 {} \;

 

Modify the  /usr/local/php/etc/php.ini file to increase the allowed size for uploads:

; Maximum size of POST data that PHP will accept.
post_max_size = 16M
; Maximum allowed size for uploaded files.
upload_max_filesize = 16M

then,restart the apache

# service httpd restart

 

The PHP configuration file allows you to configure the modules enabled, the email settings or the size of the upload files. It is located at /usr/local/php/etc/php.ini.

There are some PHP settings that need to be sufficient for Drupal

The values for PHP.ini below are suggested values only.

  • memory_limit – Minimum: 128M Recommended: 256M or better
  • upload_max_filesize – Minimum: 20M
  • post_max_size – Minimum: 20M
  • max_execution_time: At Least 120 Recommended: 300

After modifying the PHP configuration file, restart both Apache and PHP-FPM for the changes to take effect:

# service httpd restart

 

If you receive the message “Maximum execution time of 30 seconds exceeded”.You may also like to extend the max_execution_time for PHP and you can modify it by two methods below

Method one: edit your  /usr/local/php/etc/php.ini


; Maximum execution time of each script, in seconds
; http://php.net/max-execution-time
; Note: This directive is hardcoded to 0 for the CLI SAPI
max_execution_time = 90
; Maximum amount of time each script may spend parsing request data. It's a good
; idea to limit this time on productions servers in order to eliminate unexpectedly
; long running scripts.

Method two: edit your .htaccess:


<IfModule mod_php5.c>
php_value max_execution_time 90
</IfModule>

Websoft9 Joomla Image have installed the phpMyadmin

phpMyAdmin install directory: /data/wwwroot/default/phpMyAdmin

Linux

Following is the step for access phpMyadmin

  1. Open Chrome or Firefox on your local PC
  2. visit the http://Internet IP Address/phpMyAdmin,you can enter the login page
  3. select you language,Username:root,Password:123456
  4. Click the button “Go”

Windows

Following is the step for access phpMyadmin

  1. User Remote Desktop Connection of Window to connect to you ECS
  2. Install a Chrome or Firefox browser on you ECS
  3. Open Chrome or Firefox on your ECS
  4. visit the http://Internet IP Address/phpMyAdmin,you can enter the login page
  5. select you language,Username:root,Password:123456
  6. Click the button “Go”