This tutorial shows you how to quickly set up a Moodle course management system using a Marketplace image.
Procedure
-
Go to the instance creation page to quickly deploy Moodle using a Marketplace image. The instance must meet the following requirements. For information about other configurations, see Create an instance by using the custom purchase method.
-
billing method: If you need to apply for an ICP filing for your website, select subscription.
-
Image: Use the Marketplace image named Moodle Online Learning Platform (CentOS 7.0 64-bit).
-
public IP address: Select Assign Public IPv4 Address.
-
security group: Add an inbound rule to allow traffic on ports 22, 80, and 3306.
The instance starts in 3 to 5 minutes.
-
-
Obtain the default username and password for the MySQL database and FTP.
-
Remotely connect to the ECS instance. For more information, see Connect to a Linux instance by using Workbench.
-
Run the following command to get the default username and password for the MySQL database and FTP:
cat default.passNoteSave the username and password for later use.
login as: root root@121.xxx.15's password: Last login: Tue Sep 20 16:33:50 2016 from 115.xxx.202 Welcome to aliyun Elastic Compute Service! [root@AV xxx 5Z ~]# ll total 4 -rw-r--r-- 1 root root 429 Sep 20 16:26 default.pass [root@AV xxx 5Z ~]# cat default.pass | YJCOM [ EASY CLOUD EASY WEBSITE] | | Copyright (c) 2016 http://yjcom.com All rights reserved. | | MySQL database name: moodle MySQL user: root MySQL password: Ucsxxx FTP account: www FTP password: 9sExxx [root@A xxx ?5Z ~]#
-
-
Install Moodle.
-
In a browser, go to
http://<your_ecs_instance_public_ip_address>to open the installation page. -
Select your preferred language and click Next.
In this example, Chinese (Simplified) is selected.
-
On the Confirm paths page, keep the default directory settings and click Next.
Confirm that the Moodle directory is
/yjdata/www/wwwrootand the Data directory is/yjdata/www/moodledata. -
On the Choose database driver page, keep the default value for Disk Category and click Next.
-
On the Database settings page, configure the database information and click Next.
-
Database host: Enter
127.0.0.1. -
Database user and Database password: Enter the MySQL database username and password from Step 2.
-
Set Database name to
moodle, Tables prefix tomdl_, and Database port to3306.
-
-
Read and accept the copyright notice, and then click Continue.
-
Review the installed plug-ins and click Continue.
-
When Continue appears at the bottom of the installation page, the installation is complete. Click Continue.
-
Configure the Moodle administrator account and click Update profile.
Set Username to
admin. The New password must be at least 8 characters long and include digits, uppercase and lowercase letters, and special characters. Set Surname toUserand First name toAdmin. -
Configure the front page, location, and authentication settings, and then click Save changes.
After the installation is complete, you are automatically redirected to the admin dashboard.
NoteThe database management address is
http://<your_ecs_instance_public_ip_address>/phpmyadmin/.
-
Next steps
After the installation is complete, users can access your website using its public IP address. If you want users to access your site using a domain name, follow these steps.
-
Register a domain name.
For more information, see Domain name registration.
-
Complete the ICP filing.
If your domain name points to a website hosted on an Alibaba Cloud server in the Chinese mainland, you must apply for an ICP filing. For more information, see the ICP filing process.
-
Resolve the domain name.
Point the domain name to the public IP address of the instance.
Domain name resolution is required to access your website using a domain name. For more information, see Public authoritative DNS resolution.
-
Bind the domain name to the ECS instance.
-
Remotely connect to the ECS instance. For more information, see Connect to a Linux instance by using Workbench.
-
Run the vim /etc/httpd/conf/httpd.conf command to open the configuration file.
-
Press i to enter Insert mode.
-
Configure ServerName.
Change
localhostto your domain name, for example,example.com.# as error documents. e.g. admin@your-domain.com # ServerAdmin root@localhost ServerName localhost # ServerName gives the name ... that the server uses to identify itself. # This can often be determined automatically, but we recommend you specify # it explicitly to prevent problems during startup. # # If this is not set to valid DNS name for your host, server-generated # redirections will not work. See also the UseCanonicalName directive. # # If your host doesn't have a registered DNS name, write its IP address here. # You will have to access it by its address anyway, and this will make # redirections work in a sensible way. # #ServerName www.example.com:80 -
Press Esc to exit Insert mode, type :wq, and then press Enter to save and close the file.
-