Step-by-step Installation Guide for Ubuntu: Różnice pomiędzy wersjami

Z MoodleDocs
Skocz do:nawigacja, szukaj
 
(Nie pokazano 30 wersji utworzonych przez 4 użytkowników)
Linia 1: Linia 1:
== Step 1: Install Ubuntu 10.04 ==
{{Installing Moodle}}
== Step 1: Install Ubuntu 14.04LTS==


http://www.ubuntu.com/download
<br>Server Edition amd64 Preferred<br>
<br>http://www.ubuntu.com/download<br>


== Step 2: Install LAMP stack ==
*Ubuntu Server 14.04LTS amd64 has all the required packages for upgrading to Moodle 2.7
Open the Terminal and install tasksel


<pre>sudo apt-get install tasksel</pre>
**Ubuntu Server 14.04LTS has some minor differences from 12.04LTS, mainly to the Apache Sites Configuration, now resides at /etc/apache2/sites-available/000-default.conf and the Default Webroot now at /var/www/html/. This document has been updated to reflect those changes.


and then the LAMP stack:
== Step 2: Install Apache/MySQL/PHP ==
Open up Terminal and install the following;


<pre>sudo tasksel install lamp-server</pre>
<pre>sudo apt-get update</pre>


<pre>sudo apt-get install apache2 mysql-client mysql-server php5</pre>


This will run a gui install of the lamp stack.  
''''It will prompt you to set the root password for mysql - take note of it, you will need it in step 6.'''


''''It will prompt you to set the root password for mysql - take note of it, you will need it in step 5.'''
== Step 3: Install Additional Software ==


== Step 3: Install the additional PHP extensions ==
<pre>sudo apt-get install graphviz aspell php5-pspell php5-curl php5-gd php5-intl php5-mysql php5-xmlrpc php5-ldap</pre>


<pre>sudo apt-get install php5-curl php5-gd php5-intl php5-xmlrpc</pre>
Restart Apache so that the modules are loaded correctly


restart apache for the installation to complete
<pre>sudo service apache2 restart</pre>
 
We will be using Git to install/update the Moodle Core Application


<pre>sudo service apache2 restart</pre>
<pre>sudo apt-get install git-core</pre>


== Step 4: Download Moodle ==
== Step 4: Download Moodle ==


<pre>cd /var/www
Setup your local repository and download Moodle, We will use /opt for this installation.


sudo wget http://download.moodle.org/stable23/moodle-latest-23.tgz
<pre>cd /opt


sudo tar -zxf moodle-latest-23.tgz
sudo git clone git://git.moodle.org/moodle.git


sudo mkdir /var/moodledata
cd moodle


sudo chmod 777 /var/moodledata
sudo git branch -a


sudo chmod 777 /var/www/moodle</pre>
sudo git branch --track MOODLE_26_STABLE origin/MOODLE_26_STABLE


== Step 5: Create Moodle database ==
sudo git checkout MOODLE_26_STABLE</pre>
<pre>mysql -u root -p</pre>
 
== Step 5: Copy local repository to /var/www/html/ ==
 
<pre>sudo cp -R /opt/moodle /var/www/html/</pre>
<pre>sudo mkdir /var/moodledata</pre>
<pre>sudo chown -R www-data /var/moodledata</pre>
<pre>sudo chmod -R 777 /var/moodledata</pre>
<pre>sudo chmod -R 0755 /var/www/html/moodle</pre>
 
== Step 6: Setup MySQL Server ==
 
First we need to change the default storage engine to innodb
 
*You should not need to make innodb the default storage engine anymore, the latest version of Moodle will select it automatically during install. It is always a good idea to make it default anyway.
 
<pre>sudo vi /etc/mysql/my.cnf</pre>
 
Scroll down to the [mysqld] section and under Basic Settings add the following line under the last statement
 
<pre>default-storage-engine = innodb</pre>
 
In order to save my.cnf using the editor, press the Esc (Escape) key, type the following in sequence which will save :w then close the editor :q
 
<pre>:w</pre>
<pre>:q</pre>


You will be prompted for the mysql root password you have created in step 2
Restart MySQL Server for changes to take affect


<pre>create database moodledb charset=utf8;
<pre>sudo service mysql restart</pre>


create user 'mdluser'@'localhost' identified by 'password';
Now we need to create the Moodle MySQL User with the correct permissions


