More1and1 installation problems

More1and1 installation problems

by Diane Hawkins -
Number of replies: 82

I have read with interest the discussion on installing Moodle to 1and1 (UK) servers. I am very new to this, so apologies if I sound silly.

I set up my blank database using 1and1's MySQL interface, which created the database, user name, password etc and nothing else, so totally empty database.

I then ran installer.php and entered all required info.

After the accept licence page I was taken to a white page with the following displayed:

Setting up database

No warnings - Scroll to the continue button


(mysql): SHOW TABLES  

(mysql): SHOW LOCAL VARIABLES LIKE 'character_set_database'  

(mysql): SET NAMES 'utf8'  

(mysql): SHOW LOCAL VARIABLES LIKE 'character_set_database'  
It's been on this page for well over an hour now with nothing seeming to happen. There is no continue button at the bottom of the page, or any green confirmations as it describes in Moodle.docs. Clicking on the "scroll to continue" button doesn't change the page. There is a yellow triangle with an error on page message at the bottom left of my screen.
Server Operating System name (version also if possible): 1&1 Linux Hosting Browser name (version also if possible): IE7 Moodle version: latest weekly 19 Moodle install type? (New/Upgrade): New Moodle config.php attached?(N): I had confirmation this was written, but I can't find it in the moodle directory on my web host Phpinfo attached? (Y): Please see below

register_globals=off
safe_mode=off
memory_limit=128M
session.save_handler=FILES
magic_quotes_gpc=ON
magic_quotes_runtime=off
file_uploads=ON
session.auto_start=OFF
session.bug_compat_warn=OFF
AcceptPathInfo=on

Should I just leave it overnight, or is something wrong? Any help greatly appreciated. If you need more info I will do my best to supply it.

Many thanks,

Diane

Average of ratings: -
In reply to Diane Hawkins

Re: More1and1 installation problems

by Diane Hawkins -

I've left it overnight, so it's 12 hours plus now on the same page with no change.

If I open a new IE page and try to go to www.abernantprimary.co.uk/moodle/ I get this message:

Upgrade already running in this session, please wait!
Click on the exclamation marks to ignore this warning (!!!).
In reply to Diane Hawkins

Re: More1and1 installation problems

by John Wheaton -
Best you clear your browser cache and reload the page.

Your installation is finished. I went to the link you posted and this is what I saw:

Moodle - Modular Object-Oriented Dynamic Learning Environment

Copyright notice

