Install moodle on Ubuntu 10.04

3 replies [Last post]
Last seen: 8 years 45 weeks ago
Joined: 2009-03-24
bOt Points: 120
Set up a virtual server


The whole point of Moodle is that users can access it over a network. The easiest way is to set up a URL for your server so that users can reach Moodle using the URL. Several steps are necessary.

  • Make sure the server on which Moodle is running has a static IP address on the LAN.
  • If you have a router on your network, forward incoming traffic on ports 80 and 443 (http and https) from the router to the (static) LAN IP address of the server hosting Moodle.
  • The firewall on the Moodle server should allow all incoming traffic on ports 80 and 443.
  • A URL for your Moodle site should have been established with a DNS name server on the Internet. It is possible to use a Dynamic DNS server, as well. An example URL is
  • A virtual host file in /etc/apache2/sites-available must be created for Moodle. $ cd /etc/apache2/sites-available

  • $ sudo cp default moodlevirtualhost

It should be edited (sudo gedit /etc/apache2/sites-available/moodlevirtualhost) to look like
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /usr/share/moodle/
#RewriteEngine On
#RewriteOptions inherit

Notes: The Rewrite options are listed here only for forward compatibility with Apache rewrite rules. They are only used for multi-site installations and can, in general, remain commented out (with the #).

$ sudo a2ensite moodlevirtualhost         

$ sudo /etc/init.d/apache2 restart
  • Edit the /etc/moodle/config.php file (sudo gedit /etc/moodle/config.php) so that the FQDN (in this case the URL) is correctly noted.
$CFG->wwwroot = '';
  • Login to the Moodle server:


Note:- This post has been edited by babbar.ankit at Mon, 2010-05-10 01:18.

Last seen: 9 years 20 weeks ago
Joined: 2010-07-08
bOt Points: 54
Recipe is a no-go here

Hello Babbar.Ankit

While I appreciate the fact that you have made the effort to provide a guide here, there must be some underlying assumption that you have not included. I followed the recipe step-by-step, with a valid FQDN, and IP. I am not able to access the http://myfqdn/moodle/admin (You do not have permission...yada,yada,yada). The sole functional portion is what would be the "Front page", which only provides the basic Apache default of "It Works"

I really have no desire to (re)develop expertise in the quirks of Apache or file system permissions; all I want is a  functional moodle server to which I can start inserting content. From the style of this article, I was assuming that someone like myself was the target audience. Perhaps an error on my part.

You should amend the content to either include the missing information, or make a note that the further file system or web server configuration required may be learned elsewhere.




shtywi's picture
Last seen: 9 years 12 weeks ago
Joined: 2010-08-28
bOt Points: 54

after i folowe all steps i face this problem



You don't have permission to access /moodle/admin/ on this server.

Apache/2.2.14 (Ubuntu) Server at localhost Port

after that when i recive another error

which is

Error: Database connection failed.

It is possible that the database is overloaded or otherwise not running properly.

The site administrator should also check that the database details have been correctly specified in config.php


so pls can you help me

Note:- This post has been edited by shtywi at Sat, 2010-08-28 22:18.