grant all privileges on moodledb.* to 'mdluser'@'localhost';
Use the password you created in step 1
<pre>mysql -u root -p</pre>
mysql><pre>CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;</pre>


\q</pre>
Where it says "moodledude" and "passwordformoodledude" you should change to the username and password of your choosing.
mysql><pre>GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodledude@localhost IDENTIFIED BY 'passwordformoodledude';</pre>
mysql><pre>quit;</pre>


== Step 6: Setup Moodle server ==
== Step 7: Complete Setup ==


Open your browser and go to http://localhost/moodle  
Open your browser and go to http://IP.ADDRESS.OF.SERVER/moodle  


Follow the prompts selecting:
Follow the prompts selecting:


===database type===
===Database Type===


Choose: mysqli
Choose: mysqli


=== database settings ===
=== Database Settings ===


Host server: localhost
Host server: localhost


Database: moodledb
Database: moodle


User: mdluser
User: moodledude


Password: password
Password: passwordformoodledude


Tables Prefix: mdl_
Tables Prefix: mdl_


=== environment checks ===
=== Environment Checks ===


This will indicate if any elements required to run moodle haven't been installed.
This will indicate if any elements required to run moodle haven't been installed.


=== next next next... ===
=== Next next next... ===
follow prompts and confirm installation
follow prompts and confirm installation


===create a site administrator account ===
===Create a Site Administrator Account ===
Create your moodle user account which will have site administrator permissions.
Create your moodle user account which will have site administrator permissions.


Linia 87: Linia 120:


===Installation Complete ===
===Installation Complete ===
Bravo! You can now start playing with moodle!
Congrats! You can now start using Moodle!
 
== System Paths After Install==
 
After installing Moodle you should set the system paths.
 
Navigate to Site Administration > Server > System Paths
 
Input the following;
 
Path to Du: /usr/bin/du
 
Path to Apsell: /usr/bin/aspell
 
Path to dot: /usr/bin/dot
 
Save Changes
 
== Suggestions: Enable Zend OpCache/Change Document Root==
 
*Since we have installed Ubuntu Server 14.04LTS, we can use the built-in PHP OPcache, https://docs.moodle.org/2x/pl/OPcache
 
Within the link above, https://docs.moodle.org/2x/pl/OPcache add the recommended settings to your 05-opcache.ini file.
 
<pre>sudo vi /etc/php5/apache2/conf.d/05-opcache.ini</pre>
 
Restart Apache for changes to take affect.
 
<pre>sudo service apache2 restart</pre>
 
That's it for the Zend OpCache!
 
You can also install a GUI to view the status of your Zend OpCache, not recommended on production servers.
 
<pre>cd /var/www/html/moodle/</pre>
 
Download the PHP Script to your Moodle directory, you should also add this file to /opt/moodle/.git/info/exclude file so it does not get removed when upgrading your installation.
 
<pre>sudo wget https://github.com/rlerdorf/opcache-status/blob/master/opcache.php</pre>
 
Visit http://ip.address.of.server/moodle/opcache.php
 
Don't like http://ip.address.of.server/moodle?
 
Open up Apache Config and change the document root
 
<pre>sudo vi /etc/apache2/sites-available/000-default.conf</pre>
 
On the line where DocumentRoot is;
 
<br>Change From: DocumentRoot /var/www/html<br>
<br>Change To:  DocumentRoot /var/www/html/moodle<br>
 
<pre>:w</pre>
<pre>:q</pre>
 
Restart Apache for changes to take affect.
 
<pre>sudo service apache2 restart</pre>
 
Important note!
 
If you have already installed Moodle then you should make the below changes.
 
Edit config.php for Moodle
 
Under $CFG->wwwroot change to http://ip.address.of.server/ instead of http://ip.address.of.server/moodle

Aktualna wersja na dzień 16:54, 6 maj 2014

Step 1: Install Ubuntu 14.04LTS


Server Edition amd64 Preferred

http://www.ubuntu.com/download

  • Ubuntu Server 14.04LTS amd64 has all the required packages for upgrading to Moodle 2.7
    • Ubuntu Server 14.04LTS has some minor differences from 12.04LTS, mainly to the Apache Sites Configuration, now resides at /etc/apache2/sites-available/000-default.conf and the Default Webroot now at /var/www/html/. This document has been updated to reflect those changes.

