Checklist for installing PERL and OpenSRS
Getting the OpenSRS system to work on a Windows system in IIS isn't easy! There were (at the time of writing) open source ASP projects in development, however, none of them offered the functionality of the OpenSRS system.
After several weeks deploying this system we divised the following checklist for installing PERL and the OpenSRS software on a Windows box.- Download and install the latest version of PERL from ActiveState
- Download the nmake utility provided by Microsoft and add to the PATH environment variable (or copy to the 'C:\Perl\Bin' directory)
- Restart the computer in order to register the environment variables
- Start IIS and click on 'Web Service Extensions'. The latest version of ActivePerl should add Web Service Extensions during the install which will need to be 'activated'.
- To add the 'Web Service Extension', click on 'Add a new web service extension', where it asks for the extension name you can put anything, like "CGI script" and under the "Required Files" section put the following in (without the apostrophes) 'C:\Perl\bin\perl.exe "%s" %s' click OK to the notification, click 'Set status to allowed' and press ok
- Note : Remove any mappings that you won't use. In particular, take out the .printer mapping and the .ida and .idq mappings unless you have some special need for them. For security reasons you should strip the mappings down to nothing but the absolute requirements. DON'T leave any in there "just in case". If you need it later, put it in later
- Create a 'cgi-bin' folder in (for example) 'c:\opensrs\cgi-bin'
- In IIS Manager right click 'Open SRS' Web Site and highlight 'New' in the pop-up menu and click 'Virtual Directory...' in the new menu. For the alias put 'cgi-bin' and select the correct path to the folder. Select the Execute permission plus the defaults (required??).
- Right-click 'cgi-bin' in IIS (Open SRS Website), click properties and click 'Configuration' in the lower right-hand area of the dialog. Make sure .pl is there (if it isn't, add it the way you see it) and .cgi too, otherwise you must rename all .cgi to .pl extensions
- Download the latest version of the OpenSRS client software from OpenSRS Client
- Extract the Client files and copy the cgi, etc, lib and templates folders to the 'Project OpenSRS' website.
- Copy the image 'logo.gif' to the cgi-bin directory
- Modify the paths in the .cgi's. You will need to modify each of the .cgi files that you copied into your /cgi-bin directory so that they include the path to OpenSRS.conf (which is in the /etc directory that you moved into your web's root directory)
- Open each of the cgi's in notepad or another text editor, and replace do "[path_to_conf_file]/OpenSRS.conf"; with something like this: do "C:/inetpub/opensrs/etc/OpenSRS.conf"; Note the FORWARD slashes and the fact that the entire path to the file is specified.
- Modify OpenSRS.conf to include your username, email address, source path (is the directory where the /lib and /templates directories live) and private key (generated from the TuCows website)
- Start the command shell (cmd.exe)
- Start ppm
- Install the HTML-Template module using the following commmand : install c:\technical\perl\modules\html-template.ppd
- Install the Net SSleay module using the following commmand : install c:\technical\perl\modules\Net_SSLeay.pm.ppd
- Install the Crypt SSLeay module using the following commmand : install c:\technical\perl\modules\Crypt-SSLeay.ppd
- Copy the dll libeay32.dll to the 'C:\Perl\Bin' folder add register using the regsvr32.exe 'dll' command
- Copy the dll ssleay32.dll to the 'C:\Perl\Bin' folder add register using the regsvr32.exe 'dll' command
- Install the IO Socket SSL module using the following commmand : install c:\technical\perl\modules\IO-Socket-SSL.ppd
- Install the Crypt CBC module using the following commmand : install c:\technical\perl\modules\Crypt-CBC.ppd
- Install the Crypt Blowfish module using the following commmand : install c:\technical\perl\modules\Crypt-Blowfish.ppd
- Install the MIME Base64 module using the following commmand : install c:\technical\perl\modules\MIME-Base64.ppd
- Install the Crypt HCE_SHA module using the following commmand : install c:\technical\perl\modules\Crypt-HCE_SHA.ppd
- Useful repositorys: ActiveState PPM
- Useful repositorys: CPAN's module distributions
- Create a special user on the system, for example, CGI_IUSR. This will be the user account user which we'll have the CGI's run anonymously (you'll need to use 'Computer Management')
- Grant the CGI_IUSR user read-only access to the site
- Select the cgi-bin, etc, lib and templates directories. The right click and choose Properties for them. Click the "Security" tab. What you want to do here is REVOKE access for IUSR_machinename and allow READ and EXECUTE access for CGIUSR_DOMREG.
- In MMC, right-click the cgi-bin directory and choose Properties. Click the "Directory Security" tab. Under "Anonymous Access and authentication control" click Edit. Click Edit next to "Account used for anonymous access". Change the username to CGIUSR_DOMREG. If the CGIUSR_DOMREG is a local machine account, check the box to allow IIS to control the password. Otherwise, fill in the password
- Modify the file OpenSRS.conf in order to use SMTP instead of sendmail.
#### 'sendmail' option is recommended for servers on UNIX based systems
#### if you do not have sendmail on your system, set $MAIL_TYPE to 'smtp'
$MAIL_TYPE = "smtp"; # valid options: sendmail, smtp
use Socket; #uncomment this line if your choice is smtp
#### define this if you set $MAIL_TYPE = 'sendmail'
#$MAILPROG = '/usr/sbin/sendmail -t -oi -oem'; # path and args for sendmail
#$MAILPROG = "cat >>mail.log"; #for test system
#### recommended option for servers on win32 platform
#### define these values if you set $MAIL_TYPE = 'smtp'
$LOCALHOST = 'www.yourdomain.com';
$SMTP_SERVER = 'smtp.yourdomain.com';
$SMTP_PORT = 25;
- You'll need to modify the section of OpenSRS.conf that specifies which encryption method and connection type is to be used
%OPENSRS = (
username => $USERNAME,
private_key => $PRIVATE_KEY,
REMOTE_PORT => 55000,
REMOTE_HOST => "horizon.opensrs.net",
connection_type => 'HTTPS', # CBC, HTTPS
crypt_type => 'Blowfish', # DES, Blowfish, or Blowfish_PP (slow!)
# Regular expression that lists the domains serviced by OpenSRS.
.
.
- Modify reg_system to correct deficiencies with SMTP mail as below
- Some SMTP servers (notably Microsoft's SMTP Server from the Microsoft NT 4.0 Option Pack) may require changes to how messages are composed. This is due to the fact that Microsoft's SMTP server requires a CR/LF pair to terminate a message, and the scripts only provide for a "newline" or LF. The symptom of this problem will be that the CGI appears to hang at the last page and no mail will be sent.
sub send_to_server {
my( $socket ) = shift;
my( $message ) = shift;
send( $socket, "$message\r\n", 0 ) or return 0;
return 1;
} - Note the addition of a \r immediately following the variable $message.
- Additionally, the "send_smtp_mail" function in the same .CGI needs the \r added to one string
sub send_smtp_mail {
.
.
.
send_to_server( \*SOCK, "$message\r\n." ) or return 0;
.
.
.
}
Published Thursday, July 15, 2004

