0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ubuntu 18.04 LTSにMoodleをインストールする

Posted at

パッケージアップデート

sudo apt update
sudo apt upgrade -y

必要なパッケージを追加

sudo apt-get install -y zip lamp-server^ php7.2-curl php7.2-zip php7.2-xml php7.2-mbstring php7.2-gd php7.2-intl php7.2-xmlrpc php7.2-soap

パーミッションの設定

sudo usermod -a -G www-data ubuntu
sudo chown -R ubuntu:www-data /var/www
sudo chmod 2775 /var/www && find /var/www -type d -exec sudo chmod 2775 {} \;
find /var/www -type f -exec sudo chmod 0664 {} \;

コードを取得

cd /var/www/html
git clone -b MOODLE_39_STABLE git://git.moodle.org/moodle.git

パーミッションの設定

sudo chown -R www-data /var/www
sudo chgrp -R www-data /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} \;
find /var/www -type f -exec sudo chmod 0664 {} \;

Apacheの設定

sudo vi /etc/apache2/sites-available/000-default.conf # DocumentRootを `/var/www/html/moodle` に変更
sudo a2enmod rewrite
sudo systemctl restart apache2

データベースの設定

sudo mysql_secure_installation
sudo mysql

SQLを実行

CREATE DATABASE moodle DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'moodle'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON `moodle`.* TO "moodle"@"localhost";
FLUSH PRIVILEGES;
exit

Moodleの設定

mkdir /var/www/html/moodledata
sudo chown -R www-data /var/www/html/moodledata

crontab -eを実行し、以下の行を追加する。

* * * * *    /usr/bin/php /var/www/html/moodle/admin/cli/cron.php >/dev/null

ブラウザでURLにアクセスし、画面にしたがってインストールを完了する。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?