Adding Moodle as Additional "install.php"

Adding Moodle as Additional "install.php"

Joel Brondos གིས-
Number of replies: 10

I installed Moodle on a server where I already have a program that uses "install.php" to initiate.

How can I get Moodle to boot up if the other program (FOCUS SIS student information system) already has the "default" to install.php?

If this requires a few lines of simple programming to make a simple menu, I'd still need help with the actual php code AND how to add / install it where it needs to go.

དཔྱ་སྙོམས་ཀྱི་སྐུགས་ཚུ།: -
In reply to Joel Brondos

Re: Adding Moodle as Additional "install.php"

Richard Enison གིས-

JB,

You do have these two programs in different folders (directories), right? Because you can't have two files in the same folder with the same name (like install.php); one would replace the other.

If you are using Apache (you haven't said anything about your server environment like web server s/w), you can have a different default in each folder. If you have your own server and can edit httpd.conf, use the Directory directive for the folder where Moodle lives, and put a DirectoryIndex directive specifying index.php as default there. If you are using a web host and can't do that, use .htaccess and put the DirectoryIndex directive there.

 RLE

In reply to Richard Enison

Re: Adding Moodle as Additional "install.php"

Joel Brondos གིས-

Yes, I do have them in different directories.

We are using Apache on a server with Server 2003. I have a hosted Moodle site off campus, but I would like to run it internally here as well.

What is it about httpd.conf that I should edit?

And I would need a little more help in learning how to "put a DirectoryIndex directive specifying index.php as default there."

Can the index.php of my "Focus SIS" student data program and the index.php of my Moodle program be "running" at the same time?

Is it a matter of pointing to the Focus SIS directory and "running" index.php there AND THEN pointing to the Moodle directory and "running" index.php there? Or is index.php somehow in the root directory of the server and can only point to one thing at a time?

Apologies for these neophyte questions. As you can see, I'm trying to get my brain around the concept. We're a small school and I have to learn as I go. Your assistance is greatly appreciated and benefitting our students greatly.

Joel

In reply to Joel Brondos

Re: Adding Moodle as Additional "install.php"

Richard Enison གིས-

JB,

  1. What to edit about httpd.conf? That depends on what is in it now. For example, if there is already a Directory directive in it for the Moodle folder, then it is a simple matter of adding the DirectoryIndex directive to that section of the file. Otherwise, it will need to be created. It would be a lot easier for us to be specific if you could post your httpd.conf file as an attachment, removing anything private first of course.
  2. I was assuming, since you said the other program had install.php as its default, that you were already familiar with the DirectoryIndex directive, since there would have to be one in httpd.conf already in order to define that default. I'll know better when I see your file.
  3. All kinds of php files can be running at the same time. Even if you only had Moodle, for example, on your server, many users could be running different php files within Moodle at the same time. What is really going in is called time-sharing, or time-slicing, whereby one program runs for a few milliseconds, then it gets interrupted, the operating system keeps track of where it is in that program and gives control to another program for a few milliseconds, and so on. That's been going on for over 40 years! smile The point is, because these time slices are so short, from a human point of view many programs are running at the same time.
  4. Depends on what you mean by the root of the server. For one thing, how do you plan to have your users access Focus SIS and Moodle? I mean, what URL have they been using to run Focus SIS? For example, maybe they type in there browsers http://www.brondos.edu/focus. Then you could use http://www.brondos.edu/moodle for Moodle. Basically, two folders on the same server, as you said. In this example, neither one is really the root folder of the server. Alternatively, you could get a new Internet (or intranet) domain for Moodle, say jbm.org, and set it up so that it points to the Moodle folder as a virtual server. Either way, it would be reflected in the way the httpd.conf file is set up. And of course, each program has its own index.php file in its own folder which, as I said before, could be running at the same time for dozens or maybe even hundreds of users.

Again, I will be able to be more specific when I get your response with your httpd.conf file attached.

RLE

In reply to Richard Enison

Re: Adding Moodle as Additional "install.php"

Joel Brondos གིས-

Richard,

First of all, thank you for taking the time to help me. I can only imagine how much of your time is taken up, gratis, helping others. When people know that you know how to fix computers, it's almost as bad as when people know you have a pickup. They always want to borrow it to haul stuff -- and they could give you a full-time no-pay job fixing computers.

I didn't know how to attach a file while responding in this forum, so below is the full text of my httpd.conf file. AFter a quick scan, I don't see anything obvious which would be a security risk, but I am still quite wet behind the ears.

I had a volunteer parent who works daily with Apache and programming, etc., do the basic set-up for me. He is not often available, leaving me to fend for myself -- but that's the way I learn. I'm eager to find out about "DirectoryIndex directive."

FOCUS-SIS and MOODLE are on the same server "stpb00." When I type in http://stpb00/index.php, I get the FOCUS SIS login screen. But when I type in http://stpb00/moodle/login/index.php, the place where the Moodle index.php file is located, I get "The webpage cannot be found."

My error is probably obvious to you . . .

(Interesting logo for your profile -- an infinity thermostat?) ངོས་ལན་

Joel


(Edited by Helen Foster - content deleted by request from Joel - original submission Thursday, 18 October 2007, 07:58 PM)

In reply to Joel Brondos

Re: Adding Moodle as Additional "install.php"

Richard Enison གིས-

JB,

I've learned quite a bit from reading your last post. For starters,

  1. The last time someone pasted such a long file into a post instead of attaching it, it was cut short after about 30 lines with a nasty note from Helen Foster saying, in effect, naughty, naughty, don't do that. I guess she hasn't seen yours yet! smile Fortunately, I have the full text of your post as an e-mail so I won't have a problem seeing your whole httpd.conf file if I need to after that happens.
  2. To make matters worse, you added to httpd.conf (the only one I asked for) the index.php files from Moodle and Focus, which I did not ask for and don't need to see. If you were going to add anything there are other pieces of information that would have been more useful, but more about that later. I mean, I have Moodle on my computer, although it is not exactly the same version you have, and every version of Moodle is available online. And I certainly have no need to see the source code of Focus, although I did glance at it and it pretty much confirmed what I gathered from the msg. in your post, namely, that it is the main file in that program.
  3. Anyway, to answer your questions, attaching a file is the easiest thing in the world. Right now I am typing this post into a relatively large text box. Just below that box is a yellow picture of a keyboard, with a question mark on the left side of it. Below that are three lines, and below that is the "Post to forum" button. The last of those three lines says "Attachment (Max size: 100KB)" followed by a yellow circular icon with a question mark in it, followed by a one-line text box, followed by a button that says Browse.... Clicking that button should bring up a dialog box like a typical Open File box in any Windows program. You should be able to navigate to the folder where the file you want to attach is located, then select the file itself from the file list box, scrolling it if necessary (in my case, it has a horizontal scroll bar at the bottom by default, but that would change to a vertical one if I selected a detailed list view). Finally, click the Open button just above the Cancel button in the lower right corner of the dialog box. Note: my browser is IE7. If you are using a different browser, the appearance of the dialog box may be different, but the functionality should be the same.
  4. You are the first person in almost a year to ask about my icon. Actually, it is supposed to be an infinity clock. I created it from a clip-art file of a clock by erasing the hands and pasting an infinity symbol on it.
  5. I wasn't sure whether there might be any private info in the file. I'm not the world's expert on Apache, but I know enough to be able to read the file and understand what most of the important lines mean, with the help of the manual, which I have downloaded on my PC. I said that because some files contain passwords and usernames that you wouldn't want to make public.
  6. I found the DirectoryIndex directive in the file. It explains why you would type http://stpb00/index.php to get into Focus instead of just http://stpb00/. In an earlier post you said index.php was the default, but that's hard to believe because the DirectoryIndex directive I found specifies the default as index.html. Most websites have at least two choices (it will use the second if it doesn't find the first), namely index.html and index.htm. It is not unusual to see two other alternatives: default.html and default.htm. But your volunteer saw fit to limit it to just index.html. Is there a file by that name in the folder where Focus is rooted? I didn't think so. Here is my suggestion: find the line that says
    DirectoryIndex index.html
    and change it to
    DirectoryIndex index.php
    or at least
    DirectoryIndex index.php index.html index.htm
  7. There is only one reason why you got the error msg. you did when you typed http://stpb00/moodle/login/index.php: the file isn't there. If Moodle were rooted in that moodle folder, it should be there. The reason it isn't there, I suspect, is that you created a subfolder named moodle and unzipped the Moodle zip file there. Well, the top level folder you get when you unzip that file is called moodle, and that's where the main php files are. Which means you should be able to get the login file by typing http://stpb00/moodle/moodle/login/index.php. If you do that now, you will get a different error msg., because you undoubtedly haven't installed Moodle yet.
  8. Which brings me to the fact that moodle/login/index.php is not the main file of Moodle. That honor goes to moodle/index.php. If you run that file now (don't forget the second "moodle/"), it will discover that the file config.php in the moodle folder doesn't exist, because Moodle hasn't been installed, and it will automatically turn control over to install.php to begin the installation process, but you are not ready to do that yet. First you need to create a Moodle data folder, and a database. For more details, see http://docs.moodle.org/en/Installing_Moodle.
  9. After you change the DirectoryIndex directive, and restart Apache, you should be able to start Focus by typing http://stpb00/, and Moodle by typing http://stpb00/moodle/moodle. If you move all the files and subfolders in C:\apache\htdocs\moodle\moodle (that is where it is, right? Learned that from httpd.conf too) to C:\apache\htdocs\moodle, you should be able to just type http://stpb00/moodle to run Moodle. Later, you might want to talk to your network person about getting a domain name for Moodle that would map to http://stpb00/moodle, maybe called stpbmoodle. Then, after some more monkeying around with httpd.conf, you would only need to type http://stpbmoodle/.
  10. See? I told you I would be better able to help you after I saw httpd.conf. Whew! wide eyes

RLE

In reply to Richard Enison

Re: Adding Moodle as Additional "install.php"

Joel Brondos གིས-

Wow. Thanks for the education. It all makes much more sense.

Apologies to Helen for the overly lengthy post. Can I delete that post so as not to cause perpetual offense? Embarassment due to my naivete is part of the price I pay for learning in this case. གདོང་དམར་ Chalk it up to another one of those instances where we say, "I won't ever to THAT again!" learning the "hard" way. མིག་གནག་

I hadn't seen the icon for attaching a file, being unfamiliar with the forum way of posting things. But now you've straightened me out on that, too.

The infinity clock is thought-provoking. But so is an infinity thermostat! གཟབ་གཟབ་

Joel

In reply to Joel Brondos

Re: Adding Moodle as Additional "install.php"

Richard Enison གིས-

JB,

Your welcome. I'm glad my icon is thought-provoking. Anything that provokes thinking can't be all bad, especially thinking about eternity, which, as you might have guessed, is what the infinity clock represents. I suppose an infinity thermostat might come in handy in eternity under certain circumstances....

RLE

 

In reply to Richard Enison

Re: Adding Moodle as Additional "install.php"

Helen Foster གིས-
Core developers གི་པར Documentation writers གི་པར Moodle HQ གི་པར Particularly helpful Moodlers གི་པར Plugin developers གི་པར Testers གི་པར Translators གི་པར
"The last time someone pasted such a long file into a post instead of attaching it, it was cut short after about 30 lines with a nasty note from Helen Foster saying, in effect, naughty, naughty, don't do that."

I'm sorry if my note seemed nasty - it was certainly not my intention. If I have time, I sometimes edit a post, copy and paste the text into a text file and attach it to the forum post on behalf of the poster.

The reason why extra-long posts are not a good idea is because they cause problems when doing a forum search. However, I've not yet found a good way of communicating this to forum posters before they make extra-long posts. Have you any suggestions?
In reply to Helen Foster

Re: Adding Moodle as Additional "install.php"

Richard Enison གིས-

HF,

Sorry, I have a bad habit of exaggerating, like the kid who said he saw a dog as big as a house (I don't mean Clifford, I mean a real dog), and his mother said I've told you a hundred billion times don't exaggerate! So I drop words like nasty with my tongue drilling a hole through my cheek. I had to paraphrase your note, because I didn't remember your exact words, or which post or discussion that was in. I tried to find it by doing a search on your name (the one thing I did remember) in my inbox, but then I realized that you probably edited it after it was e-mailed to me.

As for suggestions, I wasn't planning on that, but since you ask ...

  1. In the docs where it is explained how to post, would be a good place to say something about the size of posts.
  2. How about a notice in big, bold, black, block letters just above the text box for posting telling Moodlers not to paste long files into posts but attach them instead .
  3. A number of websites I've used actually enforce a limit of x number of characters in message boxes in forms. If you try to type one character too many, it goes nowhere. A paste would undoubtedly be cut off at the limit automatically.
  4. Maybe the script that handles posts could automatically take a paste that exceeded the limit and make it an attachment. Maybe it could display a dialog box giving the user a choice of name for that attachment, and a cancel button to neither paste nor attach.

RLE