HOWTO: Aspell and Windows 2003 Server

HOWTO: Aspell and Windows 2003 Server

by Richard Sleegers -
Number of replies: 13
This tutorial may also work with Windows 2000 Server and/or Moodle 1.6. It was created on Moodle 1.5.4 and Windows 2003 Server Web edition.

To add aspell functionality to the HTML editor:
  1. Install aspell and dictionary using Win32 install directions. I preferred using c:\progra~1\aspell as the path instead of c:\aspell. Leaving spaces in the path will probably not work.
  2. In Windows (i.e. lusrmgr.msc) create a Moodle user account and remove User privileges.
  3. Set permissions on the c:\progra~1\aspell folder (files and subfolders) to allow the Moodle account read and execute.
  4. Add read and execute privileges to CMD.EXE in the system32 folder for the Moodle user.
  5. Using IIS's Internet Service Manager, locate your site and the Moodle folders, change the security authentication from anonymous user to the Moodle user and set its password for the following folders:
    moodle\Admin
    moodle\Spelling
  6. In Moodle's Configuration, Editor settings, change the aspellpath to C:\progra~1\aspell\bin\aspell.exe and set editorspelling to Yes and set your language.
  7. Test using an editable page on your site. If you have used the editor before, you may need to press Ctrl-F5 (in firefox and IE) to completely reload the editor. (Or restart your browser)
I've written these instructions after the fact so there may be a step or two missing, but the ideas are there. It is a bit of a trade off for security in that anonymous users cannot access CMD.EXE and the only folders the Moodle user can access are the spelling related folders (except for \Admin). There may be ways to further tighten the security and I welcome any feedback on that.

Before adding read/execute privileges to CMD.EXE I was seeing the 'Couldn't create handle!' error on the Editor settings page. I did not have to add anything to the system path or change any registry settings.

Average of ratings: -
In reply to Richard Sleegers

Re: HOWTO: Aspell and Windows 2003 Server

by Richard Sleegers -
In reply to Richard Sleegers

Re: HOWTO: Aspell and Windows 2003 Server

by Dallas Ray Smetter -
Hi Richard. Will the procedure be the quite similar on my Win2K Server? Thank you!
In reply to Dallas Ray Smetter

Re: HOWTO: Aspell and Windows 2003 Server

by Richard Sleegers -
I believe it is very similar. In W2K, it is called Internet Information Services instead of Internet Service Manager. IIS in W2K is very similar (I have used both).

If someone is successful in using this on W2K Server, please let me know; or post what was different.
In reply to Richard Sleegers

Re: HOWTO: Aspell and Windows 2003 Server

by Dallas Ray Smetter -
This may sound crazy, but I didn't have to do any special configuration. I just installed aspell and entered the configuration into the mdl admin page. It works!
In reply to Dallas Ray Smetter

Re: HOWTO: Aspell and Windows 2003 Server

by Richard Sleegers -
I would be a bit concerned that your system may not be securely set up. You are using NTFS file system, correct? or perhaps Windows 2003 server locks down more files by default.
In reply to Richard Sleegers

Re: HOWTO: Aspell and Windows 2003 Server

by Vijay N -

Hi Richard,

I followed the steps above for setting up the spell check on my Moodle server (Moodle version 1.97). But to no luck. When I enter the path to the aspell.exe on the system path in Admin/server of the moodle, the html editor does not load up. But when I remove the system path the html editor works normally but with no spell check option. Please help.

PS. I have granted permissions (full control) for all the folders that were suggested in your article. including cmd.exe for moodleuser-user account. Since I have several user accounts on the Moodle server I had to add moodleuser account to the list of users that could have "full control" access to the above folders.

In reply to Richard Sleegers

Re: HOWTO: Aspell and Windows 2003 Server

by Scott Bartley -

This is something we want to install, however our IT department won't allow it saying that it is a security risk to allow execute privileges for the Moodle user to cmd.exe

Can anyone elaborate on the potential risk, ways to minimize the risk, or any alternatives to Aspell for Windows servers?

In reply to Scott Bartley

Re: HOWTO: Aspell and Windows 2003 Server

by Les Bell -
I too am concerned about the security risk. But though it is on Windows Server 2003 we are not running Moodle with IIS, it uses Apache. Is it the same story for that, that the moodle user requires permissions for C:\windows\system32\cmd.exe ?
In reply to Scott Bartley

Re: HOWTO: Aspell and Windows 2003 Server

by Erik Nielsen -

opening up cmd.exe so that the system could open any program or execute any cmd line options is always risk.

A small risk.  But a risk that should be avoided.

About two months ago I developed an alternative part of the speller that still uses aspell as the engine, but uses the PHP calls that tie into the aspell engine instead of using shell_exec (which is what causes the problem).

We've had it in production for about a month and have had no issues, so I'm willing to send this out for further testing/use if anyone else wants to try it.  I offer no promise or guarantees.  But it is working here with no reported problems.

All you need to do is backup the file spellchecker.php in moodleroot\lib\speller\server-scripts and replace it with the attached file.

You still need to have aspell installed and the paths configured like you normally would.

I hope this helps.

Note: This has only been tested on a windows 2003 server running IIS6.  But in theory it should work on an Apache Server as well.

In reply to Erik Nielsen

Re: HOWTO: Aspell and Windows 2003 Server

by John Fitchett -

I keep getting the error:

Error executing

-aH --lang error  --encoding=utf-8 <E:moodledataaspC4A.tmp 2>&1'

Acces is denied

Can anyone help?

In reply to Erik Nielsen

Re: HOWTO: Aspell and Windows 2003 Server

by Jon Ofstad -

Thanks Erik for the work around.  We can't, however, get the checker to actually check.  The checker runs, but does not catch any spelling errors.  No server errors are displayed and the interface looks intact.

Thoughts?

In reply to Jon Ofstad

Re: HOWTO: Aspell and Windows 2003 Server

by Erik Nielsen -

(Sorry for the long delay in responding)

Do you have PSpell enabled in your PHP?