Difference between revisions of "Instalasi Moodle"

From OnnoWiki
Jump to navigation Jump to search
 
(48 intermediate revisions by the same user not shown)
Line 1: Line 1:
Pertama-tama siapkan beberapa fasiltas pendukung [[Moodle]]
+
==Perbaiki Repository==
seperti [[MySQL]]-[[server]], [[PHP]] dll, antara lain dapat di install melalui perintah
 
  
 +
Edit
  
Untuk Ubuntu 16.04
+
vi /etc/apt/sources.list
  
sudo apt-get install apache2 php7.0 php7.0-xmlrpc php7.0-mysql php7.0-gd php7.0-cli php7.0-curl \
+
Pastikan
mysql-client mysql-server libphp-adodb libgd-dev php7.0-curl php-pear php7.0-zip php7.0-intl \
 
php7.0-cli php7.0-common libapache2-mod-php7.0 php7.0 php7.0-mysql php7.0-fpm php7.0-soap \
 
php7.0-curl php7.0-gd php7.0-mysql php7.0-bz2 php7.0-xml imagemagick git unzip
 
  
  a2dismod php5
+
  deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse
  a2enmod php7.0
+
  deb http://archive.ubuntu.com/ubuntu bionic-security main universe multiverse
  service apache2 stop
+
  deb http://archive.ubuntu.com/ubuntu bionic-updates main universe multiverse
service apache2 start
 
  
 +
Save & jalankan
  
 +
apt update
  
==Ubuntu yang lama==
+
==Instalasi Apps Pendukung==
  
  apt-get install mysql-server libmysqlclient15-dev \
+
sudo su
  libphp-adodb libgd2-xpm libgd2-xpm-dev php5-mysql \
+
apt update
  php5-gd php5-curl php5-xmlrpc php-image-graph \
+
  apt -y install apache2 php php-xmlrpc php-mysql php-gd php-cli php-curl \
  php-image-canvas php-pear
+
  mysql-client mysql-server libgd-dev php-curl php-pear \
 +
  php-common libapache2-mod-php php-xml imagemagick git unzip \
 +
  php7.3-zip php7.3-intl php7.3-mbstring php7.3-soap
  
Untuk Ubuntu 10.10, 11.04, 11.10
+
service apache2 restart
  
apt-get install lamp-server^ mysql-server libmysqlclient15-dev \
+
Atau Restart Apache
libphp-adodb libgd2-xpm libgd2-xpm-dev php5-mysql \
 
php5-gd php5-curl php5-xmlrpc php-pear php5-intl unzip
 
  
Untuk Ubuntu 12.04 & 12.10
+
/etc/init.d/apache2 restart
  
apt-get install apache2 php5 php5-xmlrpc php5-mysql php5-gd php5-cli php5-curl \
+
==Setup Database==
mysql-client mysql-server libmysqlclient15-dev \
 
libphp-adodb libgd2-xpm libgd2-xpm-dev php5-mysql \
 
php5-gd php5-curl php5-xmlrpc php-pear php5-intl unzip
 
  
Untuk Ubuntu 13.04
+
===Kalau Operasional===
  
apt-get install apache2 php5 php5-xmlrpc php5-mysql php5-gd php5-cli php5-curl \
+
Setup root password (jika di perlukan saja)
mysql-client mysql-server libmysqlclient15-dev \
 
libphp-adodb libgd2-xpm libgd2-xpm-dev php5-mysql \
 
php5-gd php5-curl php5-xmlrpc php-pear php5-intl unzip
 
  
Untuk Ubuntu 13.10 & 14.04.1
+
mysql
 +
mysql> SET PASSWORD FOR root@localhost=PASSWORD('password');
  
apt-get install apache2 php5 php5-xmlrpc php5-mysql php5-gd php5-cli php5-curl \
+
Setup database operasonal dengan username & password akses
mysql-client mysql-server libmysqlclient-dev \
 
