Install these packages (if you've not already done so).
See Installing Apache, MySQL and PHP or refer to the respective user manuals.
Using apt-get, aptitude or synaptic you can install these very easily.
* Web Server (Apache highly recommended)
* Database Server (MySQL or PostgreSQL recommended)
* PHP, PHP-MySQL mod (or mod for your database)
These packages are optional:
* GD library
For installation of the necessary packages the easiest option to use apt-get.
Use the following command to install apache2, php5 and mysql
apt-get install apache2 php5 mysql-server php5-mysql libapache2-mod-php5
php5-gd
php5-gd is optional
Now you may fire up a browser and type localhost to check whether the apache2 default page is shown,
You can edit the apache configuration files using the text editor gedit by
gedit /etc/apache2/apache2.conf
Now we must make a slight change in the php5 configuration file. Open it using
gedit /etc/php5/apache2/php.ini
add the entries
extension=mysql.so
extension=gd.so
To test the php installation, you can create a text file named phpinfo.php with the contents and save it at /var/www.
Restart apache with the command below. Now access this file through the browser localhost/phpinfo to check the installation of php.
Mysql installation is already there. Give it a root password using
mysqladmin -u root password "yourpassword"
You can restart apache 2 by
/etc/init.d/apache2 restart
You can restart mysql by
/etc/init.d/mysql restart
Download moodle
Download moodle from http://download.moodle.org/?lang=en
Unpack file
* For zip file, use unzip
For tgz(tar.gz), use tar -zxvf
You can also use any of the GUI front-ends such as file-roller or ark.
You will get a folder moodle (or moodle-1.5.2 or something similar).
* Now, suppose you want to install moodle at
/var/www/moodle
(This means moodle will be accessible at http://localhost/moodle).
mv moodle /var/www/
(Most probably you will need to be root to do this)
Start web and database servers
* Login as root (if you have not already done so): su.
* Start your web server. For Apache2, /etc/init.d/apache2 start.
* Start your database server. For MySQL, /etc/init.d/mysql start
Finally install
* Go to http://localhost/moodle and follow the instructions.
Setup MySQL Database
Set a secure root password for the database
mysqladmin -u root password "mySecurePassword"
Note that on a secure production server, you will want to create a different user than root to access the database.
Now log in
mysql -u root -p
Enter your password
Create the Moodle database
mysql> CREATE DATABASE moodle;
mysql> exit;
Get Moodle from CVS
Go to the directory where Moodle will be installed.
cd /var/www
Get the latest version of Moodle 1.9
It may be earlier or later than 1.9 stable. Use the European Union CVS server
cvs -z3 -d:pserver:anonymous@eu.cvs.moodle.org:/cvsroot/moodle co -r
MOODLE_19_STABLE moodle
Create a data directory and set Moodle directory permissions
Create a directory for user and course files
(you should still be in the /var/www directory)
mkdir moodledata
Set permissions so that Apache can access the files
chown -R www-data:www-data moodle
chown -R www-data:www-data moodledata
On a production server, you may want to tighten up privileges further.
Change Apache to use Moodle as the web site
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:
nano /etc/apache2/sites-available/default
On about line 4, change DocumentRoot "/var/www/" to
DocumentRoot "/var/www/moodle/"
On about line 10, change
Around line 17, comment out the line for the default page:
# RedirectMatch ^/$ /apache2-default/
You can change other values like ServerAdmin if appropriate.
For all changes, you should restart Apache for the new settings to take effect.
/etc/init.d/apache2 restart
No comments:
Post a Comment