Windows server: How to install Moodle - Where to start?

Windows server: How to install Moodle - Where to start?

by nathan rhodes -
Number of replies: 34

Hi

We are in the process of setting up Moodle, I have read the documentation and parts of it makes sense and parts of it do not. We are also in the process of purchasing a dedicated server for Moodle to reside, so until that arrives I cannot do much sad 

What is the best way to set Moodle up on a Windows 2003 Server?

I have heard you need the following:

1)PHP5
2)Apache
3)MySQL
4)Perl
5)Moodle

in that order, am I correct? Basically I want to know the quickest and easiest way of setting Moodle up.

Regards

Nathan


Average of ratings: -
In reply to nathan rhodes

Re: Windows server: How to install Moodle - Where to start?

by Hans B0s -

I'm running Moodle on a Windows 2003 server and installed:

IIS, PHP5.x, MySQL5.x and installed moodle using the install script.

That's it.

p.s. The installation PHP and MySQL do need some extra attention.

In reply to nathan rhodes

Re: Windows server: How to install Moodle - Where to start?

by Mark Hilliard -

Nathan,

As someone who has just setup an almost identical Moodle server to what you are suggesting I would strongly suggest you consider some changes....

First Windows 2003, Apache and PHP were NOT a real stable solution for us and we tried HARD to fix it to work.

If you do a Google search on " memory leak with Apache 2.x /PHP 5.x and Windows 2003 server" you will find hundreds of complaints going back to 2002, of a serious memory leak that seems to never have been resolved.

It appears that PHP scripts and Apache under Windows 2003 lets PHP script requests use memory but never release it.

We tried at least 6 combinations of Apache 2.0, 2.0.55, etc and at least three versions of PHP 5.0 5.1, 5.24 and all we did for a month was watch the Moodle Apache Child process (either Apache.exe or Httpd.exe) eat memory up to 4 or 500 MB then crash and stop responding. We had to watch this happen hourly and the only "solution" was to limit MaxReqThreads per child so the Apache server would be forced to restart itself silently 2-3 times a day. ugly, very ugly...

Do yourself a favor and either use IIS for the webserver, or try linux.  We are going back to linux. Our last Debian Moodle server ran for 3.5 years w/o a reboot.

The Windows Moodle box needed daily rebooting with Apache and ran at about 1/4 as fast as the Linux box did. 

We needed apache because we needed virtual hosts, (not easy to do with IIS) if you don't need virtual hosts then IIS may be more stable, but just let me say our experience was horrible, and I am never going to try windows 2003, Apache and PHP together again.  We contacted sites all over the world for advice and NO ONE seemed to have solved the memory leak issue without the ugly "hack" of a nightly or daily reboot of Apache which did reclaim the lost memory.  Good luck and if you hear from someone who got a working combination of PHP, Apache, and Win 2003  be sure to find out EXACTLY what version they used. One solution suggested was to use "Fastcgi" in place of some of the classic PHP options but we didn't try that.

Good luck, and my suggestion would be to find a second server box to setup Linux on just in case you hit the problems we did.

Good luck!

Mark

In reply to Mark Hilliard

Re: Windows server: How to install Moodle - Where to start?

by Dennis Flynn -
my stable combo is 2003, iis, php5.2.1, latest MySQL 5.1.x versions of PHP crashed iis, similar to Mark's description with apache. I haven't tried newer than php5.2.1 because I've seen other posts suggesting the memory problem is back. just my 2-cents
In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Rich Tea -

I think you made a typo here Dennis in your second reference to your version of php.  

Versions higher than 5.1.2 DO screw up IIS.  It took me 2 months of banging my head of a wall before I realised this, especially if you are planning to do anything with 3rd party links to i.e. FreeTDS (PHP- MSSQL connector)!  It wouldn't load dlls and application pool errors all over the system!

General Nightmare.  Stick with:

Win 2k3 OS
PHP 5.1.2 - use www.peterguy.com to guide you in the install (his notes are for versions php 5.2.x so be carefull when the extensions are being enabled! just enable the default set on the php.ini file)
MYSQL 5.x or MSSQL (If your licensed, but unless your familiar with php and changing dlls etc... skip MSSQL for now!)
Moodle 1.8.x

Hope this helps!

In reply to Rich Tea

Re: Windows server: How to install Moodle - Where to start?

by Adolfo Lopez -

I can't to install moodle. I downloaded moodle, but I do not find the file to install this program. What can I do?

Thanks.

In reply to Adolfo Lopez

Re: Windows server: How to install Moodle - Where to start?

by Dennis Flynn -
Adolfo, there is no install, it's a website.

Setup your webserver (prob either IIS or Apache), setup MySQL (use at least the minimum version required in the documentation), setup PHP (at least the minimum version from the documentation and look at the posts in this forum regarding other experiences with specific versions), extract moodle into a website, and go through the setup webpages.

A good place to start would be: http://docs.moodle.org/en/Administrator_documentation
In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Jose Trompiz -
Hi Dennis
I just install moodle in Windows2003 but Only work in local mode. When I try to open from the other pc, only show the enter page without theme.
Could you help me with this?

