Friday, January 29, 2016

Moodle installation in ubuntu

Moodle Installation

( https://docs.moodle.org/26/en/Step-by-step_Installation_Guide_for_Ubuntu )

Install Apache/MySQL/PHP

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.

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

sudo apt-get install git-core

Download Moodle

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

OR

Download zip from https://github.com/moodle/moodle

cp '/home/user/Downloads/moodle-master.zip' /opt/

cd /opt
unzip moodle-master.zip
mv moodle-master moodle



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

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
sudo service mysql restart

mysql -u root -p

CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

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

quit;

make the webroot writable by doing the following:
sudo chmod -R 777 /var/www/moodle

no longer writable using the below command.
sudo chmod -R 0755 /var/www/moodle

goto localhost/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


To remove lamp




sudo apt-get remove --purge apache2 php5 mysql-server-5.0 phpmyadmin



or



sudo apt-get purge mysql-server apache2 php5



to remove php completely 
sudo apt-get -y purge php.*






To remove git-core
sudo apt-get remove –purge git-core.* 

To remove a folder
sudo rm -r folderName

How do I change the root directory of an apache server?


/etc/apache2/sites-available/default000

Thursday, January 28, 2016

LAMS installation on ubuntu

LAMS (Learning Activity Management System)

Credits : Shri. Niranjan, Rie, Mysore


LAMS is a revolutionary new tool for designing, managing and delivering online collaborative learning activities.

It provides teachers with a highly intuitive visual authoring environment for creating sequences of learning activities. These activities can include a range of individual tasks, small group work and whole class activities based on both content and collaboration.

LAMS is integrated with various Learning Management Systems (LMS) such as Moodle, Blackboard/WebCT, Sakai and .LRN as well as Microsoft Sharepoint.

LAMS works well as a stand-alone e-learning system. It can also be integrated with other educational software such as a Learning Management System (LMS).

LAMS is Free and Open Source software Licensed under GPL 2

LAMS home page:
https://www.lamsfoundation.org/index.htm

Lams wiki page:
https://wiki.lamsfoundation.org/display/lams/Home


Installation on Ubuntu:

(Also easily extendable for any other distros)
Based on instructions given in,

https://wiki.lamsfoundation.org/display/lamsdocs/Installing+LAMS+2.4+on+CentOS+5.8


Software Requirements:
https://wiki.lamsfoundation.org/display/lams/System+Requirements

* Apache web server (optional)
* JBOSS 5.1 application server
* Java Sun JDK 6 (also known as JDK 1.6)
OR/ Java Sun JDK 7 (also known as JDK 1.7) also works
* MySQL 5.5+ or 5.1 database server
* Adobe Flash Player

LAMS is written in JAVA, which in principle makes it operating system independent.

Goto Ubuntu Software Center and install the following two packages.
* OpenJDK Java 7 Runtime
* MySQL Server

Or, as root ($ sudo su root) run he following commands:
# apt-get update
# apt-get install mysql-server
# apt-get install openjdk-7-jre
# apt-get install ant

Required JBOSS will be provided along with the LAMS bundle. And let us not worry right now about Apache.

MySQL Server may ask for a password, type in some password and remember it.


Start MySQL Server:
# service mysql start

Create a LAMS user within MySQL:
# mysql -u root
mysql> CREATE DATABASE lams DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> GRANT ALL PRIVILEGES ON lams.* TO lams@localhost IDENTIFIED BY 'lamsdemo';
mysql> exit


Download LAMS v2.4 for Linux/Unix:
Download 'LAMS 2.4 installation pack' for generic Unix and Linux from,

https://wiki.lamsfoundation.org/display/lams/Downloads

The link for the package in the above page may be the following,
http://d16d4y6jddncbh.cloudfront.net/unix/lams-unix-installer-2.4.0.tar.gz

Prepare LAMS 2.4 installation:
Extract the downloaded archive in any convenient location and extract it. Then in terminal get into the extracted directory by using `cd` command. Then issue the following commands.

1. To Copy JBoss and LAMS Binaries to app directory:
# cp -rp jboss-5.1 /usr/local

2. To Create a nonlogin user for LAMS:
# useradd -d /usr/local/jboss-5.1/bin -M lams
and set permissions
# chown -R lams:lams /usr/local/jboss-5.1/

3. To Import LAMS Db into MySQL:
# mysql -u lams -p lams < lams.sql
Enter password: lamsdemo

4. Customizing LAMS settings:
The default settings for LAMS are: (better leave it as it is)
LAMS ear folder /usr/local/jboss-5.1/server/default/deploy/lams.ear
Repository directory /var/opt/lams/repository
Temp directory /var/opt/lams/tmp
Server URL http://localhost:8080/lams/

5. Set permissions to repository and tmp folders:
# mkdir -p /var/opt/lams
# chown -R lams:lams /var/opt/lams

6. Start LAMS:
# vi /etc/mysql/my.cnf
In this my.cnf file, look for a line
bind-address = 127.0.0.1
This number 127.0.0.1 (it may be different in your installation) is to be used in the following command.

# su -l lams -c "/usr/local/jboss-5.1/bin/run.sh -b 127.0.0.1"

Then open a web browser (eg FireFox) and in address bar enter,
http://localhost:8080/lams/

Login as sysadmin (u: sysadmin p: sysadmin) and you are ready to go.

7. Start on boot:
If you need LAMS to start on boot (as service) then get start-stop-daemon to help you with this. Read,

https://wiki.lamsfoundation.org/display/lamsdocs/Installing+LAMS+2.4+on+CentOS+5.8

for further details.