Step 2: Install Apache/MySQL/PHP

Open up Terminal and install the following;

sudo apt-get update
sudo apt-get install apache2 mysql-client mysql-server php5

'It will prompt you to set the root password for mysql - take note of it, you will need it in step 6.

Step 3: Install Additional Software

sudo apt-get install graphviz aspell php5-pspell php5-curl php5-gd php5-intl php5-mysql php5-xmlrpc php5-ldap

Restart Apache so that the modules are loaded correctly

sudo service apache2 restart

We will be using Git to install/update the Moodle Core Application

sudo apt-get install git-core

Step 4: Download Moodle

Setup your local repository and download Moodle, We will use /opt for this installation.

cd /opt

sudo git clone git://git.moodle.org/moodle.git

cd moodle

sudo git branch -a

sudo git branch --track MOODLE_26_STABLE origin/MOODLE_26_STABLE

sudo git checkout MOODLE_26_STABLE

Step 5: Copy local repository to /var/www/html/

sudo cp -R /opt/moodle /var/www/html/
sudo mkdir /var/moodledata
sudo chown -R www-data /var/moodledata
sudo chmod -R 777 /var/moodledata
sudo chmod -R 0755 /var/www/html/moodle

Step 6: Setup MySQL Server

First we need to change the default storage engine to innodb

  • You should not need to make innodb the default storage engine anymore, the latest version of Moodle will select it automatically during install. It is always a good idea to make it default anyway.
sudo vi /etc/mysql/my.cnf

Scroll down to the [mysqld] section and under Basic Settings add the following line under the last statement

default-storage-engine = innodb

In order to save my.cnf using the editor, press the Esc (Escape) key, type the following in sequence which will save :w then close the editor :q

:w
:q

Restart MySQL Server for changes to take affect

sudo service mysql restart

Now we need to create the Moodle MySQL User with the correct permissions

Use the password you created in step 1

mysql -u root -p

mysql>

CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

Where it says "moodledude" and "passwordformoodledude" you should change to the username and password of your choosing.

mysql>

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodledude@localhost IDENTIFIED BY 'passwordformoodledude';

mysql>

quit;

Step 7: Complete Setup

Open your browser and go to http://IP.ADDRESS.OF.SERVER/moodle

Follow the prompts selecting:

Database Type

Choose: mysqli

Database Settings

Host server: localhost

Database: moodle

User: moodledude

Password: passwordformoodledude

Tables Prefix: mdl_

Environment Checks

This will indicate if any elements required to run moodle haven't been installed.

Next next next...

follow prompts and confirm installation

Create a Site Administrator Account

Create your moodle user account which will have site administrator permissions.

The password you select has to meet certain security requirements.

Installation Complete

Congrats! You can now start using Moodle!

System Paths After Install

After installing Moodle you should set the system paths.

Navigate to Site Administration > Server > System Paths

Input the following;

Path to Du: /usr/bin/du

Path to Apsell: /usr/bin/aspell

Path to dot: /usr/bin/dot

Save Changes

Suggestions: Enable Zend OpCache/Change Document Root

Within the link above, https://docs.moodle.org/2x/pl/OPcache add the recommended settings to your 05-opcache.ini file.

sudo vi /etc/php5/apache2/conf.d/05-opcache.ini

Restart Apache for changes to take affect.

sudo service apache2 restart

That's it for the Zend OpCache!

You can also install a GUI to view the status of your Zend OpCache, not recommended on production servers.

cd /var/www/html/moodle/

Download the PHP Script to your Moodle directory, you should also add this file to /opt/moodle/.git/info/exclude file so it does not get removed when upgrading your installation.

sudo wget https://github.com/rlerdorf/opcache-status/blob/master/opcache.php

Visit http://ip.address.of.server/moodle/opcache.php

Don't like http://ip.address.of.server/moodle?

Open up Apache Config and change the document root

sudo vi /etc/apache2/sites-available/000-default.conf

On the line where DocumentRoot is;


Change From: DocumentRoot /var/www/html

Change To: DocumentRoot /var/www/html/moodle

:w
:q

Restart Apache for changes to take affect.

sudo service apache2 restart

Important note!

If you have already installed Moodle then you should make the below changes.

Edit config.php for Moodle

Under $CFG->wwwroot change to http://ip.address.of.server/ instead of http://ip.address.of.server/moodle