libphp-adodb libgd2-xpm-dev php5-mysql \
 
php5-gd php5-curl php5-xmlrpc php-pear php5-intl unzip
 
  
 +
# mysql -u root -p
 +
Enter password:
 +
create database moodle;
 +
ALTER DATABASE moodle charset=utf8mb4;
 +
ALTER DATABASE moodle CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
 +
grant INSERT,SELECT on root.* to moodle@localhost;
 +
grant CREATE, INSERT, SELECT, DELETE, UPDATE on moodle.* to moodle@localhost identified by "moodlepassword";
 +
grant CREATE, INSERT, SELECT, DELETE, UPDATE on moodle.* to moodle identified by "moodlepassword";
 +
exit
  
Untuk Ubuntu 14.04.1 edit konfigurasi apache2
+
===Kalau hanya Latihan===
  
vi /etc/apache2/sites-enabled/000-default.conf
+
Password root 123456789
  
agar
+
# mysql -u root -p123456789
  
  # DocumentRoot /var/www/html
+
  CREATE USER 'root'@'%' IDENTIFIED BY '123456789';
  DocumentRoot /var/www
+
  create database moodle;
 +
ALTER DATABASE moodle charset=utf8mb4;
 +
ALTER DATABASE moodle CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
  
 +
CREATE USER 'foo'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456789';
 +
GRANT ALL PRIVILEGES ON database_name.* TO'foo'@'localhost';
 +
GRANT ALL PRIVILEGES ON moodle.* TO'foo'@'localhost';
 +
GRANT ALL PRIVILEGES ON moodle.* TO'root'@'localhost';
 +
CREATE USER 'moodle'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456789';
 +
GRANT ALL PRIVILEGES ON moodle.* TO'moodle'@'localhost';
  
Restart Apache
 
  
/etc/init.d/apache2 restart
+
Atau kalau mau lebih aman
  
Siapkan [[database]] untuk [[Moodle]], disini akan digunakan
+
# mysql -u root -p123!@#qweQWE
[[database]] dengan nama moodle, user [[database]] dengan nama moodle
 
dan password untuk akses [[database]] adalah moodle.
 
Sedang [[password]] root [[MySQL]] di set sebagai [[password]].
 
Perintah yang digunakan untuk mengkonfigurasi adalah
 
  
  mysql
+
  CREATE USER 'root'@'%' IDENTIFIED BY '123!@#qweQWE';
  mysql> SET PASSWORD FOR root@localhost=PASSWORD('password');
+
  create database moodle;
 +
ALTER DATABASE moodle charset=utf8mb4;
 +
ALTER DATABASE moodle CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
  
Jika password Root [[MySQL]] [[database]] sudah di set maka
+
CREATE USER 'foo'@'localhost' IDENTIFIED WITH mysql_native_password BY '123!@#qweQWE';
kita dapat langsung mengkonfigurasi [[MySQL]] menggunakan perintah
+
GRANT ALL PRIVILEGES ON database_name.* TO'foo'@'localhost';
 +
GRANT ALL PRIVILEGES ON moodle.* TO'foo'@'localhost';
 +
GRANT ALL PRIVILEGES ON moodle.* TO'root'@'localhost';
 +
CREATE USER 'moodle'@'localhost' IDENTIFIED WITH mysql_native_password BY '123!@#qweQWE';
 +
GRANT ALL PRIVILEGES ON moodle.* TO'moodle'@'localhost';
  
# mysql -u root -p
 
Enter password:
 
create database moodle;
 
ALTER DATABASE moodle charset=utf8;
 
grant INSERT,SELECT on root.* to moodle@localhost;
 
grant CREATE, INSERT, SELECT, DELETE, UPDATE on moodle.* to moodle@localhost identified by "moodlepassword";
 
grant CREATE, INSERT, SELECT, DELETE, UPDATE on moodle.* to moodle identified by "moodlepassword";
 
 
  exit
 
  exit
  
