Guia de instalacion paso-a-paso para Ubuntu 14.04

De MoodleDocs
Revisión del 22:46 17 ago 2014 de German Valero (discusión | contribs.) (updated as per 2.7 Doc page)

Nota: Esta es una traducción de una página de la documentación en idioma Inglés (Docs), que se considera particularmente importante, y que en su versión original se actualiza frecuentemente. Por ello, se le recomienda que revise la página original en idioma inglés: Step-by-step Installation Guide for Ubuntu.


Paso 1: Instalar Ubuntu 14.04LTS


Se prefiere Server Edition amd64 (Edición Servidor de 64bits)

http://www.ubuntu.com/download

  • Ubuntu Server 14.04LTS amd64 tiene todos los paquetes necesarios.
  • Ubuntu Server 14.04LTS tiene algunas pequeñas diferencias con 12.04LTS, principalmente en la configuración de los Sitios de Apache, que ahora reside en /etc/apache2/sites-available/000-default.conf y en Webroot por defecto, que ahora está en /var/www/html/. Este documento ha sido actualizado para reflejar estos cambios.
  • Usted puede usar, el programa VI (editor ligero) o el programa VIM (editor completo); sin embargo, si quiere usar VIM Usted tendrá que instalarlo
sudo apt-get install vim
  • Comandos VI o VIM

Para editar un archivo presione la tecla de "Insert"
Para terminar de editar presione la tecla "Esc"
Para escribir el archivo presione ":w"
Para salirse del editor presione ":q"
Usted también puede escribir y salirse a la vez ":wq"

  • En Ubuntu, el usuario estándar, la cuenta que Usted creó durante la instalación, no tiene privilegios para instalar/escribir en muchos de los directorios. En el tutorial inferior nosotros usaremos el témino "sudo" que en Inglés significa "super user do", que significa "super usuario haga" antes de la mayoría de los comandos.

Paso 2: Instalar Apache/MySQL/PHP

Abra Terminal e instale lo siguiente;

  • :22 en el Video
sudo apt-get update


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

'Se le pedirá que configure la contraseña para root para mysql - apúntela donde no la pierda, porque la necesitará en el paso 6.

Paso 3: Instalar software adicional

  • 1:10 en el video
sudo apt-get install graphviz aspell php5-pspell php5-curl php5-gd php5-intl php5-mysql php5-xmlrpc php5-ldap clamav

Reinicie Apache para que los módulos se carguen correctamente

sudo service apache2 restart

Nosotros usaremos Git para instalar y actualizar la Aplicación del Núcleo de Moodle

sudo apt-get install git-core

Paso 4: Descargar Moodle

  • 1:55 en el video

Configure su repositorio local y descargue Moodle. Nosotros usaremos /opt para esta instalación.

  • Git es lo que se llama un sistema de control de versión (version control syste). Al usar GIT será más sencillo después al actualizar la aplicación del núcleo de Moodle. Dentro del paso 5 hay más detalles acerca de porqué ponemos el código de la aplicación del núcleo de Moodle dentro del directorio /opt .
cd /opt

Descargar el Código de Moodle y el Índice

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

Cambiar de directorio hacia la carpeta del Moodle descargado

cd moodle


Recuperar una lista de cada una de las ramas disponibles

sudo git branch -a

Decirle a git cual de las ramas deberá de monitorear o usar

sudo git branch --track MOODLE_27_STABLE origin/MOODLE_27_STABLE

Finalmente, traernos la versión de Moodle especificada

sudo git checkout MOODLE_27_STABLE


Paso 5: Copiar repositorio local a /var/www/html/

  • 3:05 en el video
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


  • Explicación:


Since we setup a local repository in the previous step, you will copy it to your webroot after any updates and making changes. Having your local repository outside of the webroot, like we have in /opt, you will be able to prepare and stage your upgrades in a more efficient manner. For example, you want to make some changes or add some plugins, you would download the plugin and copy it to your local moodle repository. After you have added the plugin and any other changes you might have made you will need to edit the file located in /opt/moodle/.git/info/exclude. Within that file you want to tell git which files/folders to exclude when it pulls down the updates when you run your next "sudo git pull". An example entry would be the certificate mod located in /opt/moodle/mod/certificate so within the exclude file you want to add "/mod/certificate" below the last comments. You would add additional entries, 1 per line, for each plugin or file you might have changed. If I were to change the favicon.ico file you would just add "favicon.ico" to the exclude file. Now when you run "sudo git pull" to update moodle to the latest version it will ignore those files and directories and just update the core moodle code. Before copying to your webroot to upgrade you want to make sure and download and copy over the latest versions of the plugins you might have added.

Paso 6: Configurar servidor MySQL

  • 4:45 en el video

Primeramente, necesitamos cambiar el motor de almacenamiento por defecto a innodb

  • Usted ya no debería de necesitar hacer que innodb sea su motor de almacenamiento por defecto, la versión más reciente de Moodle la seleccionará automáticamente durante la instalación, aunque siempre es una buena idea volverla la selección por defecto.
  • Si Usted elige usar VIM entonces remplace vi por vim
sudo vi /etc/mysql/my.cnf

Scroll down to the [mysqld] section and under Basic Settings add the following line under the last statement. if you want to add you have to press the "insert" button on your keyboard. this is usually above the "delete" button. this allows you to add some text.

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 database and 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>

create user 'moodledude'@'localhost' IDENTIFIED BY 'passwordformoodledude'


mysql>

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


mysql>

quit;


