Moodle Themes not working

Moodle Themes not working

by Snarky Boojum -
Number of replies: 16
I've just installed Moodle 1.9.5+ Build 20090812 on Ubuntu Server 9.04. Everything seems to proceed well, but when I start up moodle, no themes are available, and the background is plain white. Additionally, the Site Administration menuis not heirarchical: all of the the choices are on the same level.

If I select a theme, it does not display, at all.

I've installed modle many times in the past, and I've never seen this behavior.

I've attached a snip of the screen


Attachment moodle.png
Average of ratings: -
In reply to Snarky Boojum

Re: Moodle Themes not working

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
That looks like your style sheets are not coming through correctly to me... Can you give us some more details about your server setup? How did you go about setting it all up?
In reply to Jon Witts

Re: Moodle Themes not working

by Snarky Boojum -
Thanks.

  1. Created database and database user
  2. Created /var/moodledata,
    1. changed ownership and group to "www-data"
    2. changed permissions to 0770
  3. Downloaded moodle 1.9.5
  4. untarred .tgz into /var/moodle
  5. Ran install script
    1. received error message that installer could not create config.php in /var/www/moodle (suspected cause permissions problems)
  6. Created config.php in /var/www/moodle usingy same entries as listed in 5.1, above
  7. Everything seemed to work just fine, but no themes
In reply to Snarky Boojum

Re: Moodle Themes not working

by Snarky Boojum -
Some further information:

  1. I'm using Firefox 3.0.13 on Ubuntu 9.04
  2. Here's a snippet from the pages source code (I've confirmed that /var/www/moodle/themes exists.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="http://192.168.10.3/moodle/theme/standard/styles.php" />
<link rel="stylesheet" type="text/css" href="http://192.168.10.3/moodle/theme/standardwhite/styles.php" />
<meta name="description" content="" />
<!--[if IE 7]>
 <link rel="stylesheet" type="text/css" href="http://192.168.10.3/moodle/theme/standard/styles_ie7.css" />
<![endif]-->
<!--[if IE 6]>
 <link rel="stylesheet" type="text/css" href="http://192.168.10.3/moodle/theme/standard/styles_ie6.css" />
<![endif]-->

In reply to Snarky Boojum

Re: Moodle Themes not working

by Jon Witts -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Are you intending on running your Moodle server internally only? What address did you enter in your browser when you got your screen shot?

Jon
In reply to Jon Witts

Re: Moodle Themes not working

by John Rickard -
Hi guys,

Did anything come from this?

I am having the same issues with a new install of Ubuntu Server and Moodle 2.0

Any ideas?


John R
In reply to John Rickard

Re: Moodle Themes not working

by Peter Bradley -
Yes. I'd like to know too. I have the same problem.

All is well on the local machine, but when I try to connect from another machine on the LAN, the styles don't get picked up. Looking at the generated html, I see that the hrefs for the stylesheets start http://localhost/...

Ubuntu 9.10 32 bit. Installed from synaptic.

I'm trying, from a remote machin, to connect to:

http://www.mymachinename/moodle

The page shows, but no styles.

Connecting locally to http://localhost/moodle is fine.

Any help would be appreciated.

Cheers


Peter (complete newbie)

In reply to Peter Bradley

Re: Moodle Themes not working

by James Schumann -
Check for extra whitespace at the end of your config.php file in your moodle directory.

The config.php file contains a warning:

// 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.
?>

I created my config.php file manually, and mistakenly added some whitespace. When I removed the whitespace this problem disappeared.

Good luck!
In reply to Peter Bradley

Re: Moodle Themes not working

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
In config.php, what does the line $CFG->wwwroot= say?

It needs to be http://www.mymachinename/moodle not http://localhost.
In reply to Howard Miller

Re: Moodle Themes not working

by Peter Bradley -
Ah! Brilliant. Thanks Howard. I was sure it would be a configuration issue, but I'd no idea where to look or what to check.

I'm not at work ATM, but I'll give it a go when I'm back in the morning, and post back with the result.

Thanks


Peter
In reply to Peter Bradley

Re: Moodle Themes not working

by Peter Bradley -
OK. I did that. The line now reads:

#$CFG->wwwroot = 'http://localhost/moodle';
$CFG->wwwroot = 'http://peter-desktop/moodle';

I can now access moodle from the host (I'm running a test installation on Ubuntu hosted on XP, using VirtualBox) and all the styles show up: but if I try to access moodle from another machine on the LAN, I get an error:

Forbidden: you don't have permission to access moodle/ on this server

I changed the ownership of the moodle apache virtual file system to the apache2 user and group (both www-data), but still get this message.

Any ideas?

Cheers


Peter

In reply to Peter Bradley

Re: Moodle Themes not working

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
What did you do to forward the http requests to the virtual guest from your XP host?

This is almost certainly a networking issue (tricky because of the virtualisation). Assuming you haven't done anything weird with the Apache setup, of course.
In reply to Howard Miller

Re: Moodle Themes not working

by Peter Bradley -
Hmm. Nothing as far as I know. I just gave my virtual box an IP address (internal one) and put its name in DNS and then everything worked from the host. In effect, today I have the reverse situation to the one I had yesterday: after changing config.php, the styles are fine on the XP host but not on the local box.

The problem of access from other physical boxes on the same LAN might just be an Apache problem. Yesterday I allowed a range of IP addresses. I wonder if I got the range wrong...

Thanks for you continued help. It's appreciated.

Cheers


Peter

In reply to Peter Bradley

Re: Moodle Themes not working

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
" I just gave my virtual box an IP address (internal one) and put its name in DNS"

Well, so *something* then. If you had done nothing it wouldn't have worked big grin

"Yesterday I allowed a range of IP addresses"

That's definitely what to check first. The apache error log will confirm.
In reply to Howard Miller

Re: Moodle Themes not working

by Peter Bradley -
Yep. You're right. The range didn't include the machine I used for the test. When I added the machine's IP address, it connected OK.

I still have a problem on the ubuntu installation, but I think it's our proxy that I need to sort out with that one. I'm assuming here that I can no longer use localhost to get moodle up on the ubuntu box, with styles, for the same reason I couldn't previously get the styles without connecting locally.

Is that right?

If that's correct, and I need to connect via DNS and therefore the proxy in order to get the styles, then it's definitely the proxy I need to sort out.

Anyway, I'll post to say how I get on.

Cheers


Peter

In reply to Peter Bradley

Re: Moodle Themes not working

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Short answer.... you have to pick *one* url for 'wwwroot' and make that work from everywhere you want to use Moodle,

That would usually be done in DNS and/or in local hosts files.
In reply to Howard Miller

Re: Moodle Themes not working [Solved]

by Peter Bradley -
Yes. That's what I thought. I'll get onto sorting the proxy/DNS and mark this as solved since I'm sure the details of all that will be of little interest to anyone but me.

Grateful thanks for all your help, Howard.

I never thought I'd see the day when I had a Linux desktop (albeit in a VM) in front of me, with my boss crying out to access a piece of F/OSs software installed on it.

Are we winning?

Cheers


Peter