atau untuk latihan dapat menggunakan
+
/etc/init.d/mysql restart
  
# mysql -u root -p123456
+
==Siapkan folder /var/moodledata/==
  
create database moodle;
+
Download language pack
ALTER DATABASE moodle charset=utf8;
 
grant ALL on root.* to moodle@localhost;
 
grant ALL on moodle.* to moodle@localhost identified by "moodle";
 
grant ALL on moodle.* to moodle identified by "moodle";
 
exit
 
  
Siapkan folder /var/moodledata untuk mengcopykan terjemahan [[Moodle]]
+
cd /usr/local/src
dalam bahasa Indonesia. Terjemahan moodle dalam bahasa Indonesia
+
wget https://download.moodle.org/download.php/direct/langpack/3.8/id.zip
dapat di ambil dari situs [[Moodle]] di http://www.moodle.org di bagian download.
 
Tepatnya di
 
  
http://download.moodle.org/download.php/langpack/2.2/id.zip
+
Install language pack
http://download.moodle.org/download.php/langpack/2.4/id.zip
 
http://download.moodle.org/download.php/langpack/2.5/id.zip
 
http://download.moodle.org/download.php/langpack/2.6/id.zip
 
http://download.moodle.org/download.php/langpack/2.7/id.zip
 
http://download.moodle.org/download.php/langpack/2.8/id.zip
 
http://download.moodle.org/download.php/langpack/2.9/id.zip
 
http://download.moodle.org/download.php/langpack/3.0/id.zip
 
http://download.moodle.org/download.php/langpack/3.1/id.zip
 
  
Kemudian lakukan
+
  cd /usr/local/src
 
+
  mkdir -p /var/moodledata/lang
  mkdir /var/moodledata
 
  mkdir /var/moodledata/lang
 
 
  cp id.zip /var/moodledata/lang
 
  cp id.zip /var/moodledata/lang
 
  cd /var/moodledata/lang
 
  cd /var/moodledata/lang
 
  unzip id.zip
 
  unzip id.zip
 
  chmod -Rf 777 /var/moodledata/lang/
 
  chmod -Rf 777 /var/moodledata/lang/
  chown -Rf www-data.www-data /var/moodledata/lang/
+
  chown -Rf www-data: /var/moodledata/lang/
  
Ambil [[source code]] aplikasi [[Moodle]] yang terbaru dari situs Moodle http://www.moodle.org. Misalnya menggunakan
+
==Install Moodle==
 +
 
 +
Download
  
 
  cd /usr/local/src
 
  cd /usr/local/src
  wget https://download.moodle.org/download.php/direct/stable27/moodle-latest-27.tgz
+
  wget https://download.moodle.org/download.php/direct/stable38/moodle-latest-38.tgz
  
Lakukan perintah berikut untuk mengcopy dan mengextract [[source code]] pada folder [[Web]],
+
Install
Untuk menjalankan Moodle versi 2.0 ke atas perlu mengubah lumayan di [[MySQL]] agar mendukung unicode
 
  
  cp moodle-latest-27.tgz /var/www/
+
cd /usr/local/src
  cd /var/www
+
  cp moodle-latest-38.tgz /var/www/html/
  tar zxvf moodle-latest-27.tgz
+
  cd /var/www/html/
  chown -Rf www-data.www-data /var/moodledata/
+
  tar zxvf moodle-latest-38.tgz
  chmod -Rf 777 /var/www/moodle
+
  chown -Rf www-data: /var/moodledata/
  chown -Rf www-data.www-data /var/www/moodle   (temporary during installation)
+
  chmod -Rf 777 /var/www/html/moodle
 +
  chown -Rf www-data: /var/www/html/moodle
  
Lanjutkan proses konfigurasi moodle menggunakan [[Web]] dengan cara
+
Lanjutkan dengan konfigurasi via web
mengakses ke alamat,
 
  
 
  http://localhost/moodle
 
  http://localhost/moodle
 +
