How to install & configure ActivePerl on Windows
This article is part of our "How to install prerequisites needed for running a self-hosted edition of MIDAS from a Windows server" series.
It applies to self-hosted installations of MIDAS software on Windows-based servers only, and outlines how to install ActivePerl on Windows. Other Windows distributions of Perl (such as Strawberry Perl) are also available.
Please note that this article is provided "as is" and is correct at time of writing. For further assistance installing/configuring Apache, please refer to the vendor's own documentation/support.
This article assumes that you've already successfully completed our previous "How to install & configure Apache on a Windows server" guide.
Contents:
- Step 1 - Download ActivePerl for Windows
- Step 2 - Install ActivePerl
- Step 3 - Test
- Step 4 - Install Additional Modules
Step 1 - Download ActivePerl for Windows
A free "Community Edition" of ActivePerl is available for Windows may be downloaded from ActiveState.Step 2 - Install ActivePerl
Run the ActivePerl Installer, read & accept the License Agreement, and then select a "Typical", "Custom", or "Complete" install. If in doubt, select "Complete". If you wish to install ActivePerl to a different location (the default is C:\Perl64), you'll need to select "Custom" instead:If selecting "Custom", we suggest that the "PPM" option is also selected, as this will make it easier to install additional Perl modules later.
On the following dialog, be sure that "Add Perl to the PATH environment variable" is selected:
...and proceed to install ActivePerlStep 3 - Test
Once the ActivePerl installer has complete, let's test Perl to ensure that it's working correctly.Open a standard text editor and add the following two lines:
print "content-type:text/html\n\nHello World!";
Save this file as "test.pl" to C:\Apache24\htdocs (or D:\Apache\htdocs, etc depending upon where you installed Apache)
If you've not added the "ScriptInterpreterSource Registry" directive to your Apache server's http.conf file (as described in the first part of this series, "How to install & configure Apache on a Windows server", then ensure that the first line of your "test.pl" file reflects the location where you chose to install ActivePerl, followed by \bin\perl.exe. If however you did set the "ScriptInterpreterSource Registry" Apache directive, then you don't need to worry about the first line of your test.pl script being correct - in fact, it can be safely omitted it all together!
Next, in your web browser, navigate to http://127.0.0.1/test.pl, and you should then see the words "Hello World!" in your browser:
...which indicates that Perl has been correctly configured!
If however, you see the entire contents of your test.pl file, then Apache didn't know how to handle your .pl file, and so instead of "executing" it, displayed its contents as plain text instead. In which case, please check Step 3B of our "How to install & configure Apache on a Windows server" guide.
If all you see if a server error when access test.pl in your browser, it's likely that either you've not correctly configured Apache to handle .pl files and/or to execute cgi scripts (please refer back to our "How to install & configure Apache on a Windows server" guide), or there's a typo in your test.pl file.
Step 4 - Install Additional Modules
Once you have your test.pl script displaying "Hello World!" in your browser, it's now time to download and run our "Server Readiness" MIDAS tool. This utility will test your server setup and ensure that you have all the required Perl modules required for running MIDAS, and may be freely obtained via the MIDAS Server Requirements page.
Save the utility to the same location as your previous "test.pl" script, and then access it via your browser in the same way.
Let the Server Readiness tool run, and make note of any missing required Perl modules:
ActivePerl comes with a handy "Perl Package Manager (PPM)" tool allowing you to easily install additional modules. You should be able to locate this tool via a shortcut in your Start Menu:
When PPM loads, press Ctrl + 1 to view all available packages, and use the search box to locate those which the MIDAS Server Readiness tool informed you were missing, in this example, DBD::mysql:
Right-click on the module and select "Install <module>" to mark it for installation.Do this for any other missing required modules, and then once you've marked all the required modules for install, press Ctrl + Enter. Accept PPM's confirmation that it's about to install modules, and then let the installation commence. It may take several seconds/minutes depending upon the number of modules you've selected. Once installation of all modules is complete, the "Status" tab at the bottom of the PPM window will indicate that installation is complete.
Re-run the MIDAS Server Readiness tool again in your browser to check that the previously missing modules have now been installed.
Also In This Series...
Part 3: How to install & configure MySQL on a Windows server
← Return to the Knowledge Base