RedHat-based Linux distributions closely follow the File System Hierarchy Standard. This standard contains a set of requirements and guidelines for file and directory placement under UNIX-like operating systems. According to this standard any variable set of data should be placed in the /var
directory. This directory is assumed to be on a separate partition (whenever possible) and it is mounted as read/write. Under CentOS, Apache web server has a special directory designated to its needs —/var/www. The default directory for any web file is /var/www/html
. Files placed in that directory are located on the www root of the web server.
As we already know, Moodle has two major directories. One contains Moodle itself (usually called Moodle) while the other has all user and platform data that can change during the course of usage (usually Moodledata).
There are numerous options available as to where to install Moodle files. Three such possible options are:
Moodle is placed in /var/www/html/moodle
.
Moodledata is placed in /var/www/moodledata
.
mkdir /var/www/moodledata cd /tmp/ wget http://download.moodle.org/download.php/direct/stable19/moodle-weekly-19.tgz tar -C /var/www/html/ -xzf /tmp/moodle-weekly-19.tgz
Moodle is placed in /usr/share/moodle.
Moodledata is placed in /var/lib/moodle.
Apache is configured with an alias to this folder like this:
Alias /moodle /usr/share/moodle <Directory /usr/share/moodle/> Order Deny,Allow Allow from all AllowOverride None </Directory>
All sites are placed in /sites directory.
Moodle is placed in /sites/moodle1/html/moodle.
Moodledata is placed in /sites/moodle1/moodledata.
Apache is configured with a virtual host directive like this:
<VirtualHost *:80> ServerName mymoodle.srv.org DocumentRoot /sites/moodle1/html <Directory /sites/moodle1/html> AllowOverride None Allow from All </Directory> </VirtualHost>
18.116.65.130