Copyright (C) 1999 onwards Martin Dougiamas (http://moodle.com)

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the Moodle License information page for full details:
http://docs.moodle.org/en/License


Have you read these conditions and understood them?


In reply to John Wheaton

Re: More1and1 installation problems

by Diane Hawkins -

Thank you very much for taking a look for me - much appreciated.

Yes, I got the accept licence page again when I tried from my workplace BUT this is the screen I got BEFORE Moodle went on to set up the database tables. If I accept the licence again, it goes to exactly the same problem I describe above in my first post - setting up tables, no warnings, scroll down to the continue button: so I am well and truly stuck in a vicious circle.

Here is my config.php info if it helps, now I've found it!

<?php  /// Moodle Configuration File

unset($CFG);

$CFG->dbtype    = 'mysql';
$CFG->dbhost    = '****.oneandone.co.uk';
$CFG->dbname    = '****';
$CFG->dbuser    = '*****';
$CFG->dbpass    = '******';
$CFG->dbpersist =  false;
$CFG->prefix    = 'mdl_';

$CFG->wwwroot   = 'http://abernantprimary.co.uk/moodle';
$CFG->dirroot   = ******
$CFG->dataroot  = *****
$CFG->admin     = 'admin';

$CFG->directorypermissions = 00777;  // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php");
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
?>

In reply to Diane Hawkins

Re: More1and1 installation problems

by Tony Agar -

Diane, I might not be able to help you, but you may have solved one of my problems.

Of course you need to set up your your config file and enclose it with the following tags:-

<?php

?>

Whilst I was searching for some help I came across the following post which I am comparing to your config.php and there are some differences

http://moodle.org/mod/forum/discuss.php?d=76650

A chap called Richard then said it was good but he had 3 problems with it but didn't enlarge.

Keep trying

Tony

In reply to Tony Agar

Re: More1and1 installation problems

by Richard Enison -
TA,

You've got to watch out for wiseguys named Richard!

I object to your statement that I had 3 problems but didn't enlarge, implying that I didn't get specific on any of the 3. I actually said I had one major problem and 2 minor ones, and I went into great detail on the major one. Frankly, I don't recall what the minor ones were, so I withdraw them for now. I reserve the right to bring them up again when and if I remember what they are.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Tony Agar -

Richard,

After all your help, I hope you haven't taken too much offense at my previous post to Diane. When I first read your response to Billy Ristuccia it took me to a 12 page Moodle Document which was beyond me at the time, now having revisited it I see that you were in fact pointing to a tweak to the .htaccess file which should have read:-

AddType x-mapp-php5 .php
order deny,allow 
deny from all 

                                    
In reply to Tony Agar

Re: More1and1 installation problems

by Richard Enison -
TA,

As we say on my side of the pond, no biggy!

Anyway, my link in that post last year was to one small section of a Moodle doc page (the whole page may take 12 pages of paper to print out, depending on margins, etc.), and the post specifically stated "second paragraph", which is hardly 12 pages long by any measure I'm aware of.

You are correct that I was suggesting the use of

order deny,allow
deny from all

in .htaccess, but only if made necessary by BR having no choice about locating the data directory within the web-accessible area. I doubt if this is the case with 1and1, especially since, as DH's experience with 500 errors shows, those Apache directives in .htaccess files are not supported by 1and1.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Tony Agar -

Richard,

Those Apache directives in .htaccess files are supported by 1and 1 as you will see if you read the last part of my reply to Diane where I actually uploaded the .htaccess file from the 1 and 1 core directory.

Tony

In reply to Tony Agar

Re: More1and1 installation problems

by Richard Enison -
TA,

That raises the question as to why she got the 500 error when she used those directives and the error went away when she removed them. Maybe she misspelled something.

RLE
In reply to Tony Agar

Re: More1and1 installation problems

by Diane Hawkins -

Hmmmm. Very strange. I already tried the .htaccess file I think as described and as soon as I uploaded it I got a 500 internal  server error message. As soon as I deleted the contents of the file, the page reverted to the database set up page. I copied and pasted the contents from the moodle.docs installation guide, so it should have been okay.

Glad I may have unwittingly helped you out! *Smile*

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

Perhaps one of the other directives in the .htaccess file as documented in the installation guide was one that is not approved by 1and1. Just because it is in the installation guide doesn't imply that it "should be okay" with 1and1. It just means they are valid Apache directives. Every web host that uses Apache gets to decide whether to allow .htaccess files use at all, and which Apache directives to allow in them. Obviously 1and1 allows the use of .htaccess, but which directives does it allow in them? I have seen posts in these forums from Moodlers who got 500 errors just for putting an .htaccess file in a directory. They apparently were on a host that, unlike 1and1, didn't support .htaccess at all.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

Richard,

Thank you. I didn't know that directives were not universally supported, so I could try adding one at a time and seeing what happens.

Diane

In reply to Tony Agar

Re: More1and1 installation problems

by Diane Hawkins -

Tony,

I looked again at the post you mentioned above and after several versions of my .htaccess file left everything else out BUT added, as suggested in this post, this line to my .htaccess file:  AddType x-mapp-php5 .php

Bingo! Tables set up with green success labels like greased lightning. Yippee!

BUT, having gone through all that and getting more excited by the second, the final "continue" button took me to index.php which was, yes, you guessed it, a totally white page with absolutely nothing whatsoever on it...

I could cry!

.... but first I'm going to investigate whether it's anything to do with cron...

Meanwhile, if anyone else has been to this point and beyong - please share!

In reply to Diane Hawkins

Re: More1and1 installation problems

by Tony Agar -

Diane,

It may be a blessing in disguise that it doesn't work, because I have been advised by technical support that on the 1 and 1 sever it can be a bit a cuckoo, in so far as it Will take over your existing website.

Apparently, the correct way to install Moodle on 1 and 1 if like me you are on the business package or above is to create a sub domain first (you should have 300 free ones to use) and then upload Moodle into that.

Here is what I have received from 1 and 1 support, their latest reply is first!

Thank you for contacting us.

Yes, you would lose your web pages but for your moodle application to
run you need to assign it to another domain or sub domain. You don't need
to worry for this because all you have to do is simply create a
sub domain and install the moodle application to this sub domain and once
your done setting up the moodle application in your sub domain then go to
your main website wherein you will going to create another link for your
another course which will going to redirect to your sub domain. In this
way your main website is still up and running and its added with a new
link which will redirect to the sub domain where the moodle application
is installed.

If you have any further questions please do not hesitate to contact us.

--
Sincerely,
Ariel Contreras
Technical Support
1&1 Internet Limited

Registered at Cardiff, Company number 3953678  - VAT No GB 752539027
Aquasulis House, 10-14 Bath Road, Slough, Berkshire, SL1 3SA, United
Kingdom


> I am afraid I do not understand why I should do this.
>
> I have a "good" website for the Anchorage Sea School which list all
the
> services I offer. I wish to offer an additional one which is an on line
theory
> course. The easiest way to administer this is through a shareware
programme
> called Moodle.
>
> If I unassign WSC as you suggest surely I would lose my current
webpages?
>
>
> ----- Original Message -----
> From: <
<font face="times new roman,times,serif">support@1and1.co.uk</font>>
> To: <
<font face="times new roman,times,serif">tonyagar@yachtdelivery.wanadoo.co.uk</font>>
> Sent: Friday, October 03, 2008 2:15 PM
> Subject: C109961738 - 1&1 Internet Support Re: Account Number 8385496
>
>
> > Dear Tony Agar, (Customer ID: 8385496)
> >
> > Thank you for contacting us.
> >
> > Regarding your issue, you need to unassign the domain from the
Website
> > Creator before installing the Moodle. You need to have the domain
with
> > it own folder by creating the folder/directory in the root.
> >
> > Just follow the instructions below:
> > 1. Login to 1and1 Control Panel (
http://admin.1and1.co.uk )
> > 2. Click on  WebsiteCreator under Website Applications on your
1and1
> > Control Panel.
> > 3. On the WebsiteCreator overview just click on Edit
> > 4. On WebsiteCreator Settings page just choose for Assigned domain
> > "--Unassign WSC (Delete)--" click on OK.
> >
> > If you have any further questions please do not hesitate to contact
us.
> >
> > --
> > Sincerely,
> > James Levi Pangilinan
> > Technical Support
> > 1&1 Internet
> >
> >>
> >>
> >>
> >>
> >> I am trying to get moodle to work with my website.
> >>
> >> As recommended previously by Liberato Troyo, I have installed an
> > unzipped version of Moodle in my wsc12014634 directory.  The Moodle
> > people say that after updating my config.inc.php and a  .htaccess i
> > should be able to get it working by going to:-
> >>
> >>
https://admin.1and1.co.uk/wsc12014634/install.php
> >>
> >>
> >> However all I get is a message displaying the following
> >>
> >> The requested file was not found.
> >>
> >> This may be due to a technical error. Please try again later.
> >> If repeated attempts to access the file fail, then the file had
been
> > removed.
> >>
> >> Also i have set up a new page called moodle on my website with a
link
> > to the containing file
> >>
> >>
http://www.anchorageseaschool.co.uk/wsc120146434/moodle
> >>
> >>
> >> Please could you confirm that these https are correct.
> >>
> >> Thanks
> >>
> >> Tony Agar
> >>
> >> This email has been scanned by Norton Anti Virus
>
>
Another reason why I cant get Moodle to work is that for some reason I have named my config.php file, config.inc.php, I have obviously got confused with my phpMyAdmin which you will not need because Moodle will control your database when its up and running.

Another reason you might be having problems is that you need to check the number after /homepages/... below.

$CFG->wwwroot   = 'http://www.abernantprimary.co.uk/moodle';
$CFG->dirroot   = '/homepages/2/d68832301/htdocs/abernant/moodle';
$CFG->dataroot  = '/homepages/2/d68832301/htdocs/abernantmoodledata';
$CFG->admin     = 'admin';

I think you do this by going to Domains in your 1 and 1 control panel and clicking the furthest right button which I think is called View. If as you say you are running 6 websites the number must be a lot greater than 2 since every page on you sites has a sequential number, I am up to 46 on just 3 sites.

Finally I have come accross another .htaccess file under Logs in my 1 and 1 root directory. It reads


Tony
In reply to Diane Hawkins

Re: More1and1 installation problems

by Tony Agar -

Dear Diane,

You have got further than I have.

How did you get installer.php/install.php to work in the first place? When I go to it, nothing happens at all.

Hopefully I'll catch up.

TA

In reply to Tony Agar

Re: More1and1 installation problems

by Diane Hawkins -

Well Tony, it's taken 3 attempts to get this far, involving total deletion of all moodle files and MySQL tables from my server and starting again from scratch. The main thing was not taking tech support's word at 1and1 that my php settings were correct, when none of them had even been written - did that myself in the end and got further. I'm guessing that some permissions are incorrect somewhere, but not sure where....

Best of luck - I'm getting really frustrated now, so know how you feel!

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

You have confirmed the second of my two "rules" for installing Moodle at a commercial web host: don't ask their tech support staff to install or upgrade Moodle for you or to help you with a Moodle problem (a PHP, MySQL, Linux, Windows, Apache, IIS problem OK but not a Moodle problem) unless they are a Moodle Partner.

In case you're curious what the first one is, it is this: don't use Fantastico!

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -
LOL! Yes, I had read your first rule somewhere. And yes, I totally agree about tech support - usually when I ring them they know less than I do.... and the foreign accents don't help either...
In reply to Diane Hawkins

Re: More1and1 installation problems

by John Wheaton -
Maybe you've addressed this already, but all your folders need to be set to 755 and files to 644. Also, if you're getting a blank page there might be an error. If you have cpanel access, you should be able to check your error logs.

I've had blank pages with other applications when a character return or space ends up after the last > in a critical php file. You might doublecheck your index.php files to make sure they're OK.


The gurus here can advise you how to turn on error messages, so you can see the errors in your browser.

I may have missed this info, so sorry if I ask. Are you being hosted on a Unix/Linux server, or a Windows server?
In reply to John Wheaton

Re: More1and1 installation problems

by Diane Hawkins -

Hi John,

Thank you, yes folders are set to 755 and files to 644. I have also double checked my php files and they seem fine. There has to be an error somewhere, so I will follow your advice about error messages and do some forum browsing to see if there is an answer somewhere.

It's what to do with the error messages when I get them. I did get this one when I had turned messages on:

Fatal error: __clone method called on non-object in ..../abernant/moodle/lib/moodlelib.php on line 1817

and a different one just now:

Fatal error: Out of memory (allocated 30932992) (tried to allocate 35 bytes) in .../abernant/moodle/admin/mnet/MethodTable.php on line 77

I am hosted on a 1&1 Linux server. I followed the instructions "How to enable and check PHP error logs" located here: http://docs.moodle.org/en/Installation_FAQ#How_to_enable_and_check_PHP_error_logs and contacted tech support because I couldn't find the file even with the info provided. This is their sooo helpful reply:

About your query, please be inform the path that you are trying to access /usr/lib/php5/php.ini is on server side which need root access, since you are under a shared hosting account it is not possible only works on server account which has root access, if your webspace does not include a php.ini file in your root directory, you need to create one yourself with the directives you want to change.

I have done that (I think) to get the error messages above, but then removed the ini_set instructions because the error messages give the entire location of my directory away, which I thought would be dangerous:

<?php /// Moodle Configuration File

unset($CFG);

$CFG->dbtype = 'mysql';
$CFG->dbhost = 'db1632.oneandone.co.uk';
$CFG->dbname = 'db259986645';
$CFG->dbuser = '******';
$CFG->dbpass = '******';
$CFG->dbpersist = false;
$CFG->prefix = 'mdl_';

$CFG->wwwroot = 'http://www.abernantprimary.co.uk/moodle';
$CFG->dirroot = '/homepages/2/d68832301/htdocs/abernant/moodle';
$CFG->dataroot = '/homepages/2/d68832301/htdocs/abernantmoodledata';
$CFG->admin = 'admin';

$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php");

ini_set ('display_errors', 'on');
ini_set ('log_errors', 'on');
ini_set ('display_startup_errors', 'on');
ini_set ('error_reporting', E_ALL);
$CFG->debug = DEBUG_ALL;

?>

So not sure now how to proceed.

(Edited by Helen Foster to remove the db username and password - original submission Saturday, 4 October 2008, 05:51 PM)

In reply to Diane Hawkins

Re: More1and1 installation problems

by Diane Hawkins -
Added the config.php info just now, then immediately realised too much info and tried to delete the relevant paths only to be timed out by the system - can't even delete my post, so would really appreciate an administrator editing my post for me if that's possible please? I have changed the database password.
In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

When you post to a Moodle forum, you get 30 minutes to edit or delete it. After that, you are at the mercy of Helen Foster.

RLE
In reply to Diane Hawkins

Re: More1and1 installation problems

by John Wheaton -
I'm not sure I can help with either of those messages.

But I did find some advice specific to 1and1 in the forums here: http://moodle.org/mod/forum/discuss.php?d=76650

Considering your issues with 1and1, have you considered switching to a different host? I know moving a site is a bit of a pain, but it seems you already have those with 1and1.
In reply to John Wheaton

Re: More1and1 installation problems

by Diane Hawkins -

I've been with them for 6 years and never had any downtime on my sites, ever, which is not a bonus to be thrown away lightly.

This is the first time I've had to use their tech support for anything major - usually I resolve any problems myself by scouting around various forums and to be fair, this is the first major hurdle I've ever had.

To change host would be a mega headache as I have several sites with them, and I host for a couple of other people too, so I don't even want to go there.

The local education authority will be piloting Moodle across the secondary schools in the spring and being the sort of person who enjoys a challenge, wanted to get my own moodle up and running before then for my own sense of ahievement. It's been an experience, and I enjoy the challenge - it's been fun, and I thrive on challenges. But if at the end of the day  if it doesn't happen, it doesn't happen.

I'll take a look at the thread you suggest - thank you.

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

Actually, that thread is the same one TA mentioned yesterday as containing a post from me, whom he referred to as "a chap named Richard". It also contains a post that is on my list of more or less helpful links on 1and1 that I have accumulated over the centuries. Here is the complete list:

http://moodle.org/mod/forum/discuss.php?d=76650#p341000
http://moodle.org/mod/forum/discuss.php?d=46400#p218563
http://docs.moodle.org/en/1and1_MySQL_installation
http://moodle.org/mod/forum/discuss.php?d=102178#p451307

RLE
In reply to Diane Hawkins

Re: More1and1 installation problems

by Tony Agar -

Diane,

This page gives you the correct code to debug your php script

http://faq.oneandone.co.uk/scripting/php/3.html

but I have no idea where to put it, presumably in config file as you have.

It also doesnt tell you how to fix them.

Tony
In reply to Tony Agar

Re: More1and1 installation problems

by Diane Hawkins -

Thank you both for the links. I had seen them and taken a look, but hadn't really got any further forward as the relevant ones relate to dealing with errors, which I have no idea how to do. I added 1&1s script to my config.php file and it works, but I have no idea where the error.cvs file is written to, or even what to do with it if I did.

One of the errors I had was allocating memory, (exact error given in a previous post above), but again, I have no idea what to do about it. Someone suggested removing a module, but I presume that would be done through the admin page, which I can't access.

Tony's experience of 1&1 and the possible problems with his existing site are enough to put me off completely!

I have asked a moodle partner for a quote, as it just seems there are too many problems to overcome and I now have a mountain of planning and marking to deal with as I have neglected my main role as a teacher.

Thank you everyone for all your help so far. I may be back, but I'm going to have shelve this for now until I've caught up. Dealing with Curriculum 2008 is enough to cope with at the moment...

In reply to Diane Hawkins

Re: More1and1 installation problems

by Tony Agar -

Diane,

Do us taxpayers a favour, before you sign up with a Moodle partner, go to NineHub.com and upload all your courses which your students can access for free!

Tony

PS Don't give up on 1 and 1, eventually I will get there and promise to post the definitive idiots guide.

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

For when you get back from coping with the curriculum:

As for where the errors.csv file gets written, see my latest reply to TA (http://moodle.org/mod/forum/discuss.php?d=107350#p472702). Regarding the memory problem, my first guess is to increase the memory limit in PHP.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

Thank you Richard for the info on where the csv file can be written to, as I really have no experience of writing php whatsoever, other than minor adjustments. I have cut and pasted the line you gave me into my config.php file and uploaded it, but I just get my 404 page telling me the error.csv file cannot be found when I type in the url into my browser. I also tried wriitng the path to the data directory instead, and then had a look on the remote server for the errors.csv file, but it wasn't there either.

Just out of interest, what does the "a" in $errfile=fopen($CFG->dataroot."/errors.csv","a"); mean?

Thank you Tony for the morale boost!

STOP PRESS!

Altered the line to $errfile=fopen($CFG->dataroot."/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv","a"); and hey presto, voila the errors.csv file! Yeh!

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,
  1. The "a" stands for append, which means if the file exists, write after the end of it; if not, create it.
  2. I suspect you put the script too high in config.php, before $CFG->dataroot was defined, so it was treated as empty. So when you used the line as I specified it, it tried to write to the root directory of the whole file system, which you probably didn't have permission to do, so it didn't create the file. When you changed it to

    $errfile=fopen($CFG->dataroot."/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv","a");

    you might as well have used

    $errfile=fopen("/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv","a");

    Because I know from previous posts that /homepages/2/d68832301/htdocs/abernantmoodledata is the pathname of your data directory, so if $CFG->dataroot had been defined, you would have had the same pathname twice in a row, like /homepages/2/d68832301/htdocs/abernantmoodledata/homepages/2/d68832301/htdocs/abernantmoodledata.
  3. But the fact that you got a 404 has me concerned, because that's an error you get when you try to access a missing file or directory with a web browser. If the file was in your data directory, you shouldn't be able to access it with your web browser, for security reasons. Remember? That's the reason for the Apache directives that you didn't misspell, that seemed to cause the 500 error, in case the directory is within the web-accessible area! In fact, I should have noticed from that previous post that, since wwwroot ends with /moodle, your web root is htdocs, of which your data directory is a subdirectory, so it is in a very insecure place. If you can't get those directives to work, you need to move it (or vice versa).
RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

This is the file I uploaded to the server. As you can see, dataroot WAS defined before the error log part:

<?php  /// Moodle Configuration File

unset($CFG);

$CFG->dbtype    = 'mysql';
$CFG->dbhost    = 'db1632.oneandone.co.uk';
$CFG->dbname    = '***';
$CFG->dbuser    = '***';
$CFG->dbpass    = '***';
$CFG->dbpersist =  false;
$CFG->prefix    = 'mdl_';

$CFG->wwwroot   = 'http://www.abernantprimary.co.uk/moodle';
$CFG->dirroot   = '/homepages/2/d68832301/htdocs/abernant/moodle';
$CFG->dataroot  = '/homepages/2/d68832301/htdocs/abernantmoodledata';
$CFG->admin     = 'admin';

$CFG->directorypermissions = 00777;  // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php");

ini_set ('display_errors', 'on');
 ini_set ('log_errors', 'on');
 ini_set ('display_startup_errors', 'on');
 ini_set ('error_reporting', E_ALL);
 $CFG->debug = DEBUG_ALL;
 
 
error_reporting(0);
   $old_error_handler = set_error_handler("userErrorHandler");
 
   function userErrorHandler ($errno, $errmsg, $filename, $linenum,  $vars)
   {
     $time=date("d M Y H:i:s");
     // Get the error type from the error number
     $errortype = array (1    => "Error",
                         2    => "Warning",
                         4    => "Parsing Error",
                         8    => "Notice",
                         16   => "Core Error",
                         32   => "Core Warning",
                         64   => "Compile Error",
                         128  => "Compile Warning",
                         256  => "User Error",
                         512  => "User Warning",
                         1024 => "User Notice");
      $errlevel=$errortype[$errno];
 
      //Write error to log file (CSV format)
      $errfile=fopen($CFG->dataroot."/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv","a");
      fputs($errfile,"\"$time\",\"$filename:
      $linenum\",\"($errlevel) $errmsg\"\r\n");
      fclose($errfile);
 
      if($errno!=2 && $errno!=8) {
         //Terminate script if fatal error
         die("A fatal error has occurred. Script execution has been aborted");
      }
   }

?>

In reply to Diane Hawkins

Re: More1and1 installation problems

by Diane Hawkins -

To clarify:

typing http://www.abernantprimary.co.uk/moodle/errors.csv brought up the 404 because the original line of code you gave me didn't work

so

I tried $errfile=fopen($CFG->dataroot."/errors.csv","a");  as it was safer

that didn't work either

so

I tried $errfile=fopen($CFG->dataroot."/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv","a" which did work. Note the location of the line of code did not change from where you see it now in the above post. Now you have explained it, I can see what you mean about my line of code defining where to write the file twice. As I said, I am very new to this and the obvious to someone "in the know" has to spelled out very simply for a novice like myself. So, as you say, I may as well change that line to $errfile=fopen("/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv","a");
which I will do now.

Another point I am wondering about is the line $CFG->directorypermissions = 00777; 

Why did config.php write this value when it defaults to 755 for folders and files to 644 on the server? I have tried making the values match in config.php and the on server. Which should it be 777 or 755?

In reply to Diane Hawkins

Re: More1and1 installation problems

by Diane Hawkins -

As for the (abernant)moodledata folder, according to the instructions for installing moodle, this folder IS outside the website directory, so I am very confused - it is where moodle put it on installation, outside of www.abernantprimary.co.uk I didn't create it manually, other than renaming the folder in the set up process - I left the path alone having read the instructions below and it has the default .htaccess file written by moodle denying all.

Creating the data directory

Moodle will also need some space on your server's hard disk to store uploaded files, such as course documents and user pictures. The Moodle installer tries hard to create the moodledata directory for you but if it fails then you will have to create a directory for this purpose manually.

Security warning: For security purposes, it is CRITICAL that this directory is NOT accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web site root directory (it is the folder that the main part of your URL -that is, the part up to the first single / - points to; for example, in http://your.domain.com/moodle/admin/cron.php, it is http://your.domain.com/).

In reply to Diane Hawkins

Re: More1and1 installation problems

by John Wheaton -
Diane --

Let me poke my nose in here and try to help. What Richard is saying is that ./htdocs is your WWW folder, so anything inside it is potentially accessible to people browsing the web.

From the looks of it, your moodledata folder is also within ./htdocs. Richard says it shouldn't be there. If I understand your setup correctly, your directory structure looks like this:

/
--/htdocs
----- (all the files for the main school site)
----- /moodle
----- /abernantmoodledata

and it should be:

/
--/abernantmoodledata
--/htdocs
----- (all the files for the main school site)
----- /moodle

So this statement "/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv" really should be "/homepages/2/d68832301/abernantmoodledata/errors.csv," if the moodledata folder is "outside" the web-accessible directory.

The moodledata folder has to be 777 so that everyone can save (upload) their files in it from the moodle application. But if it is 777 <em>and</em> within ./htdocs, the entire world can read what is inside and write anything into it. That's why it has to be outside ./htdocs, so that only you (the webmaster) and moodle can write to it.


In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,
  1. JW has restated my point about the insecure location of your data directory. Perhaps you understand his formulation better than mine. I was going to suggest a test you can do to prove one way or the other whether it is web-accessible, although, as I said before, the 404 you report suggests you have already done this. Try typing this in your web browser:

    http://www.abernantprimary.co.uk/abernantmoodledata/errors.csv

    If it works, your data directory is exposed.
  2. I think I know why the $CFG->dataroot was not defined in the script; I'm virtually certain. My mistake. The fopen line in which I suggested using it is inside a function, and $CFG is not declared global anywhere in the config.php file you show in your post, so it was not accessible to the function. It's okay that it was not declared global; this is normal for config.php. Normally, this does not hurt because config.php is included by other PHP files that do declare it global. But it is also true that every function in every Moodle PHP file that uses the $CFG variable declares it global. Normally, config.php doesn't contain any functions. Now you have one, and it would need to contain the line

    global $CFG;

    near the beginning of the function for my code to work. Sorry about that.
  3. Now that you have Googled the error msg. you got, which btw pointed to line 8 of the file version.php in the directory for the Assignment Module, which should read

    $module->version = 2007101509;
    

    you know that this error frequently is related to memory leaks, so once again, if you allocate more memory, maybe it will go away. I was somewhat unhappy about the fact that the error level, which was supposed to appear between the parentheses, was missing (note the parentheses after the 8 in the error line in errors.csv). This means that none of the expected level numbers (the doubling sequence 1,2,4,8,...,1024) was given. If it was my site, I would get rid of the cutesy code in the error handling function in config.php that tries to convert the error level number to a word, and let us see the number. I would do this by editing the line that says

    $linenum\",\"($errlevel) $errmsg\"\r\n");

    and replace $errlevel with $errno.
  4. The $CFG->directorypermissions definition in config.php is the permission mode Moodle assigns to subdirectories (direct and indirect) of your data directory it creates. That's what JW was talking about in the last paragraph of his post. But he understates the vulnerability: see the statement in bold inside a box with a cyan background in your favorite section of the Moodle installation doc page, which reads:

    If you don't protect the data directory from direct web access, anybody will be able to impersonate any user of your Moodle site (including the admin user!!!), and all of your course materials will be available to the web at large.

    This is because of the session files usually stored in a subdirectory of the data directory.
  5. To recap what happened with the data directory: I don't think Moodle was aware that your web root was actually the parent directory of your main Moodle directory; it simply created the data directory outside the main Moodle directory, namely under its parent, thereby putting it within the web-accessible directory htdocs.
RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Tony Agar -

Re-joining this discussion, I am at the stage of Diane original config.php file as she posted it on 3rd Oct at 1729 BST. This is the file that Moodle sets up on it's intial installation on the 1 and 1 web sever.

I find that in addtion to all the directories that Moodle has set up, it has in fact also taken over my database in mySQL and I now have 90 tables in it! All of which can accessed and edited through myPHPadmin. Fantastic?

I notice that Moodle has also set up another .htaccess file in my moodledata directory which reads:-

deny from all

AllowOverride None

This is in addtion to the one I set up in the original unzipped moodle directory folder which reads:-

AddType x-mapp-php5 .php

order deny,allow
deny from all

Why are these different?

Also at the monent whatever I type into my browser window I get a 500 error like Diane which I have asked 1 and 1 to explain.

The next question since Moodle seems to have inserted itself quite happily into my web enviroment, is how to a I get to the starting page.

All websites need an index page. Would including the line in my .htaccess file help

DirectoryIndex index.php index.html index.htm

Also I suddendly discovered that I didnt upload the following into a php.ini file:-

magic_quotes_gpc = 1
magic_quotes_runtime = 0
file_uploads = 1
session.auto_start = 0
session.bug_compat_warn = 0
upload_max_filesize = 128M
max_execution_time = 2400
memory_limit = 128M
post_max_size = 128M
SMTP = localhost

Which I am doing now, will report back


Tony

 

In reply to Tony Agar

Re: More1and1 installation problems

by Richard Enison -
TA,
  1. By BST do you mean Brazil Standard Time or Bering Strait Time? According to your Moodle profile, you used to be in the UK! (See http://www.acronymfinder.com/BST.html)
  2. Actually, it only "took over" your database temporarily; just long enough to create and partially populate those tables. And strictly speaking, it didn't really take it over, since MySQL can handle multiple client requests at the same time. Moodle is a client, phpMyAdmin is another. But only 90? Sounds kind of low. Perhaps the development team has streamlined the database; it used to be more than twice that many.
  3. The two .htaccess files are different in their content for a very simple reason: one was created by you, the other by Moodle. As JW and I said to DH, putting deny from all in the .htaccess file in the main Moodle directory is not a good idea, since it would make Moodle inaccessible from the web. In other words, you can't use it at all!
  4. On the other hand, the second directive Moodle puts into the .htaccess file in the data directory doesn't make a whole lot of sense either. AllowOverride None means ignore .htaccess files. So the .htaccess file is telling Apache to ignore it, itself! What good does the .htaccess file do, then? Fortunately, Moodle only writes that file if it doesn't find one there already. So I would just edit it. Get rid of the second line, and put in a new line before the deny line saying "order deny,allow".
  5. The DirectoryIndex directive you suggest is probably unnecessary (it should already be in httpd.conf) and would probably cause a 500 error. To get past the problems you are having accessing Moodle without getting a 500 error, I would suggest making the changes I suggested in the previous paragraph.
RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Tony Agar -

RE

I might as well be on Brazil Standard Time for all the headway I am making!

  1. Going back to Billy Ristuccia original post, after all he did get Moodle 1.8 to work on 1 and 1 which is what I am trying to do http://moodle.org/mod/forum/discuss.php?d=76650 ,I notice that Diane's and my original config.php files now contain 3 or 4 lines that his did not:- unset ($CFG), $CFG->dbpersist = false;, $CFG-> = 'admin', $CFG->directorypermissions = 0777; and require_once(etc). What would be the effect of deleting these?
  2. I have noticed that in my servers root directory whilst my moodledata directory is 777, moodle inself is at 755?
  3. I have now moved "order deny,allow deny to all" to the .htaccess file in my moodledata directory (which moodle set up) and edited the one in my moodle directory to just read AddType x-mapp-php5.php as he suggested. Security is not a problem at the moment since I have all my moodle flies in a sub domain which I would only be too delighted if I  or indeed somebody else could get to work!
  4. I have attached the directory set up which Diane and I share at least in the server structure. If you use XXX/moodle/index.php you only get a get a 404 error File not found, if you just typeXXX/index.php you get a 500 server error. Perhaps that is where we are having the problem?

TA

In reply to Tony Agar

Re: More1and1 installation problems

by Richard Enison -
TA,
  1. There is no place in his post where BR said he deleted those lines. He was just giving a pattern for Moodlers to follow for certain parts of their config.php file, in two parts no less (the database part and the pathnames part). If any claim was made that those constituted the entire config.php file, then he would have had to have deleted the <?php line at the top and the ?> line at the bottom, and then it wouldn't work at all.
  2. Your moodledata directory should not be at 777. That would make it readable and writable to everyone who has, or can get, access to your file system. The installation doc page suggests 750 would be more secure, although it says on a shared host it might be necessary to use 707, which makes no sense to me (700 maybe, but not 707), but that's what it says.
  3. Good.
  4. I'm surprised by these error numbers, because my impression from DH's posts showing her config.php and how she accesses (or tries to) Moodle is that the web root is htdocs; moodle, where the main Moodle PHP files like index.php, install.php, etc. are, is a subdirectory of htdocs, which is why she accesses Moodle by typing xxx/moodle. As far as I know, neither of you have a file called index.php in the parent directory of the main Moodle directory, so I would expect xxx/index.php to give you a 404 File not found. Since you get a 500 from that and a 404 from xxx/moodle/index.php, I am starting to wonder whether your web root is not the Moodle directory after all. That would be consistent with here claim that htdocs is not web-accessible. But then we still haven't explained the 500. What happens if you just type xxx, or xxx/moodle?
  5. I have looked at your attachment. The first table seems to confirm my hunch, because it shows the home directory as moodle, not htdocs. But the table at the bottom is confusing. Ignoring that, if the web doc root really is moodle, then you should be accessing Moodle by xxx and not xxx/moodle, and the wwwroot in your config.php should be adjusted accordingly.
RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

I think you are confusing me with Tony. I have never had "deny from all in the .htaccess file in the main Moodle directory" - this has only ever been in the moodledata directory!

I increased the memory from 128M to 256M and then to a whopping 512M with absolutely no effect whatsoever.

Here is my config.php file as it stands:

<?php

unset($CFG);

$CFG->dbtype    = 'mysql';
$CFG->dbhost    = 'db1632.oneandone.co.uk';
$CFG->dbname    = 'db259986645';
$CFG->dbuser    = '***';
$CFG->dbpass    = '***';
$CFG->dbpersist =  false;
$CFG->prefix    = 'mdl_';

$CFG->wwwroot   = 'http://www.abernantprimary.co.uk/moodle';
$CFG->dirroot   = '/homepages/2/d68832301/htdocs/abernant/moodle';
$CFG->dataroot  = '/homepages/2/d68832301/htdocs/abernantmoodledata';
$CFG->admin     = 'admin';

$CFG->directorypermissions = 777;

require_once("$CFG->dirroot/lib/setup.php");

ini_set ('display_errors', 'on');
 ini_set ('log_errors', 'on');
 ini_set ('display_startup_errors', 'on');
 ini_set ('error_reporting', E_ALL);
 $CFG->debug = DEBUG_ALL;
 
 
error_reporting(0);
   $old_error_handler = set_error_handler("userErrorHandler");
 
   function userErrorHandler ($errno, $errmsg, $filename, $linenum,  $vars)
   {
     $time=date("d M Y H:i:s");
     $errortype = array (1    => "Error",
                         2    => "Warning",
                         4    => "Parsing Error",
                         8    => "Notice",
                         16   => "Core Error",
                         32   => "Core Warning",
                         64   => "Compile Error",
                         128  => "Compile Warning",
                         256  => "User Error",
                         512  => "User Warning",
                         1024 => "User Notice");
      $errlevel=$errortype[$errno];
 
      $errfile=fopen("/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv","a");
      fputs($errfile,"\"$time\",\"$filename:
      $linenum\",\"($errno) $errmsg\"\r\n");
      fclose($errfile);
 
      if($errno!=2 && $errno!=8) {
         die("A fatal error has occurred. Script execution has been aborted");
      }
   }

?>

and my php.ini file:

register_globals=off
safe_mode=off
memory_limit=512M
session.save_handler=FILES
magic_quotes_gpc=ON
magic_quotes_runtime=off
file_uploads=ON
session.auto_start=OFF
session.bug_compat_warn=OFF
display_errors = On
display_startup_errors = On
log_errors = On
upload_max_filesize = 128M
max_execution_time = 2400
post_max_size = 128M
AcceptPathInfo=on

My .htaccess file is also attached as a .txt file

Moodle (surprisingly to me) copied it from my main abernant directory. I just added the line AddType x-mapp-php5 .php

In reply to Diane Hawkins

Re: More1and1 installation problems

by Patrick Plummer -

Diane, I was having similar problems until I found this:

http://moodle.org/mod/forum/discuss.php?d=105969

Basically it's a memory problem on 1and1.  A FAQ page for PHP states that the max memory is 20MB...it looks like it's actually more like 30MB based on the PHP memory aloocation errors I was getting.  To use 1and1 you'll have to make Moodle use less memory -- this can be done by removing unneeded modules.  In the case above (and for me) the Workshop module was not needed.  After that the install continued and I was able to log in with the moodle admin account.  The only way I can see to avoid this completely is to upgrade your package to the $69.99 / month value managed server plan (Linux).  Quite a jump from $10 a month, huh? 

If you're familiar with PHP you might also try unloading PHP extensions.  I'm not sure how to do this...but according to phpinfo() a bunch of stuff is loaded that is probably not used.  For example, I don't use SSL so the openssl mod could probably go.

My install:

Business 1&1 Linux Shared Hosting
Moodle 1.9.2+
MySQL 5.x
Running under PHP 5.2.6

I modified the php.ini and .htaccess files as noted in some of the previous posts.

I'm now testing to ensure that the mem alloc error doesn't come up in the middle of using the site.  Hopefully my number of concurrent users isn't very low.

--Patrick

In reply to Patrick Plummer

Re: More1and1 installation problems

by Diane Hawkins -

Oooh, now that looks promising. Thank you for the link. How do you uninstall a module? Presumably it's not quite so simple as just deleting that folder from the server?

You seem to be running the same as me:

Business Plan Shared Hosting Linux Server http://order.1and1.co.uk/xml/order/Hosting;jsessionid=067BBF4A3D859B0CE60A3032B8F1C70C.TC30a?__frame=_top&__lf=Static £8.99 per month

Moodle 1.9.2+

PHP 5.2.6

Apache version is 1.3.34

Just found this thread: http://moodle.org/mod/forum/discuss.php?d=106659&parent=469477 : uninstalling modules is done by the delete link in admin/modules.php - drat and double drat! Until I get access to my pages, unless anyone can tell me otherwise, I can't uninstall any modules? How did you uninstall your workshop module prior to completion of your install?

In reply to Diane Hawkins

Re: More1and1 installation problems

by Patrick Plummer -

I just deleted the workshop directory completely (under /mod) and poof, it was working the next time I tried to run the main index.php.

So far no problems...I created a couple of courses and added some content.  I'm a Moodle newbie though.  I'll be uploading some additional content and creating quizes this evening.

In reply to Patrick Plummer

Re: More1and1 installation problems

by Diane Hawkins -

Patrick,

I tried exactly the same thing as you last night, but this solution didn't work for me unfortunately.

I couldn't bear to lose hot pot or wiki - they are really useful!

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

Well, theoretically you could delete a module by somehow executing the code in admin/modules.php associated with module deletion, which is normally executed when one clicks on the delete link in Moodle while logged in as administrator. However, the code quoted in the post by TH that you link to in your post is only a small portion of that code. So be careful. The code won't work properly out of context; you've got to fool it into thinking that you are logged in as administrator and make sure all the global variables are initialized properly. In any case, it is a good idea to delete the module directory itself (under moodle/mod) after running that code; it doesn't look like the code does so.

To give you an idea of what else the code does, here are the comments from the code:

// OK, first delete all the relevant instances from all course sections
// delete calendar events

// clear course.modinfo for courses
// that used this module...
// Now delete all the course module records
// Then delete all the logs
// And log_display information
// And the module entry itself
// And the module configuration records
// cleanup the gradebook
// Then the tables themselves
// Delete the capabilities that were defined by this module
// remove entent (sic) handlers and dequeue pending events

and finally the custom stuff you saw in TH's post. I think by entent they meant event.

EDIT: Needless to say, I worked on this post for a while, and PP beat me to the forum by 3 minutes. If you are tempted to use his method of just deleting the directory, see this:

http://moodle.org/mod/forum/discuss.php?d=69176#p344981

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Patrick Plummer -

Yes, this is probably a good idea.  However, I noticed that once the main install completed and I could get to my Admin pages, I was then able to go to Modules -> Activities -> Manage Activities and see the warning that the Workshop module was "missing from disk".  I clicked Delete and removed any left over references from associated tables.  It gave me the additional instructions to now "delete the mod/workshop dir from the disk".  So it looks clean at this point.

--Patrick

In reply to Patrick Plummer

Re: More1and1 installation problems

by Patrick Plummer -
Followup to the above:  1and1 is REALLY tight on memory.  I really needed the Certificate module to be installed.  To do it without getting memory alloc errors, I had to delete a number of default modules:  SCORM, WIKI, HOTPOT, and CHAT.  Ouch.  I don't need any of them, but the wiki might have been nice.
In reply to Patrick Plummer

Re: More1and1 installation problems

by Diane Hawkins -

Patrick,

I contacted 1&1 about this very thing. This is the content of my last few emails:

Hi,
You never got back to me with an answer about this error message, although I did send the url as requested. Please can you help me with correcting the error reported:
Fatal error: Out of memory (allocated 30932992) (tried to allocate 35 bytes) in /homepages/2/d68832301/htdocs/abernant/moodle/admin/mnet/MethodTable.php on line 77 which I get on trying to access http://www.abernantprimary.co.uk/moodle/admin/index.php

I have tried increasing the memory in my php.ini file from 128M to 256M and even 512M, but this doesn't correct the error. My php.ini file is now set back to 128M.

Thank you very much indeed,
Diane Hawkins
-------------------------------------------------------------------------------
Dear Diane Hawkins, (Customer ID: 5199184)

Thank you for contacting us.

We would like to apologize for the duration it took us to reply back to your email, as much as we strive to respond to all emails within 24 hours.
Regarding on you concerns  that you have send us , the error message is asking from this path. /homepages/2/d68832301/htdocs/abernant/moodle/admin/mnet/MethodTable.php
So you'll have to upload the php.ini file inside the directory where the setting is required. The setting is required from mnet/ folder so this  should be where you'll have to upload the php.ini file. And also you can only increase the limit to 128 MB with php version 5.
If you have any further questions please do not hesitate to contact us.

Sincerely,
Liberato Troyo
Technical Support
1&1 Internet
-----------------------------------------------------------------------
Hi,
Thank you for your email. I thought I WAS using php 5? If not, how do I get
to use version 5 please? I have copied the php.ini file into that directory, as advised.
Thank you,
Diane
-----------------------------------------------------------
Dear Diane Hawkins, (Customer ID: 5199184)

Thank you for contacting us.

You'll need to create a .htaccess file and upload it unto the folder where PHP 5 is required. And add the following line below.

AddType x-mapp-php5 .php //well, did that DAYS ago - shows they didn't look and SEE the .htaccess file which was already in place containing that very line of code!!!//

If you have any further questions please do not hesitate to contact us.
----------------------------------------------------------
My latest reply:
I already did that and it didn't work. I also tried AddHandler x-mapp-php5 .php instead which also made no difference.
In reply to Diane Hawkins

Re: More1and1 installation problems

by Patrick Plummer -
Hmm, thank you for the additional info from 1and1.  I'm a little suspicious of their answer...the php.ini file should work for the current directory and all sub-directories.  You shouldn't need one in the /mnet sub-dir.  Oh well, its worth a shot -- I'll try it any try to put wiki back on.
In reply to Patrick Plummer

Re: More1and1 installation problems

by Diane Hawkins -
Yep, that's EXACTLY what I thought Patrick! And BTW, their solution didn't work, as I expected!
In reply to Diane Hawkins

Re: More1and1 installation problems

by Diane Hawkins -

I created a subdomain and started again from scratch. Voila - and without any further "help" from 1&1! Whole thing took 5 minutes tops!

Yeh!

http://moodle.abernantprimary.co.uk/moodle/

In reply to Diane Hawkins

Re: More1and1 installation problems

by Diane Hawkins -

A huge thank you to all you wonderful people who have given so generously of your time in order to try and help me out - your help has been very much appreciated. Thank you!

BTW, does anyone know how to edit a mistake on set up? I want to edit the main title - Abernant primary School Moodle should read Abernant Primary School Moodle. I would also like to know where to go to "brand" the front page, eg add the school badge before or after the name of the site, add a photo and text etc to the middle section of the entry page - can anyone point me in the right direction to a tutorial?

Thanks!

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,
  1. To edit the title of your site,
    1. login as administrator;
    2. in the admin menu, click on Front Page;
    3. in the submenu, click on Front Page settings;
    4. edit the Full site name;
    5. optionally edit Short name and/or Description;
    6. click the Save Changes button at the bottom of the page.
  2. To edit the Front Page, display it while you are logged in as administrator, and click the "Turn editing on" button. For more details, see the book mentioned in the next paragraph (#3, subparagraph #1).
  3. You want tutorials? We've got tutorials!
    1. The Using Moodle book. Download it free as a pdf file using the link in the lower left corner of the page at http://moodle.org.
    2. Label
    3. http://moodle.tokem.fi/mod/book/view.php?id=51005&chapterid=9563 and following.
    4. This teaches how to change the logo in your page headers by changing your theme. You could make other changes to the headers, such as inserting other text and graphics before and after the logo, by further editing the theme.
    5. Speaking of which, is the first of 7 parts on editing your theme. Look under Related Videos for most of the other parts (2 through 5). By the time you get to part 5, parts 6 and 7 will be under Related Videos.
    6. on editing a course. Bear in mind that the front page of a Moodle site is a course -- the site course.
RLE
In reply to Richard Enison

Re: More1and1 installation problems

by greg mushial -

Richard -

I'm interested in your comment that the book can be downloaded as .pdf's.... when I click any of the links at the lower left of the page all lead me to amazon.com (and no mention of any downloads). Any further hints as to how to download the .pdf's?

many thanks,

greg

In reply to greg mushial

Re: More1and1 installation problems

by Richard Enison -
GM,

You're right. Either I was mistaken about the location from which you can download it, or some mean, nasty, stingy webmaster sneaked in during the night and changed it! There's no history tab on that page as there is on the doc pages, so it's hard to tell, never mind when or by whom.

Don't tell anyone, but there's still a page where you can download the Using Moodle book as a zipped pdf file. If you're quick you might be able to get it before the webmaster notices: Using Moodle book. So be very quiet about it!

BTW don't be deterred by the fact that the link at the top of the page goes to the Amazon page. Go to the "Book download" section.

I don't know about the other book, but there are some associated freebies available at http://www.packtpub.com/free, including a sample e-book derived from the Rice book, and the code files associated with the book.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

RLE

Again, many thanks for those links - just the job!

I've customised most of the colours for http://vle.cwmbachjunior.co.uk/moodle/ but cannot get rid of the remaining brown you see on the page - it looks as though they are gradient fills, starting with white at the top - and I cannot get rid of them - every colour I sample doesn't seem to exist in the css file. Again, I'd be very grateful for any suggestions.

Thank you!

DH

In reply to Diane Hawkins

Re: More1and1 installation problems

by Penny Magas -
Diane - your site looks very nice! Good job! And congrats on completing the install. I ran across your posts yesterday and almost gave up on my own - your tenacity kept me going, though. approve The brown bar is the 'navbar' in your css file and the image file is bg_bread.jpg

I used a tool that my daughter found for me years ago that helps me 'decipher' what's what in my templates, etc - and for that matter in my own creations when everything goes haywire when I publish a new page. It's DOM Mouseover and you can find it here - http://slayeroffice.com/tools/modi/v2.0/modi_help.html

It's more simple than it looks. It's a favelet or bookmarklet. You bookmark their link, then when you're in a browser on the page you want to study, you choose the bookmark. When you mouseover an item it tells you all of the css attributes.
(The image name I discovered by rightclicking on it in Firefox and choosing View Background Image.)

Have a great day!
Penny
In reply to Penny Magas

Re: More1and1 installation problems

by Diane Hawkins -
Wow! Thank you so much Penny, both for the solution to my "brown" problem, and for that nifty tool link - as well as the compliments! Good luck with your own install!
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

RLE

I have worked out how to get my intro page showing (I think), but everything is huddled at the far right of the centre section and looks awful, even though I formatted everything in the html editor. Have you any tips for making it look better please?

Unfortunately http://uk.youtube.com/watch?v=vtPpmxVhGBU is too poor quality to see what's happening - everything is blurred beyond recognition.

I have customised successfully the appearance of the site (I hope) and I think everything is now looking okay, except for that centre block.

Is there anything anywhere I have overlooked?

DH

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

I believe, if you are talking about the fact that the course summaries (Welcome Page is the name of the course; the stuff to the right is the summary of that course) are confined to the right-hand (roughly) half of the middle column, that this is normal, at least for the theme you are using. This is controlled by the fact that the summaries are in a division of class "summary" that is within a division of class "coursebox" (as well as clearfix), and in the stylesheet generated by the script http://vle.cwmbachjunior.co.uk/moodle/theme/standard/styles.php, it gives the following specification:

.coursebox .summary {
 float: right;
 text-align:left;
 width: 48%;
 padding:5px;
}

which implies that, in a division of class summary within a division of class coursebox, the width is 48% of the width of the column. My Moodle (formal_white theme) front page middle column course summaries look that way too.

And btw I found that by looking at html and css code, without using the Mouseover DOM Inpsector; but I'm considering bookmarking it anyway (after I examine the javascript code and make sure it doesn't contain any malware), just to speed things up.

Well, it took some detective work, but I found where that block of css code came from (I don't even think the Mouseover DOM Inpsector would have helped, but I could be mistaken). Because it's not in the php files that generate the css. It's in moodle/theme/standard/styles_layout.css. So I did a little experiment with my own Moodle site. I changed the 48% to 100% in that file to see if it worked. It did. In fact, the text is a little too wide now; the leftmost part of each line is to the left of the left border of the enclosing box! But I'm sure you can find a way to adjust the formatting parameters, including that 100% (maybe 95% or some other number would work better) to get it to look the way you want it to.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

RLE

Width: 95% and Padding: 15px - perfect!

BTW, do you know what theme does http://moodle.org/ use? I like the summary boxes very much. I'd like to use that one for Abernant - only needs the header image and background colour changing!

DH

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

Sorry. In my previous post, when I mentioned the Using Moodle book, I meant to refer more specifically to chapter 3 of that book, especially the section at the beginning of the chapter on inserting labels. Labels can contain text and/or pictures.

RLE
In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

I suspect you misunderstood the first msg. you quoted from tech support, regarding your PHP version. They were only saying that you can only raise your memory limit to 128 MB with version 5. That means that since you are using version 5, you are limited to 128 MB. It doesn't mean they are denying that you are using version 5.

Now that you have recreated your site from scratch and it is working, this is probably moot. But for future reference: if there is any question about what version of PHP you are running, just put a file in your site's main directory to produce a phpinfo list (I think you know how to do that). It will show the version at the top of the page.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

RLE

That coding looks way too technical for me to edit with any confidence. I'll leave that well alone I think. I had hoped that simply deleting the folder online would have the desired effect, but I learned long since that solutions which seem really simple never live up to their promise!

DH

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

When I clicked on the "Show parent" link at the bottom of your post, it shows that you were replying to a post of mine addressed to TA (Tony Agar). I think you will find that if you click on the "Show parent" link at the bottom of that post, you will find that it was indeed a reply to one of his posts, not yours. So I was not confusing you with him in that sense. If you were referring to the fact that I mentioned you in that post as having been told by JW and myself not to use "deny from all" in .htaccess in the main Moodle directory, you may be right about that. I found JW's post about that, and it is a reply to one of TA's.

I have downloaded and looked at the htaccess.txt file you attached to this post, and it's got a lot of fancy stuff in it to keep out bad bots and referrals from spammers selling viagra and everything. Hopefully none of that will cause a problem with 1and1; I don't know. The one thing that jumped out at me was the line at the top, saying to use the page /404.php in the event of a 404 error. Presumably this refers to a file named 404.php in the web document root (home directory) of your site, wherever that is. As I said in a recent post to TA, I had previously thought that your root was htdocs, but I'm beginning to think it is moodle, so that you would have more success trying to access Moodle using your domain name without /moodle at the end, and adjusting the wwwroot line in config.php accordingly. In any case, I hope the 404.php file you reference in your .htaccess file exists.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

RLE

My web root is /abernant

If you click on www.abernantprimary.co.uk it will take you to the entry page of my existing website.

Moodle is installed in a folder called moodle inside the abernant directory, hence ...htdocs/abernant/moodle and therefore www.abernantprimary.co.uk/moodle

My .htaccess file has run successfully on 1&1 servers for the last 2 years, with no problems whatsoever.

404.php is my customised error page to match the website design, which again has worked perfectly since I set the site up. When this page is called, I automatically get an email telling me which page is a 404 and the referring page.

DH

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,

You're right. I must have not noticed the abernant directory in the pathname you listed for dirroot between htdocs and moodle. I think this is a difference in file structure between your site and TA's.

It's good to know 404.php exists.

RLE
In reply to Richard Enison

Re: More1and1 installation problems

by Tony Agar -

Re-joining this discussion, I am at the stage of Diane original config.php file as she posted it on 3rd Oct at 1729 BST. This is the file that Moodle sets up on it's intial installation on the 1 and 1 web sever.

I find that in addtion to all the directories that Moodle has set up, it has in fact also taken over my database in mySQL and I now have 90 tables in it! All of which can accessed and edited through myPHPadmin. Fantastic?

I notice that Moodle has also set up another .htaccess file in my moodledata directory which reads:-

deny from all

AllowOverride None

This is in addtion to the one I set up in the original unzipped moodle directory folder which reads:-

AddType x-mapp-php5 .php

order deny,allow
deny from all

Why are these different?

Also at the monent whatever I type into my browser window I get a 500 error like Diane which I have asked 1 and 1 to explain.

The next question since Moodle seems to have inserted itself quite happily into my web enviroment, is how to a I get to the starting page.

All websites need an index page. Would including the line in my .htaccess file help

DirectoryIndex index.php index.html index.htm

Tony

 

In reply to Tony Agar

Re: More1and1 installation problems

by John Wheaton -
I have gotten 500 errors when the permissions on a file or directory are incorrect. (Just tonight in fact! I was installing Gallery2, and the preinstall script set permissions on its main directory to 777, but my host wisely likes 755 on folders. So executing the installation script kicked out an error 500 page, until I manually changed the permissions to 755.)

So, check there first. Then you can muck about with the .htaccess file. I doubt you need to add what you suggest, though.

The moodledata .htaccess file is there to keep out intruders. I have to confess I didn't read your part of this thread closely, but wouldn't "deny from all" in the main moodle directory also keep out everyone? That might the cause of the 500 error.

Having a populated database is a good sign, though!
In reply to John Wheaton

Re: More1and1 installation problems

by Diane Hawkins -

Yes, http://www.abernantprimary.co.uk/abernantmoodledata/errors.csv gives a 404 error which is why I got confused about my files being globally accessible, when I knew they weren't.

My structure is

--/htdocs which even I can't "see"
/ (my allocated server space)
----- /abernant/ (all the files for the main school site) including moodle
----- /abernantmoodledata (completely separate from the main school files)
----- /another website and all its own files and directories
----- /another website and all its own files and directories
----- /another website and all its own files and directories

and so on

In reply to Richard Enison

Re: More1and1 installation problems

by Diane Hawkins -

Thank you - yes, that is much clearer John and Richard. I am working my way through your suggestions.

Starting with global $CFG;  should I add this line and correct this one $errfile=fopen("/homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv","a"); or just leave it as it is? If I need to change it, does the global directive come just after the curly { which opens the function?

I have checked line 8 in the version.php document and it matches yours exactly.

I have changed the code which caused the parentheses to be empty, as you suggested. The error code number I'm getting is now: /homepages/2/d68832301/htdocs/abernant/moodle/mod/assignment/version.php: 8 (2048) Creating default object from empty value

I seem to remember reading somewhere about the wrong version of php being attributed - I'll see if I can find that again.

As for assigning memory, sorry, haven't a clue (sorry to be a pain - I know I'm being dense) If you can point me to the right page file, can I edit that and upload it?

I think we're getting somewhere now - I'm beginning to be ever so slightly optimistic!

In reply to Diane Hawkins

Re: More1and1 installation problems

by Diane Hawkins -

I have just tried adding this line to my .htaccess file:

php_value memory_limit = 256M

but it caused an internal server error 500...

In reply to Diane Hawkins

Re: More1and1 installation problems

by Diane Hawkins -

Also tried the same in my php.ini file

And tried

$CFG->debugdisplay = true;
$CFG->debug = 2048;
$CFG->dblogerror = true;

in my config.php file

In reply to Diane Hawkins

Re: More1and1 installation problems

by Richard Enison -
DH,
  1. I hope you're right about your data directory being inaccessible. You say you can't see htdocs, yet you use the URL http://www.abernantprimary.co.uk/moodle. What do you get if you just type http://www.abernantprimary.co.uk? What about http://www.abernantprimary.co.uk/abernantmoodledata/ followed by a file in the data directory or a subdirectory you know is there, e.g., (this exact path may not exist on your system, but if you do some directory listings with ftp, filemanager, the ls command in shell access, or whatever you normally use to look at the file system on your server, I'm sure you can find the pathname of a file under abernantmoodledata).
  2. Yes, the global statement would go right after the left curly brace at the beginning of the function. But you only need it if you want to use the value of $CFG->dataroot, $CFG->dirroot, or some other property (member) of $CFG. If you include the global statement, using both $CFG->dataroot and the actual pathname /homepages/2/d68832301/htdocs/abernantmoodledata/errors.csv concatenated together will no longer work; you will need to get rid of one or the other. If you remove the $CFG->dataroot. and leave the rest, that will work, and in that case you don't need the global statement. And if you don't use the global statement, then it doesn't matter whether you remove the $CFG->dataroot. or not, since it will be treated as an empty string anyway, as it has been.
  3. Now that we see the actual error level 2048, we can see why the partentheses were empty before; the array of error levels and corresponding words only went up to 1024. This level is called E_STRICT in the PHP manual, which is, I'm sure, no surprise to you since you Googled the error message and found lots of references to it as a Strict violation, whatever that means.
  4. Making $CFG->debug equal to 2048 means you only want to see error messages of the Strict variety. If you want to see all kinds of error msgs., including strict, make it 4095. But I don't think the debug facility will do anything anyway, as long as that script you added to config.php is still there, because it overrides normal error processing, replacing it with its own error handler (that's what the function is).
  5. I see you found out how to increase the memory limit. Too bad it results in a 500 error. But then you originally got that when you put the usual

    order deny,allow
    deny from all

    into .htaccess. But as JW points out, those directives don't belong in .htaccess in the Moodle directory. They do belong in the data directory. Putting them in the Moodle directory would have the effect of making Moodle inaccessible from the web! So you might ask 1and1's tech support if the memory limit is changeable, either via .htaccess or custom php.ini.
RLE
In reply to Tony Agar

Re: More1and1 installation problems

by Richard Enison -
TA,

I would put the script just before the last line (the one that says ?>) of config.php in the main Moodle directory, since that file is included by every Moodle script that is used online (that is, with the possible exception of cron.php). And I am also unsure where errors.csv would be written, so what I would do is
  1. pick a location (pathname) that Apache has write access to, such as $CFG->dirroot (the Moodle directory) or $CFG->dataroot (the data directory); and
  2. insert that pathname immediately before errors.csv in the fopen line, so it would read, for example,

    $errfile=fopen($CFG->dirroot."/errors.csv","a");

    That would make it possible for you to see the contents of it (it is a text file) by pointing your browser to

    http://www.abernantprimary.co.uk/moodle/errors.csv

    If your
    browser complains it doesn't know how to open a csv file, just tell it to use your favorite text editor; on a Windows PC, use Wordpad instead of Notepad. But it is more likely it will open in Excel, which is okay. That way all the fields will be in separate columns, which might even make it more readable.

    Unfortunately, it would also make it possible for hackers to see it, so the data directory might be a better choice.
That takes care of where to put the script, and where the file gets written. As to how to fix the errors, that depends entirely on what errors you get. Surely you don't expect 1and1 to put a gigantic treatise (never mind 12-page document!) on every possible error that can occur in a PHP program into that FAQ page, do you? If you don't find the error msg. you get documented sufficiently well in the PHP manual, Google it!

RLE