Windows server: Troubleshooting Guide - 404 Errors

Windows server: Troubleshooting Guide - 404 Errors

Bob Smith írta időpontban
Válaszok szám: 5
  • As you may well notice from my posts in other topics today, there appears to be a common problem with IIS 7 and 404 errors being displayed to users.

For everyone's reference, this is my brief / quickstart / ideas guide to help get you started troubleshooting this issue.

Basically three things can cause 404 errors on the above configuration:

  1. The page / resource really doesn't exist.
    • As far as I can see, this can only occur if you are:
      • manually typing an address in and make a typo etc.
      • using a link that was manually created with a typo / other error on a page.
    • This is probably the most unlikely cause for your 404 error.
  2. You have a problem with slash arguments
    • This will most likely be the cause of your 404 error if you are trying to access a resouce that was uploaded to a course.
    • You can try switching the SlashArguments setting and uploading some new resources however be aware that changing the setting will not fix existing resources on your system (as far as I know anyway)
    • Edit: trying to fix the links for existing resources through database edits proves to be an absolute PITA depending how many courses you have.
    • There have already been a lot of discussions on Slash Arguments and URL Rewriting which you can review
    • I would suggest working towards a solution that allows Slash Arguments to stay turned on because it appears that many SCORM resources available require this to work correctly.  My understanding of SCORM / resources / how people actually use Moodle is relatively limited (I am a Systems Engineer / Administrator as opposed to a teacher)
  3. You have a problem with the internal custom error pages moodle is trying to display
    • In my opinion, given the lack of information on this subject previously, this is most likely your issue if you are running on IIS 7
    • Just to clarify, an internal moodle error page is one that appears with the Pink/Red backgrounded bar explaining an error related to what you are trying to do within the moodle.  For the technically minded, all of these are generated with the print_error() function as far as I can tell.
    • A test to see if your internal error pages are working correctly:
      1. login to moodle from a workstation (note it is important that you don't do this from the moodle server itself)
      2. create a .csv file containing some random junk and one or two values. eg. "asdjflajsdfasdf,23498234,adsjaskdfjsadf"
      3. try to import the file in the users section as a bulk upload.  When asked which columns you will supply in the csv, select a number greater than what you've supplied in your csv.
      4. If you receive an error page from moodle with the pink bar, chances are everything is already working as expected, if you get a 404 back, please read on for fix information
      5. Note: the default configuration of IIS 7 will allow the error page to be shown correctly when it is executed from a web browser on the same server as which it is hosted.
    • Rather than retype everything here, please refer to my previous post here: http://moodle.org/mod/forum/discuss.php?d=144597#p635034 that will help you on your way to solve this issue.

Sorry for the long winded post but it appears that this information has been missing (particular that of the IIS CustomError Passthrough setting), and it has been for quite some time. 

Let me know if you need further information

Cheers,

Bob

Értékelések átlaga:Useful (2)
Válasz erre: Bob Smith

Re: Windows server: Troubleshooting Guide - 404 Errors

Murad Jamal írta időpontban

I face this issue when i try to add Elluminate Live! Session activity to course !

my configuration is : windows 7 / apache 2/ mysql

can you help me to fix this error ?

thank you so much in advance

Válasz erre: Bob Smith

Re: Windows server: Troubleshooting Guide - 404 Errors

Arif Shah írta időpontban

Hi Bob,

Could you elaborate more on the part 'working towards a solution that allows Slash Arguments to stay turned on'.

I am using PHP 5.3.27 fast-cgi on windows with IIS but my site only seems to work when I disable slash arguments. What configurations can I change to get my site working with slash arguments as I need SCORM courses to work.

Regards

Arif Shah

Válasz erre: Arif Shah

Re: Windows server: Troubleshooting Guide - 404 Errors

Jonas Nockert írta időpontban

Arif, I haven't tried it myself but perhaps http://support.microsoft.com/kb/2277918 could be worth looking into?

The title refers only to REQUEST_URI but further down in the document it also talks about PATH_INFO, which I think is what matters for Moodle in this case.

Regards,

Jonas Nockert

Válasz erre: Jonas Nockert

Re: Windows server: Troubleshooting Guide - 404 Errors

Jonas Nockert írta időpontban

Arif, I think I have good news for you!

We tried this on an IIS 7.5 installation earlier today. The hotfix couldn't be installed (it's from 2010 after all so I assume it's already incorporated in the latest IIS 7.5 version) but we created the FastCGIUtf8ServerVariables registry key according to the instructions from Microsoft linked in my previous post.

After that we could switch on slasharguments and resources with utf-8 in their names still seem to work.

/Jonas Nockert

Válasz erre: Jonas Nockert

Re: Windows server: Troubleshooting Guide - 404 Errors

Arif Shah írta időpontban

Hi Jonas,

I have just created the registry entry for FastCGIUtf8ServerVariables (after restarting IIS) the problem still persists. The javascript on the site still doesn't work without 'Use Slash' argument. (e.g. navigation menu).  

I am still seeing dirty URLs e.g. mysite.com/mod/scorm/view.php?id=28 which I believe should be something like /id/28 in the URL?

Could you please let me know if you using cgi.fix_pathinfo = 0 or 1?? Also, are you using IIS's URL Rewrite module? If so, what rules have you put in there?

Many thanks
Arif Shah