Installation prob - displaying the Index of/moodle

Installation prob - displaying the Index of/moodle

by andy deloso -
Number of replies: 15
hey everyone,
i am installing moodle on a linux server, and i use apache, and i have shell access...

so, when i go to my url to complete the installation, it takes me to the "Index of /moodle" page, where it simply lists all of the files and directories in my moodle directory. does anybody have any suggestions? help? i am sure it is something small... but, i just can not figure it out. ok, i appreciate any help, and have a great night or day!
Average of ratings: -
In reply to andy deloso

Re: Installation prob - displaying the Index of/moodle

by Adam Smith -
It sounds like Apache's DirectoryIndex for the Moodle server doesn't have the index.php entry in it. Did you do that step? If I'm not mistaken (I'm new to Apache myself), the DirectoryIndex is a list of files that Apache will try to run in order until it finds one. The installation directions recommend 'index.php index.html index.htm'. I believe that each 'server' in Apache has its own .htaccess where the DirectoryIndex entry is located, so you have to make sure that you are looking at the Moodle directory and not just the www directory. I hope this helps more than it hurts.
In reply to Adam Smith

Re: Installation prob - displaying the Index of/moodle

by Richard Enison -
AS,

You're on the right track. The DirectoryIndex directive specifies what file Apache is to serve up when the browser only gives the URL of a directory, not a file. It doesn't have to be in an .htaccess file. The .htaccess file is for clients of shared web hosting servers who don't have access to the Apache configuration file itself (usually called httpd.conf). Normally you would put the DirectoryIndex directive in the configuration file.

It is up to shared web hosts whether to enable the use of .htaccess files, and what directives to allow in them.

RLE
In reply to Richard Enison

Re: Installation prob - displaying the Index of/moodle

by andy deloso -
i have the index.php in my httpd.conf directory index.... can some possibly explain what i have to do as far as the .htaccess file in the moodle directory?
In reply to andy deloso

Re: Installation prob - displaying the Index of/moodle

by Richard Enison -
AD,

Maybe my last post wasn't clear enough. Judging by your first post, you don't need an .htaccess file. Perhaps you could attach a copy of your httpd.conf file to your next post, so we can see if there is something wrong with your DirectoryIndex directive, such as its location within the file. Or maybe you put an .htaccess file in your Moodle directory that is overriding the httpd.conf file. If so, I would delete it.

RLE
In reply to andy deloso

Re: Installation prob - displaying the Index of/moodle

by Jonathan Moore -
Hi Andy,

Perhaps you don't have php installed yet? Or haven't restarted apache since loading it.

If you click on the index.php file does it load a Moodle page? If it offers up a save file dialog, that is normally a sign that php is missing altogether.