http://ip-address/moodle
  
  
==Uji Nyali Moodle 3.1==
+
Language      -> id  -> Selanjutnya
 +
Web Address          http://ip-address/moodle
 +
Moodle Directory      /var/www/html/moodle
 +
Data Directory        /var/moodledata/
 +
Confirm paths        -> Selanjutnya
 +
Choose database driver
 +
Type -> MySQL        -> Selanjutnya
 +
Database settings
 +
  Improved MySQL (native/mysqli)
 +
  Database host      localhost
 +
  Database name      moodle
 +
  Database user      moodle
 +
  Database password  moodle
 +
  Tables prefix      mdl_
 +
  '''unix socket (check)''' -> Selanjutnya
  
Kalau mau uji nyali moodle 3.1, dengan folder /var/www/html/
+
Installation      -> Lanjut
 +
Server checks    -> Selanjutnya
 +
 
 +
Installation
 +
  Nama Pengguna
 +
  Password
 +
  Nama Depan
 +
  Nama akhir
 +
  Alamat Email
 +
  Kota
 +
  Pilih Negara            -> Perbaharui Profile
 +
 +
Installation
 +
  Nama lengkap situs
 +
  Nama singkat untuk situs (mis. kata tunggal)
 +
  Keterangan halaman depan -> Save Changes
 +
 
 +
==Akses Moodle==
 +
 
 +
http://localhost/moodle/
 +
http://ip-address/moodle/
  
cp moodle-latest-31.tgz /var/www/html/
 
cd /var/www/html/
 
tar zxvf moodle-latest-31.tgz
 
chown -Rf www-data.www-data /var/moodledata/
 
chmod -Rf 777 /var/www/html/moodle
 
chown -Rf www-data.www-data /var/www/html/moodle
 
  
 
==Edit php.ini==
 
==Edit php.ini==
Line 162: Line 176:
  
 
  vi /etc/php5/apache2/php.ini
 
  vi /etc/php5/apache2/php.ini
 +
 +
atau untuk PHP 7.0
 +
 +
vi /etc/php/7.0/apache2/php.ini
  
 
Edit
 
Edit
Line 167: Line 185:
 
  upload_max_filesize = 100M
 
  upload_max_filesize = 100M
  
 
+
===Tuning===
===Kalau iseng===
 
  
 
'''WARNING''': ini tidak di perlukan.
 
'''WARNING''': ini tidak di perlukan.
Line 203: Line 220:
 
  ;opcache.enable_cli = 1 ; Speeds up CLI cron
 
  ;opcache.enable_cli = 1 ; Speeds up CLI cron
 
  ;opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.
 
  ;opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.
 
==Untuk Versi 2.1 ke atas==
 
 
Lakukan beberapa konfigurasi untuk [[Moodle]] yang akan kita operasikan.
 
Beberapa parameter yang perlu di set adalah,
 
 
Language      -> id  -> Selanjutnya
 
Confirm paths        -> Selanjutnya
 
Type -> MySQL        -> Selanjutnya
 
Database settings
 
  Improved MySQL (native/mysqli)
 
  Database host      localhost
 
  Database name      moodle
 
  Database user      moodle
 
  Database password  moodle
 
  Tables prefix      mdl_
 
  '''unix socket (check)''' -> Selanjutnya
 
 
Installation      -> Selanjutnya
 
Server checks    -> Selanjutnya
 
 
Installation
 
  Nama Pengguna
 
  Password
 
  Nama Depan
 
  Nama akhir
 
  Alamat Email
 
  Kota
 
  Pilih Negara            -> Perbaharui Profile
 
 
Installation
 
  Nama lengkap situs
 
  Nama singkat untuk situs (mis. kata tunggal)
 
  Keterangan halaman depan -> Save Changes
 
 
