HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (
-   Installation/Configuration (
-   -   Installing Moodle on ISPconfig server. (

johnsw16 31st October 2008 17:24

Installing Moodle on ISPconfig server.
I have moved some moodle installs (v1.5.3+) to a new webserver running ISPConfig. I think it is working in that I can see the site, users, files, etc.

The next stage was to upgrade (v1.6 -> 1.8 -> 1.9) which I've spent hours today tying to do...the problems I am having with this make me suspect that the main install may also have a problem.

When upgrading I get permissions error on the moodledata directory ("can't find or create file /var/xxxx/xxx/xxx/"). On other servers I have put moodledata in /var/www/moodledata (777) with the install in /var/www/html/xxxx and this works fine.

The client area in ISPConfig is, for example, /var/www/web20/ with the website in /var/www/web20/web/. So I've put the moodle install there and the files in /var/www/web20/moodledata. Now there is a problem: whatever permissions I use I get this find/create file error when trying to upgrade. I've tried 777, 707, changing the owner:group to apache:apache, using +s to try to force the ownership to remain with the web20 user, moving the data directory to /var/www/ and /var/www/html/ (i.e outside the clients own area) and even into /srv/ but all to no avail. In each case there are error messages with the moodle unable to create new files and/or directories.

Has anyone done this and have a definiative set of permissions and locations for this directory under ISPConfig?

All help gratefully received. Especially as this is the last day of half term and it will be being used on Monday...!

johnsw16 31st October 2008 20:28

Safe mode was enabled in ISPConfig.

Just in case it helps - DO NOT check the safe-mode box when configuring a site for a client in ISPConfig as this adds various php settings which stop apache writing to the directory. So, with this unchecked, the upgrade went without a hitch with the original set-up (i.e. /var/www/web20/moodledata with web20_admin:web20 / 777).

nenad 10th November 2008 20:16


can you please describe installation of moodle on ISP running server in more details, step-by-step ?


johnsw16 10th November 2008 22:44

I must assume you already have an existing ISPConfig controlled server - either you are a client on one or you manage one. If you are a client then the critical thing to find out is whether you are in php safe mode or not. If you are and you cannot change it then I Moodle will not work. You either give up now or ask the administrator to change it for you. All they need to do is make sure than the php safe mode button is NOT checked.

Of course you also need to be able to create a MySQL database - ISPConfig has its own phpMyAdmin to make this easy to so. As long as the administrator has (a) installed this addition and (b) given you the ability to create a database (or has already created it for you).

Finally you also need ftp access.

Assuming that you have all this and the relevant usernames, passwords, etc then you are good to go. I'm doing the following from memory but if all the above works for you then it is just a standard Moodle install. (see the site for details).

(1) Download the latest moodle install and ftp it to you home directory
(2) If all you want is a moodle install then you don't need your standard web directory (unless you intend to install moodle inside your site - e.g. mysite/moodle/ - in which case copy and expand the tar file inside the web directory.) so copy it just in case (cp -Rp web web.orig) then expand the tar file and rename it "web".
(3) Create a database (collation utf-8) in phpMyAdmin or use the one set up for you.
(4) Go up a level (so you see "web" as one of the directories listed along with cgi, etc) and create a directory for the moodle data (called, for example, "moodledata"!) It is important for security that this directory is out side the normal web directory. This should get the correct permissions but you may need to chmod it to 777 if there are problem - I run my own server and can go into the command line to do this. If you are a client of another administrator this will be a problem but, as I say, as long as apache can read and write to this directory all should be well. (It is this that is not allowed if you are restricted to safe mode).
(5) Copy the config-dist.php file to config.php
(6) Edit this file to give you the correct paths - site URL, site path (will probably be something like /var/www/web54/web/), data path (/var/www/web54/moodledata/) and the database details (dbname, host [ localhost]. username, passwd, prefix).
(7) Then access you site - the scripts will detect this as a new install and if all is well take you through the rest of the install and database creation. If there are settings missing or wrong it will put up quite good error messages.

Hope this helps and good luck!

nenad 10th November 2008 23:46

Thank you
In meanwhile, I installed moodle by myself and installation matches procedure which you posted :)

Thank you, I think it's nice to have this kind of setup instructions reminder here at How To Forge :)

nenad 5th April 2012 18:49

moodledata problem

I have a very strange problem.
I have set-up Debian Lenny (perfect install) with ISPConfog 3.
No problems at all.

Then I created reseller (client 2) and user under him (client 3).
Then I downloaded and unpacked all files for Moodle 1.9.7.
Unpacked it under client 3, set up permissions etc.

Then I created moodledata directoy, set up permissions etc.
And then Moodle was unable to procecced wit hinstalation because it was unable to see or write into directry moodledata. Note: moodledata is OUTSIDE of Web directoy. PHP safe mode is OFF.

So, here it is:

After some 30 minutes, and after changing ownership (including setting to www-data) and permissions finally I found out that if I point installation to /var/www/clients/client3/web1/tmp (owner: client2, group: web1, permissions: 0777) then installation will go further.

However, when I try to apply those settings for permissions from tmp directory to my moodledata directory it FAILS! Even if I delete moodledata and create different directory with different name and try to apply settings such as R/W: 0777, Owner web1, group client2 (or client 3) IT FAILS !!!

What I am doing wrong ???

nenad 5th April 2012 19:21

I ralised that even if safe mode is OFF there is open_basedir.
So I added path to the moodledata here:

open_basedir="/var/www/clients/client3/web1/web/moodledata:/var/www/clients/client3/web1/web:/var/www/clients/client3/web1/tmp: ....... etc"

Now, the question is:

1) Did I resolve tha tproblem with proper solution?
2) Is it going to be permaennt or ISPConfig3 is going to rewrite it sooner or later because of something?

