How to install moodle in Kali (Debian)


INSTALL REQUIRED PACKAGES that is:
Web Server (Apache highly recommended)
Database Server (MySQL or PostgreSQL recommended)
PHP, PHP-MySQL mod (or mod for your database)
Various PHP modules necessary for Moodle
-apt-get install apache2 php5 mysql-server php5-mysql libapache2-mod-php5 php5-gd php5-curl php5-xmlrpc php5-intl php-mbstring curl libcurl3-dev libcurl3
#(important for postgresql database usage)
-apt-get install php5-pgsql
-apt-get install clamav-base clamav-freshclam clamav(The clamav package will support virus checking on file uploads into Moodle. May have to run it again
to configure properly)

then change php settings by opening this file: php.ini
-vi /etc/php5/apache2/php.ini
then add these lines under Dynamic extensions
(here you are configuring php to communicate properly with mysql)
extension=mysql.so
extension=gd.so

(here you are configuring php to communicate properly with postgresql)

then search and adjust these values accordingly
memory_limit=40M(mine was 128M so i didnt change)
post_max_size = 80M
upload_max_filesize = 80M

SETUP DATABASE(Postgresql recommended)
login to automatic postgres user(its the default user for postgresql)
-sudo su postgres
Log into the PostgreSQL command line client
-psql -U postgres
After some preamble you should see the prompt postgres=#.

Create the user for the Moodle database and assign a password:
-CREATE USER moodleuser WITH PASSWORD ‘moodleuser123’;

Create the database:
postgres=# CREATE DATABASE moodle WITH OWNER moodleuser;

**Character set and encoding
CREATE DATABASE moodle WITH OWNER moodleuser ENCODING ‘UTF8′ LC_COLLATE=’en_US.utf8′ LC_CTYPE=’en_US.utf8’ TEMPLATE=template0;

INSTALLING MOODLE
first create a directory where moodle will be installed
-mkdir /var/www/moodle
-Download moodle from the site:
visit https://download.moodle.org/releases/latest/
or
wget https://download.moodle.org/download.php/stable28/moodle-latest-28.tgz
go to the directory containing the download
– tar xzpf moodle-latest-28.tgz -C /var/www/
make moodledata directory
-mkdir /var/www/moodle/moodledata

Set permissions(www-data is apache in debian)
moodle
-chown -R www-data:www-data /var/www/moodle/moodle/
-chmod -R 0755 /var/www/moodle/moodle/

moodledata
-chown -R www-data:www-data /var/www/moodle/moodledata/
-chmod 0755 /var/www/moodle/moodledata/

(Optional step,though this is what i did;saves time typing the whole path to the moodle directory)
Change Apache to use Moodle as website
Note that the server comes with Apache running and looking at the /var/www directory. But there is nothing in that folder, so one just gets a redirect. Edit as follows to have it point at Moodle instead:
-vi /etc/apache2/sites-available/default

On about line 4, change DocumentRoot “/var/www/moodle/moodle” to
DocumentRoot “/var/www/moodle”
On about line 10, change <Directory “/var/www/moodle/moodle”> to
<Directory “/var/www/moodle/”>

Final Install
(if option above was used,first time install = localhost/install.php)

type : localhost/moodle/moodle in browser

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s