==Untuk Versi < 2.1==
 
 
Lakukan beberapa konfigurasi untuk [[Moodle]] yang akan kita operasikan.
 
Beberapa parameter yang perlu di set adalah,
 
 
Language -> id
 
Web Address -> http://ip-address/moodle
 
 
Type mysql
 
Host Server localhost
 
Database moodleNow you need to configure the database where most Moodle data will be stored. Database may be created if database user has needed permissions, username and password must already exist. Table prefix is optional.
 
Pengguna moodle
 
Password moodle
 
Tables prefix mdl_
 
 
[check] Unattended operation
 
 
Nama Pengguna admin
 
Password baru Admin123456!
 
Nama Depan admin
 
Nama akhir admin
 
Alamat Email email@host
 
Kota Jakarta
 
Pilih Negara Indonesia
 
 
Nama Lengkap Situs ------
 
nama Singkat Situs ------
 
 
lengkapi username dan password untuk administrator. Pada contoh
 
digunakan username admin dengan passNow you need to configure the database where most Moodle data will be stored. Database may be created if database user has needed permissions, username and password must already exist. Table prefix is optional.word Admin123456!
 
 
Selesai sudah proses instalasi [[Moodle]], kita
 
dapat mengoperasikan moodle dengan mengakses
 
 
http://localhost/moodle/
 
 
 
  
 
==Referensi==
 
==Referensi==

Latest revision as of 02:37, 8 April 2020

Perbaiki Repository

Edit

vi /etc/apt/sources.list

Pastikan

deb http://archive.ubuntu.com/ubuntu bionic main universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-security main universe multiverse
deb http://archive.ubuntu.com/ubuntu bionic-updates main universe multiverse

Save & jalankan

apt update

Instalasi Apps Pendukung

sudo su
apt update
apt -y install apache2 php php-xmlrpc php-mysql php-gd php-cli php-curl \
mysql-client mysql-server libgd-dev php-curl php-pear \
php-common libapache2-mod-php php-xml imagemagick git unzip \
php7.3-zip php7.3-intl php7.3-mbstring php7.3-soap
service apache2 restart

Atau Restart Apache

/etc/init.d/apache2 restart

Setup Database

Kalau Operasional

Setup root password (jika di perlukan saja)

mysql
mysql> SET PASSWORD FOR root@localhost=PASSWORD('password');

Setup database operasonal dengan username & password akses

# mysql -u root -p
Enter password:
create database moodle;
ALTER DATABASE moodle charset=utf8mb4;
ALTER DATABASE moodle CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
grant INSERT,SELECT on root.* to moodle@localhost;
grant CREATE, INSERT, SELECT, DELETE, UPDATE on moodle.* to moodle@localhost identified by "moodlepassword";
grant CREATE, INSERT, SELECT, DELETE, UPDATE on moodle.* to moodle identified by "moodlepassword";
exit

Kalau hanya Latihan

Password root 123456789

# mysql -u root -p123456789
CREATE USER 'root'@'%' IDENTIFIED BY '123456789';
create database moodle;
ALTER DATABASE moodle charset=utf8mb4;
ALTER DATABASE moodle CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
CREATE USER 'foo'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456789';
GRANT ALL PRIVILEGES ON database_name.* TO'foo'@'localhost';
GRANT ALL PRIVILEGES ON moodle.* TO'foo'@'localhost';
GRANT ALL PRIVILEGES ON moodle.* TO'root'@'localhost';
CREATE USER 'moodle'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456789';
GRANT ALL PRIVILEGES ON moodle.* TO'moodle'@'localhost';


Atau kalau mau lebih aman