Paso 7: Completar Configuración

  • 6:40 en el video
  • Nota - Si Usted no se encuentra cómodo al usar terminal para crear el archivo config.php que necesita crearse al avanzar en el instalador, Usted deberá de hacer temporalmente escribible webroot al hacer los siguiente:
sudo chmod -R 777 /var/www/html/moodle

Después de que haya corrido el instalador y hata configurado Moodle, Usted NECESITA revertir los permisos para que ya no sea escribible, usando los comandos siguientes:

sudo chmod -R 0755 /var/www/html/moodle

Abra su navegador y vaya a http://DIRECCION.IP.DEL.SERVIDOR/moodle

Siga las indicaciones seleccionando:

Cambie la ruta para moodledata

/var/moodledata

Tipo de BasedeDatos

Elija: mysqli

Configuraciones de Basededatos

Host server: localhost

BasedeDatos (Database): moodle

Usuario (User): moodledude (el usuario que Usted creó al configurar la BasedeDatos)

Contraseña (Password): passwordformoodledude (la contraseña para el usuario que Usted creó)

Tables Prefix: mdl_

Revisiones del Entorno

Esto indicará si faltan de instalar algunos elementos necesarios para que corra Moodle.

Siguiente siguiente siguiente...

Siga las indicaciones y confirme la instalación

Crear una cuenta del Administrador del Sitio

Cree su cuenta de usuario moodle que tendrá permisos de administrador del sitio.

La contraseña que elija debe de cumplir ciertos requisitos de seguridad.

Instalación Completa

¡Felicitaciones! ¡Ahora puede empezar a usar Moodle!

No se le olvide

Si Usted hizo escribible webroot, revierta los permisos

sudo chmod -R 0755 /var/www/html/moodle

Rutas del Sistema Después de Instalar

  • 10:05 en el video

Después de instalar Moodle, Usted debe configurar las rutas del sistema.

Navegue, en la página web de moodle, a Administración del sitio > Servidor > Rutas del sistema

Escriba lo siguiente;

Ruta hacia Du: /usr/bin/du

Ruta hacia Apsell: /usr/bin/aspell

Ruta hacia dot: /usr/bin/dot

Guarde los cambios

  • Opcionalmente, si todavía no tuviera una solución Anti-Virus

Ya instalamos ClamAV en el paso 3, por lo que necesitamos configurarle la ruta en Moodle

Primeramente Cree el Directorio para Cuarentena (Quarantine)

sudo mkdir /var/quarantine

Cámbiele el Propietario

sudo chown -R www-data /var/quarantine

Navegue a la Administración del sitio > Seguridad > Anti-Virus


Active "Use ClamAV en los archivos subidos"


ClamAV Path : /usr/bin/clamscan


Quarantine Directory : /var/quarantine


Guarde los Cambios


Sugerencias: Habilite Zend OpCache/Cambiar Raíz del Documento (Change Document Root)

  • 11:00 en el video
  • Como hemos instalado Ubuntu Server 14.04LTS, podemos usar la OPcache incluida en PHP,

Within the link above, https://docs.moodle.org/26/en/OPcache add the recommended settings to your 05-opcache.ini file. Again, substitute vi with your preferred editor. remember to press "insert" to edit and press "esc" when you are finished - after that type in :wq to write and quit.

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

Reinicie Apache para que surtan efecto los cambios.

sudo service apache2 restart

Esto es todo lo necesario para Zend OPcache! Usted también podría instalar una Interfaz Gráfica de Usuario (GUI) para ver el estatus de su Zend OPcache, lo que no se recomienda para servidores de producción.

cd /var/www/html/moodle/

Descargue el script de PHP a su directorio de Moodle , Usted debería de añadir también este archivo al archivo /opt/moodle/.git/info/exclude para que no sea eliminado al actualizar su instalación.

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

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

¿No le agrada http://direccion.ip.del.servidor/moodle?

Abra la configuración de Apache Config y cambie la raíz para documentos (document root)

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

En la línea en donde está la raíz para documentos (DocumentRoot);


Cambie de: DocumentRoot /var/www/html

Cambie a: DocumentRoot /var/www/html/moodle

:w
:q

Reinicie Apache para que surtan efecto los cambios.

sudo service apache2 restart

¡Aviso importante!

Si Usted ya ha instalado Moodle, entonces debe de realizar los cambios siguientes.

Editar config.php para Moodle

In the installation instructions, one of the suggested settings for 'webroot' is 'localhost'. This is fine if all you want to do is some local testing of your new Moodle installation. If, however, you want to view your new installation from another machine on the same local area network, or view your site on the internet, you will have to change this setting:

For local testing, 'localhost' is fine for the webroot ($CFG->wwwroot in config.php). If you want to test your site from other machines on the same local area network (LAN), then you will have to use the private ip address of the serving machine, (e.g. 192.168.1.2/moodle) or the network name of the serving computer (e.g. network_name_of_serving_machine/moodle) as the web root. Depending on your LAN setup, it may be better to use the network name of the computer rather than its (private) ip address, because the ip address can and will change from time to time. If you don't want to use the network name, then you will have to speak to your network administrator and have them assign a permanent ip address to the serving machine. Finally, if you want to test your new installation across the internet, you will have to use either a domain name or a permanent (public) ip address/moodle as your web root. To handle both types of access, see masquerading.

Edit config.php for Moodle

Debajo de $CFG->wwwroot cámbielo a http://direccion.ip.del.servidor en lugar de http://dirección.ip.del.servidor/moodle


Video en Youtube

https://www.youtube.com/watch?v=H5vAzBrRxzI