Thanks
Jose
In reply to Jose Trompiz

Re: Windows server: How to install Moodle - Where to start?

by Dennis Flynn -
Not trying to be mean, but this question is all over the forums...please search before asking.

edit your config.php file, and change the wwwroot variable.

valid options are: 1) localhost, 2) your machine's name (computername), or 3) your machine's IP address

If you use option 1, which is the default, then you can only use moodle on your local computer, because localhost = 127.0.0.1 (your loopback address).

If you use Option 2, you access your moodle from any computer on your network by going to http://[computername]

If you use option 3, you access your moodle from any computer on your network by going to http://[ipaddress]

I took the next step and setup another DNS A record, pointing moodle.[mydomain].[com] to my moodle server's IP address. This is similar to option 2 and makes it so computers on my network can go to http://moodle.[mydomain].[com]. If you don't have a DNS server then you can accomplish the same thing by editing your hosts file, but you'd have to do it on every computer.
Average of ratings: Useful (1)
In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Jose Trompiz -
Hi Denny

Sorry, I just a dummy in moodle. Thanks a lot for your answer.
Regards

JL
In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Charles Bowser -
I think the problem is in the documentation. When I installed my moodle server I ran into the same problem. I had to install locally before moodle would write the config.php file. After that I could go back and edit wwwroot. Until the install moodle doesn't write the file so there isn't anything to edit.
In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Mark Haefke -

I am a novice also, and wondered what program I can actually edit the config.php file in?  Do I need MyPHP?  Thanks.

Mark Haefke

In reply to Mark Haefke

Re: Windows server: How to install Moodle - Where to start?

by Jose Trompiz -
Hi

You can use any text editor.

JL
In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Andy Lakin-Hall -
Hooray! Thanks for this post, and helping another beginner. This was just the vital clue I was looking for to get the Moodle test platform I am working on to serve to other machines on my network. I got completely stumped with how to move beyond the localhost stage. I guess this is elementary to some.  Thanks.
In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Doris Johnson -
I haven't been able to get moodle to configure. I am on page 11 of the install. When I type the http://webserver/moodle/install.php I get an error message in my apache log view that says " File does not exist: c:/Program Files, Apache Software Foundation/Apache2.2/htdocs/moodle. Do I need to move my unzipped moodle files in the htdoc directory? I have a windows 2003 server, PHP 5.2.5, mysql 5.0.45 and apache 2.2.6 with moodle 1.8.
In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Doris Johnson -
I reread your reply here. Looks like the answer is yes.
In reply to Rich Tea

Re: Windows server: How to install Moodle - Where to start?

by Dennis Flynn -
no typo, 5.2.1 is running very stable for me.
In reply to Rich Tea

Re: Windows server: How to install Moodle - Where to start?

by Doris Johnson -
I have read your discussions about moodle, php and IIS. I have just reinstalled windows 2003 on my server. I have also checked to see if the web server is working properly. Now I am installed PHP. How do I test to see if PHP is working?
In reply to Doris Johnson

Re: Windows server: How to install Moodle - Where to start?

by Hans B0s -

Hi Doris,

Create a file and give it a name like test.php

open it in a text editor and type:

<?php

phpinfo();

?>

put it in the root of your server. And test it with something like: www.yourdomain.com/test.php

succes.

In reply to Dennis Flynn

Re: Windows server: How to install Moodle - Where to start?

by Doris Johnson -

I moved my extracted files into the webserver directory, but when I type in http://webserver/install.php it ask me if I want to open or save.

DJ

In reply to Doris Johnson

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -

