4

I have a fresh Moodle 3.7 install in my Ubuntu 19.04 powered laptop, Apache2 as server, PostgreSQL for database and PHP 7.2. I've followed the steps in https://docs.moodle.org/37/en/Step-by-step_Installation_Guide_for_Ubuntu, except that I've used a PostgreSQL database (and it installed fine). But when I access http://localhost/moodle/, I see this screen:

enter image description here

It's like the CSS is not working. Chrome's console show a bunch of errors:

enter image description here

And I simply didn't find information on the web about these specific errors. My /var/www/html/moodle folder has all permissions (chmod 777 recursive).

What am I doing wrong here?

  • Have you done: > On the line where DocumentRoot is; > Change From: DocumentRoot /var/www/html > Change To: DocumentRoot /var/www/html/moodle ? – Code Spirit Oct 16 '19 at 10:07
  • Ok, I had not done it, and it solves the problem. But... why can't I access it only typing `http://localhost/moodle`? The way I configured, now, the only page apache serves is moodle... everytime I want to see another page I should change 000-default.conf. There isn't a way to just access moodle using `http://localhost/moodle`? –  Oct 16 '19 at 11:30
  • You are getting the index.html file when requesting `/moodle` but this file may request other assets (like styles and scripts) which are requested based on the domain (e.g. /script.js). You can see all details in the developer consoles "Network" tab. – Code Spirit Oct 16 '19 at 13:36

2 Answers2

0

This looks like your DDBB configuration is fine, because the main page is loading with no potential errors.

As Moodle can't find your other files, maybe one of your configuration lines is wrong. You can find the configuration file (config.php) on the Moodle root folder.

It is quite easy to read as you will find some values being assigned to variables. Pay special attention to

  • $CFG->wwwroot
  • $CFG->dataroot
  • $CFG->directorypermissions = 0777;

If the content of the config.php file is fine, maybe you will need to reinstall the platform as Moodle didn't install well (this has happened to me many times). Be sure to reinstall the platform with other release (older or newer), maybe your particular release has bugs related with the installation.

  • 1
    It works! I configure `$CFG->directorypermissions` to `0777` (it was 02777 for reasons I could not understand) and `$CFG->wwwroot ` to `http://localhost/moodle` (before was http://localhost). I had to undo the changes I did in the `000-default.conf` sugested by @Rp9 above (that solved the problem too, but configured my apache to serve only Moodle in `localhost`. Many thanks! ` –  Oct 18 '19 at 21:27
  • Installing the platform with other releases is not a good idea if someone needs an exact version of moodle. – user3072843 Feb 02 '20 at 21:25
  • I had the same problem. Scripts and styles were not loading. Finally, the nginx configuration was faulty: https://docs.moodle.org/38/en/Nginx – user3072843 Feb 02 '20 at 21:30
-1

I followed suggestion by user3072843 and that works for me. More detailed, config nginx with following code (copied from ocs.moodle.org/38/en/Nginx):

location ~ [^/]\.php(/|$) {
    fastcgi_split_path_info  ^(.+\.php)(/.+)$;
    fastcgi_index            index.php;
    fastcgi_pass             127.0.0.1:9000 (or your php-fpm socket);
    include                  fastcgi_params;
    fastcgi_param   PATH_INFO       $fastcgi_path_info;
    fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
Qizy
  • 1