falko 6th April 2012 13:03

You must add the path the the open_basedir field on the Options tab of the website in ISPConfig because otherwise your change will be overwritten.

nenad 15th October 2012 14:35

Moodle + ISPConfig email problem
Although I set up that server 6 months ago, I haven't really used it until now. I noticed that Moodle is not sending link for registration. So, I wondered if server is able to send emails anyway. Here is log from ISPConfig:


Mail Queue (Server :

Data from: 2012-10-15 13:05
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
50EFE2FE74* 2934 Mon Oct 15 12:46:41 MAILER-DAEMON

BDD912FE60* 1178 Mon Oct 15 11:45:56

6854D2FE6B 2087 Mon Oct 15 12:15:19
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

6D5FB2FE6D 2040 Mon Oct 15 12:30:18
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

040B92FE66 831 Mon Oct 15 11:52:09
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

274322FE68 796 Mon Oct 15 12:04:31
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

E2E592FE5D 2640 Mon Oct 15 11:31:23
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

3C76A2FE67 2040 Mon Oct 15 12:00:24
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

D2DDC2FE71 2039 Mon Oct 15 13:00:16
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

10EC62FE70 2039 Mon Oct 15 12:45:17
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

1F8C82FE6F 772 Mon Oct 15 12:30:22
(Host or domain name not found. Name service error for type=MX: Host not found, try again)
(Host or domain name not found. Name service error for type=MX: Host not found, try again)

-- 25 Kbytes in 11 Requests.
I tried even to send email as root using mail command, but with no success.
What baffles me is that the server name is "" - it was, but later I moved it into other network, and renamed it everywhere to ??

So, please, can someone instruct me where to change this servername to reflect real servername?

Also, what should I do in order to make email work?

Moreover, I created one mailbox with user and password, but
Squiremail at says that user doesn't exist?

P.S. I installed linux box according to this manual:

till 15th October 2012 14:38

Please add a DNS A-record for the domain that points to the IP-address of your server in the authoritive dns server of the domain or check the following files for this name and replace it with the new one:


and restart the server afterwards

All times are GMT +2. The time now is 04:44.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.