Installing Elgg platform on Windows Server 2008 IIS 7

How to make Elgg work on a windows 2008 or 2008 r2 server:

I’ve used the installatron installer in plesk to do the initial Elgg installation. But after finishing the installation, Elgg didn’t work.

elgg on iis login pageAfter login in, it shows a 404 error:

elgg on iis 404

DaWolf posted an interesting solution on the Elgg community discussion board:

Yes I am running Elgg on IIS 7 (Windows 7). The rules you tried to add in the web.config threw errors in the regular expressions because IIS doesn’t need an escape character for the underscore. Replace all instances of /_ with _ in each regular expression and you should be good. I have added instrutions on how to get Elgg running on IIS if you’re just starting out.

  1) Install the IIS URL Rewrite module:

  2) Open the IIS Manager in Control Panel > Administrative Tools

  3) Right-Click on your Elgg site and select “Switch to Features View” if not already there.

  4) Open the URL Rewrite Feature and click “Import Rules…” in the actions menu.

  5) Browse for a configuration file… Open the “htaccess_dist” file located in the root directory of your elgg site.

  6) Rename each rule if you desire to do so by right clicking on the  rule name in the Tree View. This is optional. I renamed my rules  “Action Handler, Service Handler, Export Handler1, etc…”

  7) Under each rule there is a match tag. The tags contain regular  expressions. Most regular expressions will generate an error because IIS  is interpreting them differently than Apache would. There is a simple  fix. In every instance you see “/_” remove the slash.  It is an escape character for the underscore. This isn’t necessary for  IIS and will generate an error. Be sure to remove it anytime you see it  before the underscore.

  8) In the actions menu on the right, hit apply.

That’s it! Elgg should now work on IIS.

Please note that this is only a viable solution if you have access to the IIS manager, in a shared hosting enviroment this can be an issue, please contact your hosting provider if you need support with these settings.


Show Windows Server 2008 file fragmentation status

Server 2008 does not show the fragmentation percentage.

Unlike Windows Server 2003 and Windows Server 2008 R2, Server 2008 -like Windows Vista- does not show a file fragmentation percentage or report, it only advises whether you should or shouldn’t defrag your harddrive. This can be an issue if you need to improve performance of servers under high-load and/or don’t want to stress your shared storage by defragmenting drives that don’t need defragmentation. Luckily this has been solved in Server 2008 R2.

Solution: Use the command line tool

To see the file fragmentation percentage in Server 2008, instead of the Disk Defragmenter, use the ‘defrag’ tool in your command prompt:

  1. Open a command prompt
  2. Type defrag [driveletter] -a -v to analyse your disk
  3. The command prompt will return something like the screenshot below:
    (As you can see, this server needs a defrag quite badly :-) )

Server 2008 Defragmentation

You can use the following commandline options:

-A Perform an analysis of the specified volume.
-C Defragment all disks.
-F Force defragmentation of a volume even when low on space.
-R Perform a partial defragmentation, consolidating fragments smaller than 64 MB (default).
-V Set verbose mode for detailed output during analysis and/or defragmentation.
-W Performs full defragmentation, consolidating all fragments regardless of fragment size.

Now to defragment your drive, simply type defrag [driveletter] -w to defragment your harddrive.

Happy Defragging!