Step-by-step Installation Guide for Ubuntu: Difference between revisions
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{Installing Moodle}} | |||
== Step 1: Install Ubuntu 12.04LTS== | == Step 1: Install Ubuntu 12.04LTS== | ||
Line 7: | Line 8: | ||
Open up Terminal and install the following; | Open up Terminal and install the following; | ||
<pre>sudo apt-get install apache2 mysql mysql-server php5</pre> | <pre>sudo apt-get update</pre> | ||
<pre>sudo apt-get install apache2 mysql-client mysql-server php5</pre> | |||
''''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 6.''' | ||
Line 13: | Line 16: | ||
== Step 3: Install Additional Software == | == Step 3: Install Additional Software == | ||
<pre>sudo apt-get install aspell php5-curl php5-gd php5-intl php5-mysql php5-xmlrpc php5-ldap</pre> | <pre>sudo apt-get install aspell graphviz php5-pspell php5-curl php5-gd php5-intl php5-mysql php5-xmlrpc php5-ldap</pre> | ||
Restart Apache so that the modules are loaded correctly | Restart Apache so that the modules are loaded correctly | ||
Line 33: | Line 36: | ||
cd moodle | cd moodle | ||
git branch -a | sudo git branch -a | ||
git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE | sudo git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE | ||
git checkout MOODLE_25_STABLE</pre> | sudo git checkout MOODLE_25_STABLE</pre> | ||
== Step 5: Copy local repository to /var/www == | == Step 5: Copy local repository to /var/www == | ||
Line 56: | Line 59: | ||
<pre>default-storage-engine = innodb</pre> | <pre>default-storage-engine = innodb</pre> | ||
In order to save my.cnf using the editor, type the following in sequence which will save :w then close the editor :q | |||
<pre>:w</pre> | <pre>:w</pre> | ||
Line 74: | Line 79: | ||
mysql><pre>quit;</pre> | mysql><pre>quit;</pre> | ||
== Step 7: Complete Setup == | |||
*Note - If you are not comfortable using terminal to create the config.php file that needs to be created when going through the installer, you should temporarily make the webroot writable by doing the following: | |||
<pre>sudo chmod -R 777 /var/www/moodle</pre> | |||
After you have ran the installer and you have moodle setup, you NEED to revert permissions so that it is no longer writable using the below command. | |||
<pre>sudo chmod -R 0755 /var/www/moodle</pre> | |||
Open your browser and go to http://IP.ADDRESS.OF.SERVER/moodle | Open your browser and go to http://IP.ADDRESS.OF.SERVER/moodle | ||
Line 91: | Line 103: | ||
Database: moodle | Database: moodle | ||
User: moodledude | User: moodledude (the user you created when setting up the database) | ||
Password: passwordformoodledude | Password: passwordformoodledude (the password for the user you created) | ||
Tables Prefix: mdl_ | Tables Prefix: mdl_ | ||
Line 111: | Line 123: | ||
===Installation Complete === | ===Installation Complete === | ||
Congrats! You can now start using Moodle! | Congrats! You can now start using Moodle! | ||
===Don't Forget=== | |||
If you made the webroot writable, revert permissions | |||
<pre>sudo chmod -R 0755 /var/www/moodle</pre> | |||
== 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: Install APC/Change Document Root== | == Suggestions: Install APC/Change Document Root== |
Latest revision as of 14:08, 28 May 2014
Step 1: Install Ubuntu 12.04LTS
Server Edition amd64 Preferred
http://www.ubuntu.com/download
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 aspell graphviz 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 the local repository.
cd /opt sudo git clone git://git.moodle.org/moodle.git cd moodle sudo git branch -a sudo git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE sudo git checkout MOODLE_25_STABLE
Step 5: Copy local repository to /var/www
sudo cp -R /opt/moodle /var/www/
sudo mkdir /var/moodledata
sudo chown -R www-data /var/moodledata
sudo chmod -R 777 /var/moodledata
sudo chmod -R 0755 /var/www/moodle
Step 6: Setup MySQL Server
First we need to change the default storage engine to innodb
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, 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
- Note - If you are not comfortable using terminal to create the config.php file that needs to be created when going through the installer, you should temporarily make the webroot writable by doing the following:
sudo chmod -R 777 /var/www/moodle
After you have ran the installer and you have moodle setup, you NEED to revert permissions so that it is no longer writable using the below command.
sudo chmod -R 0755 /var/www/moodle
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 (the user you created when setting up the database)
Password: passwordformoodledude (the password for the user you created)
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!
Don't Forget
If you made the webroot writable, revert permissions
sudo chmod -R 0755 /var/www/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: Install APC/Change Document Root
Highly suggest that you install a PHP Accelerator, We will use APC for this install.
sudo apt-get install php-apc
Restart Apache for changes to take affect.
sudo service apache2 restart
That's it for the PHP Accelerator!
Don't like http://ip.address.of.server/moodle?
Open up Apache Config and change the document root
sudo vi /etc/apache2/sites-available/default
On 2nd or 3rd line where DocumentRoot is;
Change From: DocumentRoot /var/www
Change To: DocumentRoot /var/www/moodle
Scroll down a little farther where it says <Directory /var/www/>
Change From: <Directory /var/www/>
Change To: <Directory /var/www/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