Intial Setup of Moodle

Intial Setup of Moodle

by Jeremy Wendling -
Number of replies: 13

I'm in the process of setting up a new locally hosted moodle server.  Running on Windows 2012 R2 with  Apache : 2.4.17 MySQL : 5.7.9 PHP : 5.6.16.  

Everything installs properly, I am able to get into moodle when I am remote into the server, Every time I try to access it from outside the server I get a 403 forbidden error.  I thought I followed all the steps on the moodle installation document properly.  Is there something that I am missing.  




Average of ratings: -
In reply to Jeremy Wendling

Re: Intial Setup of Moodle

by Usman Asar -
Picture of Plugin developers Picture of Testers

Jeremy, I couldn't understand the need of Apache when you had IIS with Server 2012?

Average of ratings: Useful (1)
In reply to Usman Asar

Re: Intial Setup of Moodle

by Jeremy Wendling -

Because the Setup Instructions tell you to use Apache, thought that would be Best Practice.  

In reply to Jeremy Wendling

Re: Intial Setup of Moodle

by Perry Way -

We are running Moodle on IIS and I think it's faster than Apache on Windows.  When we first started experimenting before going live I found Apache to be slower than IIS on Windows. I don't have proof of this but I believe I did see a notable performance increase. There's only a few things you need to do to get it to run properly on IIS and they might not be well documented in the Moodle documentation but can be found on the internet easily enough - namely getting CGI to run since it's not running defaulted on IIS installations. Then you might also have some settings to instruct IIS to cause *.php files to be loaded by PHP.exe.  Personally speaking, I would shy away from running PHP as an ISAPI application since a poorly written script could lock up the thread the request is running on or even worse, possibly take down your web server requiring you to reset the server. I'd run PHP using CGI, and so is the advice from many professionals. 

This link will get you started if you want to try. There's a ton of resources on the internet for this common setup task. I personally find IIS to be a more mature Web Server and the GUI interface is quite a bit friendlier than INI files. Additionally, IIS is full on integrated with everything else in Windows Servers including the Event Viewer for those errant scripts that throw unhandled exceptions.

https://www.iis.net/configreference/system.webserver/cgi

Average of ratings: Useful (2)
In reply to Perry Way

Re: Intial Setup of Moodle

by Usman Asar -
Picture of Plugin developers Picture of Testers

Perry, ISAPI was taking care of PHP using CGI until Server 2003, 2008 came with update to handle PHP using FastCGI, whilst since 2008 R2 it's FastCGI taking care of PHP by default, so its now CGI extension that needs to be enabled, not ISAPI and ISAPI filters anymore.

Just FYI, CGI handeling PHP was opening a new thread for every new request, whilst FastCGI reuses the requests therefore reducing load on memory and CPU.

Average of ratings: Useful (1)
In reply to Usman Asar

Re: Intial Setup of Moodle

by Perry Way -

It's still possible to run PHP as an ISAPI module. I was instructing the OP to use the CGI method rather than be lured by the promise of increased performance running as an ISAPI module, for the reasons I cited.

In reply to Jeremy Wendling

Re: Intial Setup of Moodle

by Usman Asar -
Picture of Plugin developers Picture of Testers

But the setup instructions as well tell you to use Linux with Apache, for Apache's performance on Windows system is not as good as it is on Linux, just giving very recent example for a school, for I just finished  assisting setting up TurnItIn plug-in,  they setup Apache on Windows and server was under performing, taking times to load pages and even worst case scenario CPU processes were delaying pages, quizzes were near impossible, until they switched to IIS and I was forwarded messages from students telling incredible speed difference.

If you're having difficulty setting up IIS on Windows for moodle, here is full video tutorial guiding you through the process.

http://blog.academictools.org/2015/12/installing-moodle-on-microsoft-windows.html


In reply to Usman Asar

Re: Intial Setup of Moodle

by Jeremy Wendling -

Thanks I will give this a shot and report back.  

In reply to Jeremy Wendling

Re: Intial Setup of Moodle

by Perry Way -

Another resource is the PHP on IIS website: https://php.iis.net/

Additionally, how to set up a handler for php in IIS, after you get FastCGI running, then use the IIS GUI management app and find Handler Mappings, then add a handler for PHP, and point it to the installation of PHP you want to be executed. Here's some screen shots to get you on your way:

IIS GUI showing Handler Mappings


Then add handler:

add handler


And finally set the handler settings to point to your php installation:

php add handler settings


In reply to Perry Way

Re: Intial Setup of Moodle

by Usman Asar -
Picture of Plugin developers Picture of Testers

Perry, the  tutorial I linked has everything in form of video, using both manual method of setting up PHP and Automated setup using PHP Manager (which I recommend)

In reply to Usman Asar

Re: Intial Setup of Moodle

by Jeremy Wendling -

videos were very helpful, i am up and running.  Sure I have a long way to go but it is a start. Thanks for your help.  

In reply to Jeremy Wendling

Re: Intial Setup of Moodle

by Usman Asar -
Picture of Plugin developers Picture of Testers

Glad they helped! you'll definitely will find IIS way better on Windows Platform, than Apache even on Linux