I have a fresh install of Windows Server 2003 and could really use some help getting things working.
The only reason we need Perl on this server is so that existing scripts can use formmail (from Matts script archive). The formail Perl script will be held in the following folder:
C:\Inetpub\wwwroot\mywebsite.com\cgi-bin
To get this working, I have already downloaded Activestate ActivePerl (5.8.2.808-MSWin32-x86.msi) and installed Perl to C:\Perl and that installation went fine.
What further steps do I need to make sure Perl works? Do I have to point it at the cgi-bin folder? Any further advice would be greatly appreciated :)
Thanks
Microsoft IIS Web Server and ASP.NET [webmasterworld.com]
#!/usr/bin/perl
After the install you may need to reboot your computer to get the Windows PATH environment variable loaded in memory properly unless you know how to set it from the command line.
Next, set up your Apache httpd.conf file as mentioned in the link there and you should be good to go. It is your ScriptAlias directive that you want to get right and it won't hurt to set your <Directory> container up for the cgi-bin as noted in that message.
Hold on, I forgot you were on IIS. Man, it's been so long since I've used that HTTP server I cannot recall where you set the scripting engine information. Well, based on ScriptAlias you should be able to find the relative information either in the IIS forum here or on Microsoft support site.
installed it to C:\usr
Why would you do that? C:\Perl is just fine, although it doesn't matter where it's installed as Windows uses file associations to find it.
leave your shebang line as#!/usr/bin/perl
Second, Windows does NOT use a #! line, so that will be ignored anyway.
After the install you may need to reboot your computer to get the Windows PATH environment variable loaded in memory properly unless you know how to set it from the command line.
Maybe, from the commmand line you can type 'set' and check the PATH variable, or just type 'perl' and see if it finds it. Although you've probably done that much by now.
I cannot recall where you set the scripting engine information
Errr, which version did you use? You don't need to set anything manually. This is NOT *nix. When Perl installed it should have installed the ISAPI for IIS automatically.
You need to do nothing further to make your perl scripts work, except check in IIS that the site has 'scripts and executables' set on 'execute permissions' on the 'Home Directory' tab. If it doesn't it will just display the contents of the script rather than executing it.
Then just try a .pl script in your browser. This should work just let me know if you have any problems.
Hold on, I forgot you were on IIS.
You may certainly be correct about your statements here as I stated at the very close of my message I realized/remembered the OP was running IIS. I'm running Apache. The last time I ran any MS HTTP engine was back in the mid-90's. I had used PWS and then IIS as an add-on to NT. Over 12 years ago. Once I discovered Apache I never looked back. I will add a few responses below, they will not be relevant to the questions posed by the OP but for future readers that come across this thread who are running Apache I think it is important I clarify a few things ...
Why would you do that? C:\Perl is just fine, although it doesn't matter where it's installed as Windows uses file associations to find it.
Not entirely true, especially not true for Apache. There is a checkbox option during install to determine whether or not you want to set perl file associations in Windows. If IIS requires this setup I imagine you will want to make sure that checkbox is ticked. Personally, if I double click a script I want to edit it, not run it. User preference. However, for Apache users that will not matter anyway. You can either set a ScriptAlias and run scripts with any extension from the aliased directory, or you can add an "ExecCGI" to the "Options" directive to use CGI scripts outside of ScriptAliased directories and then set an AddHandler to tell Apache which file extensions should be parsed by the perl interpreter.
Second, Windows does NOT use a #! line, so that will be ignored anyway.
IIS may not use the shebang line but if it is missing on an Apache install the script will indeed fail as the interpreter will not be located. To port the code to a server other than IIS such as the Apache server, the shebang line must be present.
I cannot recall where you set the scripting engine informationErrr, which version did you use? You don't need to set anything manually. This is NOT *nix. When Perl installed it should have installed the ISAPI for IIS automatically.
You need to do nothing further to make your perl scripts work, except check in IIS that the site has 'scripts and executables' set on 'execute permissions' on the 'Home Directory' tab. If it doesn't it will just display the contents of the script rather than executing it.
Errr, I guess you did have to check it manually now, didn't you? :)
Anyway, that is what I believe I was trying to recall. Back when I was using IIS I had to trigger that option as you specified.
[httpd.apache.org...]
Not sure what all versions of Apache support the directive. The documentation should indicate that.
So a Windows user should be able to use a unix shebang line in all their perl scripts, be they CGI or not. That way when the scripts are moved to a Unix type of environment no modification is needed, at least not to the shebang line.
Not that this information is germane to the original question but I think it is to the supplemental discussion.
I never used IIS that long ago....I was still in school! :)
Maybe Apache was a good alternative back then.
If IIS requires this setup I imagine you will want to make sure that checkbox is ticked. Personally, if I double click a script I want to edit it, not run it
IIS doesn't necessarily require it, you can botch it manually, but why would you? If you want to edit the scripts by double click you can change this action in the 'File Types' setup without breaking IIS.
check in IIS that the site has 'scripts and executables' set on 'execute permissions' on the 'Home Directory' tab
Quoting myself now, this is more of a permissions thing than a scripting setup thing, but yes you're right you do need to do this in addition if you didn't do it when you created the site in the first place.
Apache on Windows can also be setup to ignore the shebang line
Judging by what you and Perl_Diver said, you can tell that Apache started off in the UNIX world, nice to see they are starting to integrate with Windows properly though. Maybe soon they'll implement a GUI too?
Anyway, [b]Karma[b], I hope our little discussion has been useful, let us know how you get on.
I never used IIS that long ago....I was still in school! :)
Maybe Apache was a good alternative back then.
LOL Dabrowski! C'mon, I'm not that old ;)
And Apache has always been good! Alternatives like IIS came along afterward.
IIS doesn't necessarily require it, you can botch it manually, but why would you?
Because I'm not running IIS. But as already recognized, Karma is and I already took us off topic once here today! Yes, the supplemental discussion has been great but I almost derailed this thread. There is some good reading in here but we will need to bring the focus back to IIS. Hopefully you can assist, Dabrowski, if there are any more IIS setup questions because I won't have a clue. We just didn't want to leave Karma hanging without some further direction. Thanks!
[httpd.apache.org...]