October 17

Moodle instal 2.6 stable on VirtualBox

  • install centOS 6.5, download iso and install after setting up an image on VBox
  1. on virtual box open up the different ports:(*port forwarding rules)
  2. Host port 8888 to Guest Port 80
  3. sshAccess HostPort 22 to Guest Port 22
  • install php modules
    • yum install git php-common php-mysql php-gd php-intl php-curl
    • yum install php-ldap php-apc php-mbstring php-dom php-soap php-xmlrpc
    • yum install php php-mysql
    • yum install php-pear php-devel httpd-devel pcre-devel gcc make
    • pecl install apc
      • vi /etc/php.d/apc.ini
      • extension=apc.so
         apc.enabled=1
      • apc.ttl=72000
         apc.user_ttl=72000
         apc.gc_ttl=3600
      • apc.shm_size=1024M
      • apc.stat=1
      • apc.enable_cli=1
      • apc.file_update_protection=2
      • apc.max_file_size=1M
      • apc.num_files_hint=200000
      • apc.user_entries_hint=20000
  • install moodle
    • mkdir  /var/moodle
    • cd /var/moodle
    • git clone -b MOODLE_26_STABLE https://github.com/moodle/moodle.git www
    • mkdir /var/moodle/data
    • chmod 755 all
    • cd /var/moodle/www
    • cp config-dist.php config.php
    • vi config.php and make sure the below is accurate
    • $CFG->dbtype    = 'mysqli';
      $CFG->dblibrary = 'native';
      $CFG->dbhost    = 'localhost';
      $CFG->dbname    = 'moodle';
      $CFG->dbuser    = 'moodle';
      $CFG->dbpass    = 'secretpassword';
      $CFG->prefix    = 'mdl_';
      $CFG->wwwroot   = 'http://localhost';
      $CFG->dataroot  = '/var/moodle/data';
  • install apache
    • yum install httpd
    • update file permissions in moodle
    • chown -R apache:apache /var/moodle
    • chmod -R 755 /var/moodle
    • vi /etc/httpd/conf/httpd.conf
    • add the following at the end
    • <VirtualHost *:80>
          ServerAdmin webmaster@tecadmin.net
          DocumentRoot /var/moodle/www
          ServerName localhost
          CustomLog logs/moodle.tecadmin.net_log combined
      </VirtualHost>
    • in Section 2: ‘Main’ server configuration add:
    • ServerName  localhost
  • install mysql
    • rpm -Uvh https://mirror.webtatic.com/yum/el6/latest.rpm
    • make sure your clock is correct or epel will not install.
    • If meta error occurs for EPEL  switch from HTTPS to http by commenting out mirrors in /etc/yum.repos.d/epel.repo
    • yum install mysql55w mysql55w-server
    • mysql -u root -p
    • CREATE DATABASE moodle;
    • GRANT ALL ON moodle.* TO 'moodle'@'localhost' IDENTIFIED BY 'secretpassword';
    • ALTER DATABASE moodle CHARACTER SET = utf8 COLLATE = utf8_unicode_ci;
    • FLUSH PRIVILEGES;
    • quit
  • service httpd start
  • service mysqld start
  • to start on reboot:
    • chkconfig httpd on
    • chkconfig mysqld on