Installing moodle on a drupal site

Installing moodle on a drupal site

by Eric Lommatsch -
Number of replies: 3
Hello,

Perhaps I am posting this in the wrong place and I should also check with jumpbox to see if they can help me, but I wanted to see if someone in the moodle community could help me as well.

I am working on a project where I need to have four different web applications running on the same server. The four applications that I need to install are Drupal, CiviCRM, Elgg and Moodle.

I started off by downloading in installing the jumpbox version of Drupal. Then I installed Elgg and CiviCRM on that virtual server which is running on Ubuntu Linux 8.04.

Finally I went to the "Step-by-step Installation Guide for Ubuntu" on the Moodledocs and followed the directions as much as I could, given how the virtual server is configured.

The default Apache directory is /var/data/drupal/ so if in a browser I go to http://localhost my drupal site opens.

My goal is to get my server to work so that if I enter http://localhost/moodle my moodle installation opens up.

However, after downloading and decompressing the file when I get to the step about modifying the default file for apache I don't have a file that is named "default" what I have are file named "default.auto", "default.custom" and "default.off". These all are pointing the jumpbox-app. This file points to the existing drupal site and I don't want to change where my default website for the host points to.

But when i enter the url http://localhost/moodle I am getting a 403 forbidden request error. How do I get past this for this site?


Average of ratings: -
In reply to Eric Lommatsch

Re: Installing moodle on a drupal site

by Colin Fraser -
Picture of Documentation writers Picture of Testers
If you already have your Apache, PHP and MySQL up and running, then 90% of the problems are already solved. It is just a matter of getting Moodle unzipped and then installed.

There are a couple of options, the easier one is to copy the installation files to a folder called Moodle inside the drupal folder. Then run http://localhost/moodle/install.php thereafter the usual ubuntu install rules will take over. The default file for Apache is not "default" it is, or it should be httpd.conf and there are a couple of things that need be edited in it - or maybe not depending on what it is you want to do and what is already in the httpd.conf file already.

As it already reads drupal as the localhost, then anything you put into the drupal folder is accessible via Apache - if it can be served. The only other issue that would concern me is what files does the Server actually serve? There is a setting called:

<IfModule dir_module>

which should read something like:

DirectoryIndex index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.shtml index.phtml

If that is the same, or rather, if that setting has all these elements in it, and I don't know what other web based tools you are using are putting in there, then the Server should be OK.

By putting the moodle into the right place should get around the 403 error as well. If it doesn't then, still in the httpd.conf file, look at:

AllowOverride All

#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all

That should solve any lingering permissions error from the server anyway.

The other option is to use vhosts to segment your server. Apache.org has enough information to make that work for you.

Do not forget to reset the Moodle folder permissions to 00777 or 02777, whichever works actually.

When you create the Moodle config.php file, during the install, make sure you have it pointing to the right place.

In reply to Colin Fraser

Re: Installing moodle on a drupal site

by Lindley Bailey -
Another way is to configure apache to serve both sites with moodle as a sub domain. Leave moodle in it's original install folder (for easier troubleshooting in the future). The following link is for Ubuntu, but is similar for all other versions of linux. Use it as a guide to find your specific instructions.
The link tells how to change the default to the new site. Instead I created the new file for moodle, then just enabled that site (I did not run a2dissite, but did run a2ensite) and restarted Apache. Now both are available: http://localhost and http://localhost/moodle

Link: https://help.ubuntu.com/community/ApacheMySQLPHP

Hope this helps.
Lin Bailey

The pertinent part is quoted below:
"QUOTE"

Virtual Hosts

Apache2 has the concept of sites, which are separate configuration files that Apache2 will read. These are available in /etc/apache2/sites-available. By default, there is one site available called default this is what you will see when you browse to http://localhost or http://127.0.0.1. You can have many different site configurations available, and activate only those that you need.

As an example, we want the default site to be /home/user/public_html/. To do this, we must create a new site and then enable it in Apache2.

To create a new site:

  • Copy the default website as a starting point. sudo cp /etc/apache2/sites-available/default /etc/apache2/sites-available/mysite

  • Edit the new configuration file in a text editor "sudo nano" on the command line or "gksudo gedit", for example: gksudo gedit /etc/apache2/sites-available/mysite

  • Change the DocumentRoot to point to the new location. For example, /home/user/public_html/

  • Change the Directory directive, replace <Directory /var/www/> to <Directory /home/user/public_html/>

  • You can also set separate logs for each site. To do this, change the ErrorLog and CustomLog directives. This is optional, but handy if you have many sites

  • Save the file

Now, we must deactivate the old site, and activate our new one. Ubuntu provides two small utilities that take care of this: a2ensite (apache2enable site) and a2dissite (apache2disable site).

sudo a2dissite default && sudo a2ensite mysite

Finally, we restart Apache2:

sudo /etc/init.d/apache2 restart
"UNQUOTE"

In reply to Eric Lommatsch

Re: Installing moodle on a drupal site

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Are you sure.... our Ubuntu 8.04LTS sites all have the (relevant) Apache config files in /etc/apache2/sites-enabled.