Your web server isn't setup to handle .php files correctly - IIS doesn't know what to do with the .php file so it asks you if it must open or save it. You have to associate the .php extension with the php5isapi.dll file (or the php-cgi.exe file if you're using the CGI version of php).

Read http://www.peterguy.com/php/install_IIS6.html, especially part 3.2.

I'm assuming you're installing Moodle on Windows Server 2003 & IIS box - but you didn't specify your platform, so...

In reply to Mark Hilliard

Re: Windows server: How to install Moodle - Where to start?

by Heather P -
Hi
we are using windows 2003 and apache 2.0.52 and until now I had not heard of this memory leak but what your saying makes sense with an issue we had in the past with a different LMS.
However we are not in a position to switch from Windows and I'm not to keen on going to IIS. Is there any particular combination of Apache version and PHP version that is either better or worse as I think we are stuck with the combo for the forseable. It wasn't a problem on Moodle 1.5.2 but Moodle 1.8.1 is so much slower that I think it probably is part of the issue.
Thanks
In reply to Heather P

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -
What's wrong with IIS?
In reply to Luis de Vasconcelos

Re: Windows server: How to install Moodle - Where to start?

by Matt Gibson -
What's wrong with IIS?

Apparently slightly slower and harder to configure.
In reply to Heather P

Re: Windows server: How to install Moodle - Where to start?

by John Curran -
Yes...what is wrong with IIS?

I'm keen to have a Moodle configuration that works OK on Windows boxes. As I understand it Moodle will work in the following configs:

Option 1 (Windows Lite)
Windows 2003 OS
IIS
PHP
MySQL
Moodle 1.8

Option 2 (Windows Strong)
Windows 2003 OS
IIS
PHP
SQL Server 2005
Moodle 1.8

I understand that the version of PHP is critical to success. From this thread it looks as though you need PHP 5.1.2.
In reply to John Curran

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -

> From this thread it looks as though you need PHP 5.1.2.

I've managed to get Moodle running on:

Windows Server 2003
IIS 6
PHP 5.2.4
MS SQL 2005
Moodle 1.8.2+ (2007021520)

No problems with that setup. The only thing that I haven't done is some load testing to measure how Moodle holds up on the above platform when there are eg. 100+ users logged on.

In reply to Luis de Vasconcelos

Re: Windows server: How to install Moodle - Where to start?

by ramkiran naga venkata -
hello luis,
can u tell me the procedure to install the moodle with your said combination
help me out from this please

thanx
ramkiran
In reply to ramkiran naga venkata

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -

Read the articles below. They contain all the info you need to setup Moodle on Windows, IIS and MSSQL.

http://docs.moodle.org/en/Windows_installation
http://docs.moodle.org/en/Installing_Moodle
http://docs.moodle.org/en/Installing_MSSQL_for_PHP
http://ferl.qia.org.uk/display.cfm?resID=8811
http://www.peterguy.com/php/install_IIS6.html

But I'm in a good mood, so here are some pointers:

  1. Install PHP (as the ASAPI module, not the CGI module) and make sure that PHP is installed 101% correctly.
  2. When PHP is installed test it by running PHPInfo(). Most Moodle setup problems that I've experienced were caused by bad PHP installations.
  3. Did I mention that you should make absolute sure that PHP is installed properly? Check it again!
  4. Install FreeTDS on the server so that Moodle can connect to MSSQL.
  5. Create a virtual directory in IIS on Windows Server 2003 for your Moodle site, eg. http://myserver/moodle.
  6. Extract all the Moodle files into the directory on the server that corresponds with the virtual directory that you created above.
  7. Enable the default content page for the Moodle virtual directory that you created in IIS and make the default content page the Moodle index.php file.
  8. Create a MoodleData directory on your server and leave it empty. All your Moodle course and data files will be saved here when you create your courses. For security reasons make this a seperate directory outside of your Moodle path, i.e. don't put it in your Moodle installation directory. Eg. Install Moodle in c:\Moodle and make your Moodledata folder c:\MoodleData.
  9. Create a new blank database in MSSQL 2005. Set 'Ansi Nulls Enabled' to true and 'Quoted Identifiers Enabled' to true. Don't create any tables or other database objects - Moodle will do all that.
  10. Copy the config-dist.php file and save it as config.php. Update this config.php file with your server and database details. Set $CFG->dbtype to = 'mssql_n' and add your specific details to the dbhost, dbname, dbuser, wwwroot, dirroot and dataroot fields in the config.php file.
  11. Run the http://yourserver/moodle/index.php file and Moodle will set itself up and create the database tables.
  12. Grab a beer...
In reply to Luis de Vasconcelos

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -

Ok, just to clarify a few things:

Re: Point 8 - The c:\MoodleData folder must also be setup as a virtual directory in IIS.

Re: Point 10 - Check the rest of the config.php file - there might be some other fields that you have to setup, depending on your platform.

In reply to Luis de Vasconcelos

Re: Windows server: How to install Moodle - Where to start?

by Cathy McQuitty -
Why did you have to create a virtual directory for c:\MoodleData folder?  I have not done that and my moodle seems to work fine.
In reply to Cathy McQuitty

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -

Um... I was just blindly following the instructions in the installation guide!

I'll have to remove my Moodledata virtual directory and see what happens...

In reply to Luis de Vasconcelos

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -

I couldn't resist the urge so I REMOVED the Moodledata virtual directory in IIS and Moodle is still working!big grin That will teach me to blindly follow instructions! blush

So it looks like the Moodledata virtual directory is NOT required! But I need to test my site further to make sure that I haven't broken anything by removing the virtual directory...

In reply to nathan rhodes

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -

Nathan said:

> I have heard you need the following:

> 1)PHP5
> 2)Apache
> 3)MySQL
> 4)Perl
> 5)Moodle

Perl is not required. The rest are required, although there are alternatives. You need a web server with PHP on it, a database and Moodle.

In reply to Luis de Vasconcelos

Re: Windows server: How to install Moodle - Where to start?

by a k -
Hi, I needed help with Installation of moodle.
I have installed apache 2.2.14,php5.2.13 &mysql 5.1.46 on windows 2003 server. when i am calling install.php it give an error "The page cannot be displayed". Can u help???
In reply to a k

Re: Windows server: How to install Moodle - Where to start?

by Luis de Vasconcelos -

It could be a Apache config problem or a PHP problem. Check Apache and then make sure that PHP is running correctly by checking the output of PHPInfo().

Also, turn off the "Friendly Errors" option in Internet Explorer so that you get a more detailed error message.