# mysql -u root -p123!@#qweQWE
CREATE USER 'root'@'%' IDENTIFIED BY '123!@#qweQWE';
create database moodle;
ALTER DATABASE moodle charset=utf8mb4;
ALTER DATABASE moodle CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci;
CREATE USER 'foo'@'localhost' IDENTIFIED WITH mysql_native_password BY '123!@#qweQWE';
GRANT ALL PRIVILEGES ON database_name.* TO'foo'@'localhost';
GRANT ALL PRIVILEGES ON moodle.* TO'foo'@'localhost';
GRANT ALL PRIVILEGES ON moodle.* TO'root'@'localhost';
CREATE USER 'moodle'@'localhost' IDENTIFIED WITH mysql_native_password BY '123!@#qweQWE';
GRANT ALL PRIVILEGES ON moodle.* TO'moodle'@'localhost';
exit
/etc/init.d/mysql restart

Siapkan folder /var/moodledata/

Download language pack

cd /usr/local/src
wget https://download.moodle.org/download.php/direct/langpack/3.8/id.zip

Install language pack

cd /usr/local/src
mkdir -p /var/moodledata/lang
cp id.zip /var/moodledata/lang
cd /var/moodledata/lang
unzip id.zip
chmod -Rf 777 /var/moodledata/lang/
chown -Rf www-data: /var/moodledata/lang/

Install Moodle

Download

cd /usr/local/src
wget https://download.moodle.org/download.php/direct/stable38/moodle-latest-38.tgz

Install

cd /usr/local/src
cp moodle-latest-38.tgz /var/www/html/
cd /var/www/html/
tar zxvf moodle-latest-38.tgz
chown -Rf www-data: /var/moodledata/
chmod -Rf 777 /var/www/html/moodle	
chown -Rf www-data: /var/www/html/moodle

Lanjutkan dengan konfigurasi via web

http://localhost/moodle
http://ip-address/moodle


Language       -> id  -> Selanjutnya
Web Address           http://ip-address/moodle
Moodle Directory      /var/www/html/moodle
Data Directory        /var/moodledata/
Confirm paths         -> Selanjutnya
Choose database driver
Type -> MySQL         -> Selanjutnya
Database settings
  Improved MySQL (native/mysqli)
  Database host      localhost
  Database name      moodle
  Database user      moodle
  Database password  moodle
  Tables prefix      mdl_ 
  unix socket (check) -> Selanjutnya
Installation      -> Lanjut
Server checks     -> Selanjutnya
Installation
  Nama Pengguna
  Password 
  Nama Depan
  Nama akhir
  Alamat Email
  Kota
  Pilih Negara             -> Perbaharui Profile

Installation
  Nama lengkap situs
  Nama singkat untuk situs (mis. kata tunggal)
  Keterangan halaman depan -> Save Changes

Akses Moodle

http://localhost/moodle/
http://ip-address/moodle/


Edit php.ini

Upload file besar

Edit php.ini

vi /etc/php5/apache2/php.ini

atau untuk PHP 7.0

vi /etc/php/7.0/apache2/php.ini

Edit

upload_max_filesize = 100M

Tuning

WARNING: ini tidak di perlukan.

PHP.ini settings:

vi /etc/php5/cli/php.ini

atau untuk PHP 7.0

vi /etc/php/7.0/apache2/php.ini


Pastikan

[opcache]
opcache.enable = 1
opcache.memory_consumption = 128
opcache.max_accelerated_files = 4000
opcache.revalidate_freq = 60

; Required for Moodle
opcache.use_cwd = 1
opcache.validate_timestamps = 1
opcache.save_comments = 1
opcache.enable_file_override = 0

; If something does not work in Moodle
;opcache.revalidate_path = 1 ; May fix problems with include paths
;opcache.mmap_base = 0x20000000 ; (Windows only) fix OPcache crashes with event id 487

; Experimental for Moodle 2.6 and later
;opcache.fast_shutdown = 1
;opcache.enable_cli = 1 ; Speeds up CLI cron
;opcache.load_comments = 0 ; May lower memory use, might not be compatible with add-ons and other apps.

Referensi

Pranala Menarik