نمایش نتایج: از شماره 1 تا 3 از مجموع 3

موضوع: Setting up Perl/CGI to work with Windows Server 2003

  
  1. #1
    نام حقيقي: 1234

    مدیر بازنشسته
    تاریخ عضویت
    Jul 2009
    محل سکونت
    5678
    نوشته
    5,634
    سپاسگزاری شده
    2513
    سپاسگزاری کرده
    272

    Setting up Perl/CGI to work with Windows Server 2003

    کد:
    http://www.visualwin.com/Perl/
    The following things are assumed:

    1. You are running Windows Server 2003
    2. IIS 6.0
    3. You installed ActiveState ActivePerl (http://www.activestate.com) to C:\Perl UPDATE: ActivePerl 5.8.2 Build 808 and higher should add the Web Service Extensions during install
    4. You are using default (unmodified) ACLs/Permissions

    Also, all of my reasoning is explained after the step-by-step is done, at the bottom of the page.
    Load IIS from the Administrative tools in the Control Panel by clicking Start -> Administrative Tools -> IIS Manager (or loading the Control Panel, entering the Administrative Tools folder, and double clicking IIS Manager).

    Click the name of your computer then click "Web Service Extensions", on the left side of the main frame you will see a green arrow pointing to a link that says "Add a new Web service extension...", click that link.

    In that window, 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.

    Now, load up a command prompt (Start->Run... type cmd) and type (without the quotes) "md c:\inetpub\cgi-bin"

    Back in the IIS Manager right click Default Web Site highlight "New" in the pop-up menu and click "Virtual Directory..." in the new menu

    Click next to the first dialog in the wizard, then as a the alias put "cgi-bin" and click next then as a path for the next dialog put in "c:\inetpub\cgi-bin". On the next dialog leave everything checked and check execute and click next

    Click Finish to end the wizard.
    Now right-click cgi-bin and click properties

    Click Configuration in the lower right-hand area of the dialog and make sure .pl is there (if it isn't, add it the way you see it)

    Making your scripts work
    To make your scripts work the shebang line (#!/usr/bin/perl) should now be #!C:\Perl\bin\perl.exe . Any reference to any files should be changed from /home/user etc, to c:/home/user or c:\\home\\users - note the double back-slashes.
    Also, renaming your .cgi scripts to .pl is highly recommended - it's what I do myself ;-)
    Assuming this is all done correctly, you should now be able to run your Perl scripts successfully using Windows Server 2003, and IIS 6.0
    My reasoning
    Q: Why do you make cgi-bin in \inetpub and not in \inetpub\wwwroot even though you're going to be making a Virtual Directory there anyway?
    A: The reason I go through these extra few steps are (1) To bring in a Command shell (open one of those and you immediately look smart, plus it makes things go wwaaayyy quicker) (2) I got it from the *nix world, what can I say, back when I hosted on Linux that's the way the directories were set up, so it stayed with me bottom line is, you don't need it like that, it's just the way I prefer.
    Q: Why do you have a cgi-bin folder at all?
    A: It is always better to keep your scripts separate from your regular files.
    Q: If you know that ActivePerl 5.8.2 Build 808 and higher automagically add the service extensions, why do you still have this tutorial?
    A: Many reasons. First, this tutorial isn't only for Perl, but for anything similar. Second, just in case




    موضوعات مشابه:

  2. #2
    نام حقيقي: 1234

    مدیر بازنشسته
    تاریخ عضویت
    Jul 2009
    محل سکونت
    5678
    نوشته
    5,634
    سپاسگزاری شده
    2513
    سپاسگزاری کرده
    272

    Running Perl on IIS 7

    کد:
    http://blogs.iis.net/wadeh/archive/2009/04/13/running-perl-on-iis-7.aspx

    We've had a few people on our forums asking about running Perl on IIS 7. This led to some discussion on the team about getting it to work with FastCGI.
    The team has been doing a lot of great work with the Web Platform Installer and Windows Web App Gallery that feature popular PHP applications. Since PHP runs best on IIS with FastCGI, I suppose it was logical to turn to FastCGI for Perl as well.
    Sometimes, though, the right tool for the job is not the newest and flashiest thing. It turns out that this is the case for Perl. For many years, ActiveState has provided a free version of ActivePerl that runs great on IIS using ISAPI instead of FastCGI.
    It's been a while since I've looked at ActivePerl, so I did some research last week to see the state of things and discovered that there are a few things you need to know in order to get it to work on IIS 7:
    ActivePerl is available as an ISAPI for 32 bits only. This does not prevent it from running on a 64 bit install of Windows. It just means that any application pool that contains Perl content must be configured to run as 32 bit.
    As of this writing, ActivePerl runs well on IIS 7, but its installer does not properly configure IIS 7 for running Perl scripts. After completing the ActivePerl installation, you will need to create handler mappings to associate requests for Perl scripts to the correct ISAPI based Perl interpreter.
    There are at least two different ISAPI extensions with ActivePerl. You should make sure that you use PerlEx30.dll with IIS 7. If you use perlis.dll, you may find that response headers sent from your Perl script are added to your response page instead of going back to the client as headers.
    Given the above information, here are the steps to get ActivePerl running on IIS 7:
    1. Install ActivePerl from ActivePerl is Perl for Windows, Mac, Linux, AIX, HP-UX & Solaris | ActiveState. At this time, there is a link to version 5.10 for Windows (x86) on this page. This link downloads an MSI installer to your machine which you can run.
    2. If you are running the 64 bit version of Windows 2008, ensure that your application pool is configured to run as 32 bit. Assuming that you will be using ActivePerl in the default application pool, these steps will do it:

    • From the Windows 'Start' menu, pick run and type "inetmgr" (without the quotes). Click on 'OK".
    • In the left hand pane of IIS Manager, open up the settings for your server. Click on "Application Pools".
    • In the Application Pools page, select "DefaultAppPool".
    • In the right hand pane, under "Edit Application Pool", click on "Advance Settings..."
    • In the Advanced Settings dialog, ensure that "Enable 32-bit Applications" is set to "True".

    3. Create a handler mapping that associates "*.pl" requests with ActiveState's perlex30.dll extension using the following steps:
    4. In the left hand pane of IIS Manager, select your server. This will apply the following handler mappings on the entire server. If you would like to do this for just a specific site or application, you can open up the server and select any site or application. In the center pane, double click on the Handler Mappings icon.
    5. When the Handler Mappings pane is displayed, click on the "Add Module Mapping..." item in the Actions pane on the right.
    6. Fill out the Add Module Mapping dialog as follows:

    • For Request Path, enter "*.pl".
    • For Module, select "IsapiModule" from the dropdown list. Note that the ISAPI module is a prerequisite. If it does not show up on this list, it will need to be installed an an IIS optional component.
    • For Executable, enter "c:\perl\bin\PerlEx30.dll" (without the quotes.) Note that this assumes that you've installed ActiveState Perl using its default location. If you installed it in another location, you will need to look there for perlex30.dll.
    • For Name, enter "ActiveState Perl for .pl". Note that this name is just a label and does not affect functionality. It does need to be unique, though. If you are going to be associating other file extensions with ActiveState Perl, the names for those mappings will need to be different.
    • You do not need to do anything with the "Request Restrictions..." button. If you wish to limit this mapping to specific HTTP verbs, etc., it can be done there.

    7. Repeat the above steps for any additional file extensions you wish to be associated with Perl. On IIS 6, ActiveState Perl creates mappings for "*.pl", "*.plx" and "*.plex". Additionally, some applications are known to map "*.cgi" with Perl.
    That's it. After doing this, ActiveState Perl should run on IIS 7




  3. #3
    نام حقيقي: 1234

    مدیر بازنشسته
    تاریخ عضویت
    Jul 2009
    محل سکونت
    5678
    نوشته
    5,634
    سپاسگزاری شده
    2513
    سپاسگزاری کرده
    272

    How to set up Perl and CGI on IIS 7.0 in Windows Vista Ultimate

    کد:
    http://community.activestate.com/forum-topic/configuring-perl-on-iis-7#comment-1022

    I, too was stumped by this and could find nothing useful on the net - so figured it out by trial and error and by poring through pages of info on the internet.

    1. Make sure that you have installed Perl and that it is in your path command as per instructions elsewhere on ActiveState (c:\Perl is where I have it.)
      .
    2. Make sure that Perl is working by creating a little perl script and running it. Here is one that should work: #!/usr/bin/perl
      print "Hello world!\n\n";
      print "Press the Enter key to exit.\n";
      <>; #pause
    3. Make sure that you Install IIS 7.0 with:
      Web Management Tools = IIS Management Console
      World Wide Web Services = CGI
    4. Once you have IIS running properly, go to http://localhost to check. You should get a default web page.
      .
    5. Next, go into Control Panel
      = Administrative Tools
      = Computer Management (Local)
      = Internet Information Services (IIS) Manager
      = Default Web Site (or Default Web Site == cgi-bin if you set it up that way)
      = Handler Mappings
      = Add Script Map (once for CGI and again for Perl as per 6. and 7.)
    6. For CGI:
      Request path: *.cgi
      Executable: c:\Perl\bin\perl.exe "%s" %s
      Name: Perl Script Map
      Press 'OK'
      Say 'NO' to ISAPI message
    7. For Perl:
      Request path: *.pl
      Executable: c:\Perl\bin\perl.exe "%s" %s
      Name: CGI Script Map
      Press 'OK'
      Say 'No' to ISAPI message
    8. Restart IIS
      Control Panel
      = Administrative Tools
      = Services
      = World Wide Web Publishing
      = Restart the Service)
    9. Run a script that you know works. Don't do anything different until you are sure that IIS is running as expected.

    Cheers!
    Earl





کلمات کلیدی در جستجوها:

.plex activestate

active state IIS6 perlex30

how to set in iis add the perl cgi script mapping to the virtual directory. ( path = *.cgi executable = c:perlbinperl.exe -xc:inetpubwwwrootbugzilla -wt s s )

perlis or perlex30

activestateperl iis6 perlex30

ActivePerl 5.8.2 Build 808 and higher should add the Web Service Extensions during install

perl.exe s s iis7

برچسب برای این موضوع

مجوز های ارسال و ویرایش

  • شما نمی توانید موضوع جدید ارسال کنید
  • شما نمی توانید به پست ها پاسخ دهید
  • شما نمی توانید فایل پیوست ضمیمه کنید
  • شما نمی توانید پست های خود را ویرایش کنید
  •