So if missing you need to load the appropriate package(s for php.

If it does load, then as others have suggested you need to edit you httpd.conf file and add index.php to your list of index files.


In reply to Jonathan Moore

Re: Installation prob - displaying the Index of/moodle

by Myrrh Lynn -
I'm having this same problem, only I have installed Moodle 1.9 on a hosted server. It's like the www.root isn't recognized.

When I put in the web address like I want it ( http://mysite.org/moodle ) , I get the Index of/ Moodle. (Parent Directory) I sure don't want that accessible by just anyone!

When I click on index.php, it does give me a moodle page.

I don't know what to do to fix it. Any suggestions?
(Please make any instructions super-easy as I am just an elementary teacher wink.)
In reply to Myrrh Lynn

Re: Installation prob - displaying the Index of/moodle

by Myrrh Lynn -
Also, when I click on the short name for my site on the breadcrumbs, it goes to the index as well instead of too the moodle "home page". What do I do to fix this?
In reply to Myrrh Lynn

Re: Installation prob - displaying the Index of/moodle

by Richard Enison -
ML,

Absolutely, but first things first. It would be helpful to know more about your server environment; see http://docs.moodle.org/en/Installation_FAQ#System_information_needed_for_Installation_Forum

In particular, are you using Apache? I hope so, because I don't know much about IIS and less about other web servers. What is the pathname in your server's file system of your main Moodle folder (directory), where index.php and install.php are? What is your OS (Windows, Linux, etc.)? If you are using Apache, could you attach a copy of your Apache configuration file httpd.conf? Do you have your own server or are you using a shared web host?

RLE
In reply to Richard Enison

Re: Installation prob - displaying the Index of/moodle

by Myrrh Lynn -
I'm not a computer whiz, but I'll try to give you what you need:

Moodle 1.9 Weekly 4.30.08 - new Installation is on a new domain/website hosted by a webhosting company. I presume this means webserver.
PHP 5.2
MySQL 4.x - I designated a database just for site //with host, database name & database username are the same.
Win98SE (ancient, I know, but still functionalwink )

Here's the path from home:
home > domain.org > moodle > index.php
home > domain.org > moodle > install.php

Here is the contents of the config.php file (names modified)

<?php /// Moodle Configuration File

unset($CFG);

$CFG->dbtype = 'mysql';
$CFG->dbhost = 'webhost.com';
$CFG->dbname = 'database_name1';
$CFG->dbuser = 'dbuser_id';
$CFG->dbpass = 'dbpassword';
$CFG->dbpersist = false;
$CFG->prefix = 'mdl_';

$CFG->wwwroot = 'http://domain.org/moodle';
$CFG->dirroot = '/home/www/domain.org/moodle';
$CFG->dataroot = '/home/www/moodledata';
$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.
?>

I want members to access the site by typing http://domain.org
Once on site, click on a "Members" link that takes them to the moodle

As admin, I want to enter the moodle by typing http://domain.org/moodle
Members can get there from here to if they are that ambitious. Most won't remember the moodle part.

Does this help? What else do you need?
Thank you for taking the time to help!


In reply to Myrrh Lynn

Re: Installation prob - displaying the Index of/moodle

by Myrrh Lynn -
Correction:
MySQL 5.0.32
In reply to Myrrh Lynn

Re: Installation prob - displaying the Index of/moodle

by Richard Enison -
ML,

OK. That's good. You've given me most of the info I've asked for. Since you are using a web hosting company, you probably don't have access to the webserver software (s/w) configuration files. However, from what you've said I can make a few comments:
  1. The versions of s/w you've listed are within the acceptable ranges published in the Moodle installation documentation (http://docs.moodle.org/en/Installing_Moodle#Requirements)
  2. There is a discrepancy between the path you listed in your post for the Moodle folder (directory) (home > domain.org > moodle) and that indicated in your config.php file ($CFG->dirroot = '/home/www/domain.org/moodle';), which probably comes from the answers you gave while running the installation script. Perhaps you forgot to include the "www" in the path when you typed the post. Or maybe the path in config.php is wrong, which might be why it is not working right. But based on your earlier post, that seems unlikely.
  3. You want members and admins to access Moodle using two different URLs. Moodle is not designed to work that way, although I suppose you could create a script or html file in the parent folder that simply passes control to the subfolder moodle.
  4. Can you ask your web host (if they haven't already told you, which they should have) which folder in your file system is the web document root, i.e., the one that would be accessed when someone browses to http://www.domain.org? Also, what kind of webserver s/w are they using for your account (Apache, IIS, etc.)? If it is Apache, do they allow you to use .htaccess files? What directives are allowed in them?
  5. When you said that when you clicked on index.php in the directory index you got a Moodle page, did you mean you got the contents of the index.php script file, or the actual page that that script would normally produce?
RLE
In reply to Richard Enison

Re: Installation prob - displaying the Index of/moodle

by Myrrh Lynn -
Thank you, Richard, for your reply. I'll try to answer your questions, please be patient with me. I have not set up a new moodle since last yr - 1.7 - and it installed without a hitch. So, the files presently involved are new to me.

1. The versions of s/w you've listed are within the acceptable ranges published in the Moodle installation documentation (http://docs.moodle.org/en/Installing_Moodle#Requirements)
>That's a relief; at least something positive!

2. There is a discrepancy between the path you listed in your post for the Moodle folder (directory) (home > domain.org > moodle) and that indicated in your config.php file ($CFG->dirroot = '/home/www/domain.org/moodle';), which probably comes from the answers you gave while running the installation script. Perhaps you forgot to include the "www" in the path when you typed the post. Or maybe the path in config.php is wrong, which might be why it is not working right. But based on your earlier post, that seems unlikely.
>It was a typo. I had been working 20 hrs straight when I wrote that post. The paths in the config.php are the correct ones.

3. You want members and admins to access Moodle using two different URLs. Moodle is not designed to work that way, although I suppose you could create a script or html file in the parent folder that simply passes control to the subfolder moodle.
>I may have explained this wrong. I do not want to access the moodle via two URLs. I want members to type domain.org to access the school/organization homepage. From there, members will click on the "Members" link which will take them to the moodle.

I have 3 other moodles at present. All have their own websites on a hosted web server. This is how they are all accessed. [domain.org > link to moodle > moodle login page]

>Most people, especially elementary students, do not remember web addresses such as domain.org/moodle . The word "moodle" appears as an unnecessary word to them since it has nothing to do with the name or purpose of the organization. They are more apt to simply remember domain.org, thus the necessity of the homepage and the "members" link.

As the admin, I have no trouble remembering the "moodle." So, just like any other website, if I type domain.org/moodle, I should be able to access the moodle, bypassing the homepage and the "Members" link on the homepage.

I am able to do this on my other moodle sites without any problem as well as countless other websites on the web. [moodle.org/donations] It is a standard navigation; not something special.

4. Can you ask your web host (if they haven't already told you, which they should have) which folder in your file system is the web document root, i.e., the one that would be accessed when someone browses to http://www.domain.org? Also, what kind of webserver s/w are they using for your account (Apache, IIS, etc.)? If it is Apache, do they allow you to use .htaccess files? What directives are allowed in them?
>I am not sure how to answer this one because I'm not sure I understand what you are asking. My webhost has provided a File manager for me to manager my sites. From this File Manager, the first folders I see are:
logs
mail
sys
tmp
www
From what I can tell, this is "home." [/home ]

When I click on www , I am taken to a list of my domains. [/home/www ]
When I click on the domain in question, I see the files needed to access the homepage.
This has its own .htaccess file, etc. Moodle is a folder here.
[/home/www/domain.org ]

When I click on the moodle folder, I see the moodle folders & files. [/home/www/domain.org/moodle ]
Listed here:
config-dist.php
config.php
file.php
help.php
index.php
install.php
tags
version.php

>As for Apache, etc., I don't even know what these are! I am on a webhosted server. I have set up 3 moodles in the past with the same webhosting company, same features, etc. and never had to know. Forgive my ignorance. If you would tell me "specifically" what I should ask them, I will do so.

This is what is inside the .htaccess file:

DirectoryIndex index.html
AuthUserFile /home/users/acctname/www/domain.org/.htpasswd
AuthGroupFile /home/users/acctname/www/domain.org/.htgroup

AuthName "Site Studio"
AuthType Basic

<FILES .htpasswd>
deny from all
</FILES>

<FILES .htgroup>
deny from all
</FILES>

5.When you said that when you clicked on index.php in the directory index you got a Moodle page, did you mean you got the contents of the index.php script file, or the actual page that that script would normally produce?
>This one is ODD! Up until 20 minutes ago, I could open a browser (Firefox, preferred), type domain.org/moodle and the Index of /moodle would appear.

If I clicked on the file index.php, I would be taken to the user-end moodle Front Page. I was able to set up the calendar, set parameters for Frontpage, users, created a course and a quiz. It seemed to work just fine.

BUT, with no files touched since 1:30am (8hrs ago), this is no longer the case!
Now, I am getting this:

Missing file: /home/www/chefsgroup.org/moodle/lib/adodb/drivers/adodb-mysql 5.0.32.inc.php

ADONewConnection: Unable to load database driver ''

This is EXTREMELY odd as I JUST accessed the moodle before I started writing this post!
The last time I accessed it, I did this:
I typed domain.org/moodle
This broght up the Index of /moodle.
Then I clicked index.php and got the moodle Front Page

This is something BRAND NEW and I am disgusted! How can something be there one minute and disappear the next when it hasn't been touched?!

At this point, I am so miffed, I want to just uninstall the whole thing and start over! Only, I don't know how to do that.



In reply to Myrrh Lynn

Re: Installation prob - displaying the Index of/moodle

by Richard Enison -
ML,

3. If I had read your earlier posts more carefully, I would have realized that. It's just good that you have a web page there with a link to Moodle on it. I'm familiar with navigation. I just wasn't aware you had already set this up. Does the navigation page work in the site you're writing about? If not, what is its name? (Before you answer that, read #4 below)

4. Apache is a piece of s/w, a program, like MySQL and PHP, or a word processor, e-mail, or spreadsheet program. It is specifically a webserver program. It is the opposite of a web browser, like Internet Explorer and Firefox. When you surf the web, you type an address into your browser and click GO (or press enter), then the browser sends a message out over the Internet (or whatever network you are connected to), which somehow manages to find its way to the target computer associated with that address (URL), the web host. Nothing would come of this if there were no webserver program running on that host to respond to that msg. If a webserver like Apache is running, it will read the msg. and figure out which page you are asking for, find the file for that page, and in the case of a dynamic page such as a PHP script, run the script, then it sends the page back to you. Your browser receives it and displays it on your screen. If you click on a link, it sends a msg. to the webserver just as if you had typed the address that link points to into the address box, which the webserver receives and processes.

The fact that you have .htaccess files in your site, which I surmise you did not create, tells me that it is virtually certain that your webserver is Apache. To be 100% sure, run the phpinfo script (see http://docs.moodle.org/en/phpinfo) and look at the output page. Search it (using your browser's find command) for the word server. There will be several matches, some of which should tell you that it is Apache, and what version; and if it is not Apache, what it is. The most likely place to find this info, I think, is at the end, under the heading PHP Variables. The variable _SERVER["SERVER_SOFTWARE"] should do it, if nothing else does.

You gave the contents of "the .htaccess file". I'm guessing on the basis of the first line in it that your navigation page file is called index.html. That makes sense. Now I would add one little thing to that line to make Moodle work better, so that it should read:

DirectoryIndex index.html index.php

There are other lines you might want to add to it, or put them in a separate .htaccess file in the moodle subfolder. For that matter, you could put the above line in that file. If you do that, it couldn't hurt if you reversed it, so that index.php comes before index.html. See http://docs.moodle.org/en/Installing_Moodle#Check_web_server_settings

5. As to how to get rid of your current Moodle installation and start over, see http://docs.moodle.org/en/Installation_FAQ#How_do_I_uninstall_Moodle.3F. In your case, since you plan to reinstall, it might be better to just empty the db and the two folders instead of delete them. To empty a db is to delete (drop) all the tables in it.

However, maybe this is not necessary. If the only problem is that one or more Moodle PHP script files are missing or corrupted, perhaps, if you still have the .tgz or .zip file of Moodle that you originally downloaded when you installed Moodle, you could just re-expand it on top of the existing files (this is not recommended for an upgrade, but we're just replacing files that have accidentally gotten deleted). If you don't, redo the download and expansion. Since the download file does not have a file named config.php in it, this should not destroy your configuration information.

RLE
In reply to Richard Enison

Re: Installation prob - displaying the Index of/moodle

by Myrrh Lynn -
Richard,
THANK YOU SO MUCH for explaining this to me. Sometimes just understanding HOW something works helps to find the problem.

I cleared the dbs and started over with a new download. After the installation process was complete, I had the same problems with the new download.

I checked, according to your instructions, and Apache is running.
Since I have another moodle working fine, I opened 2 browsers, Firefox and IE, and compared the new moodle with the established one.

Just to make sure, I compared the moodle download files in my FTP window.

The .htaccess file is MISSING in the moodle download itself.
So, I created one in the moodle folder on my webserver.
[home/www/domain.org/moodle ]
The moodle is working correctly now.


I can now access it from [domain.org/moodle ] as well as from the external link on the site home page [domain.org > Members link button > moodle]

Thank you so much for your patience and assistance. It's Moodlers like you that make this board (and program) so successful.

Myrrh
In reply to Myrrh Lynn

Re: Installation prob - displaying the Index of/moodle

by Richard Enison -
ML,

Your welcome, and thanks for the commendation. I just want to add that I wouldn't say that the .htaccess file is missing in the download. I don't think it is supposed to be there. It is something Moodlers add if they are using a shared hosting service, as you are, because they don't have access to the Apache configuration file (usually called httpd.conf). If they do have access, the directives would be better placed there than in .htaccess. Aside from that, some Moodlers use IIS or some other webserver instead of Apache, so .htaccess would be useless to them.

RLE