Install, Setup and Configure CGI and Perl in Windows XP Установка, настройка и конфигурирование CGI и Perl в Windows XP

Prerequisite Предпосылка

Obvioulsy, a web server needs to be running on the Windows machine. Obvioulsy, веб-сервер должен быть запущена на Windows машине. Refer to this Обратитесь к этому post должность for instructions on how to install Apache2 in Windows. Инструкции по установке Apache2 в Windows.

Download ActivePerl Скачать ActivePerl

Download ActivePerl from Скачать с ActivePerl http://www.activestate.com/Products/ActivePerl/?mp=1 . Click on Free Download to start the download process. Щелкните на Free Download, чтобы начать загрузку. There is no need to input any contact info. Существует нет необходимости вводить каких-либо контактную информацию. Just leave it blank and press ‘Next’ to start the download. Просто оставьте ее пустой и нажать "Далее" для начала загрузки.

Then download the lastest version of Windows MSI package. Тогда скачать последнюю версию Windows пакет MSI.

Install ActivePerl Установить ActivePerl

Start the installation by double clicking the setup file. Пуск установки двойным щелчком файла установки. Follows the on-screen instruction. Следит на экране инструкции. If you will be using Perl CGI programs and want to maintain some level of portability between both Linux machines and Windows machines, you may want to install Perl at the same location on your Windows machine as it is on most Linux machines. Если вы будете использовать Perl CGI программ, и вы хотите поддерживать определенный уровень переносимости между двумя машинами Linux и Windows машинах, вы можете установить Perl на том же месте на вашей Windows машине, как это делается на большинстве Linux машин.

For example, on Linux machine, Perl is located at /usr/bin/perl and so every Perl program that I write begins with #!/usr/bin/perl . Например, на Linux машине, Perl находится в / usr / бен / perl, и поэтому каждый Perl программа, которая Пишу начинается с #! / Usr / бен / perl. So, it’s best when install Perl on an Windows machine, instead of installing it in the default location (ie C:\perl), install it in C:\usr instead, so that the Perl executable is located at /usr/bin/perl. Так что, лучше, если установить Perl на Windows машине, вместо установки в местоположения по умолчанию (например, C: \ perl), установите ее в C: \ usr вместо того, чтобы Perl исполняемый файл находится в / usr / бен / perl. This allows codes written on Windows machine been moved to, without changes, to Linux machine, and have it run there, and vice versa. Это позволяет коды, написанные на Windows машине перемещен без изменений, для Linux машине, а затем запустить там, и наоборот.

To change the installation path, click on browse button when you’re on the installation screen that prompts you to select which features you want to install. Чтобы изменить путь установки, нажмите на кнопку просмотра, когда вы будете на установку экран, который предложит вам выбрать, какие функции вы хотите установить. Set it to C:\usr\ if needed. Установите его в C: \ usr \, если это необходимо.

Make sure that the following options is checked (selected): Убедитесь в том, что следующие варианты проверяется (выбранные):
Add Perl to the PATH environment variable Добавить к Perl переменная окружения PATH
Create Perl file extension association Создайте Perl расширение файла ассоциации

Activating CGI Активация CGI

Open the httpd.conf file for editing by selecting Start > Programs > Apache HTTP Server > Configure Apache Server > Edit the Apache httpd.conf Configuration File. Откройте файл httpd.conf для редактирования, выбрав Пуск> Программы> Apache HTTP Server> Настройка сервера Apache> Изменить Apache httpd.conf файл конфигурации. Alternatively, open the httpd.conf with any text editor. С другой стороны, открыть httpd.conf с любой текстовый редактор.

In the main directory section, search for Options Indexes FollowSymLinks (at about line 267), and add ExecCGI to the end so it looks like: В основной раздел каталога, осуществлять поиск по индексам Опции FollowSymLinks (примерно строка 267) и добавить ExecCGI к концу этого он выглядит следующим образом:

Options Indexes FollowSymLinks ExecCGI Параметры индексов FollowSymLinks ExecCGI

Search for the following line and remove the hash mark character (#) to uncomment this line. Искать следующую строку и удалить символ знака хэша (#) надо раскомментировать эту строку. (You can also change .cgi to .pl, or add .pl behind .cgi if you prefer that perl extention is also treated as cgi files) For example: (Вы также можете изменить. Cgi с. Pl, или добавить. Pl позади. Cgi, если вы предпочитаете, чтобы perl внутр.номер также рассматривать как cgi-файлов) Например:

#AddHandler cgi-script .cgi # AddHandler подобную сценарий. Cgi

Should look like: Должен выглядеть так:

AddHandler cgi-script .cgi .pl AddHandler подобную сценарий. Cgi. Pl
or или
AddHandler cgi-script .pl AddHandler подобную сценарий. Pl
or или
AddHandler cgi-script .cgi AddHandler подобную сценарий. Cgi

Save the httpd.conf configuration file, restart the Apache server. Сохраните файл конфигурации httpd.conf, перезапустить сервер Apache. Test the configuration as described in Testing Your Web Server CGI Configuration at the end of this article. Проверка конфигурации, как описано в тестировании веб-сервере CGI конфигурацию в конце этой статьи.

Optional: Enabling CGI in Any Directory Дополнительно: Включение CGI в любом каталоге

If you want to use CGI outside ScriptAliased directory (ScriptAlias is usually the Apache2/cgi-bin/), comment out the following line: Если вы хотите использовать CGI вне ScriptAliased каталог (ScriptAlias обычно Apache2/cgi-bin /), раскомментируйте следующую строку:

ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” ScriptAlias / подобную бен / "C: / Program Files / Apache Group/Apache2/cgi-bin /"

Should look like: Должен выглядеть так:

#ScriptAlias /cgi-bin/ “C:/Program Files/Apache Group/Apache2/cgi-bin/” # ScriptAlias / подобную бен / "C: / Program Files / Apache Group/Apache2/cgi-bin /"

Alternatively, if you want to specify just one directory to put all your cgi programs, change the path instead, but makes ure that directory exists. Или же, если вы хотите указать только один каталог, чтобы поставить все ваши cgi программы, изменять путь вместо этого, но делает ure этот каталог не существует.

Should look like (for default settings): Будет выглядеть следующим образом (по умолчанию):

ScriptAlias /cgi-bin/ “your_prefer_cgi-bin_direcotry” ScriptAlias / подобную бен / "your_prefer_cgi-bin_direcotry"

Save the httpd.conf file. Сохраните файл httpd.conf. Restart the Apache server. Перезапустите Apache сервера.

Finding Perl Executable Location Нахождение Perl исполняемый Расположение

If you don’t know where is perl.exe installed to, go to Start -> Search and search for perl.exe. Если вы не знаете, где находится perl.exe установлен для перейдите на Пуск -> Найти и ищу perl.exe. This location is the path to the perl executable that has to be put on the top of all cgi scripts. Это расположение путь к исполняемого perl, который должен быть поставлен на вершине все cgi скрипты. If you follow default installation procedure, the path should be C:/perl/bin/perl.exe Если после выполнения процедуры установки по умолчанию, путь должен быть C: / perl / бен / perl.exe

For the path to perl.exe path, all of these format are valid: Для путь к perl.exe путь, все эти формы являются действительными:
#!c:/perl/bin/perl.exe #! с: / perl / бен / perl.exe
#!c:/perl/bin/perl #! с: / perl / бен / perl
#!/perl/bin/perl.exe #! / perl / бен / perl.exe
#!/perl/bin/perl #! / perl / бен / perl

Testing Your Web Server CGI Configuration Тестирование вашего веб-сервера CGI конфигурации

Save the following test script in your DocumentRoot directory (if you have uncomment ScriptAlias, you can put it anywhere inside your DocumentRoot directory, or if you have set ScriptAlias to some particular directory, put the cgi in that directory only, ie Apache2/cgi-bin) as test.pl or test.cgi (depending on your configuration of the AddHandler line) and modify the first line as required to point to your ActivePerl interpreter: Сохранить следующий тест скрипт в вашем DocumentRoot директорию (если у вас есть раскомментировать ScriptAlias, вы можете поместить ее в любом месте на территории вашей DocumentRoot каталога, или если у вас есть набор ScriptAlias к определенной директории, ставит cgi в этом каталоге, только, т.е. Apache2/cgi- бин), как test.pl test.cgi или (в зависимости от конфигурации AddHandler линия) и изменить первую строку как это требуется, чтобы она указывала на Ваш ActivePerl переводчика:

#!c:\perl\bin\perl.exe #! с: \ perl \ бин \ perl.exe
# ^^^ this must be the first line of the script! # ^ ^ ^ Это должно быть первой строке скрипта! ^^^ ^ ^ ^
# start code # Начало кода

use strict; использование строгой;
use CGI; использование CGI;
my $q = new CGI; моя $ q = новый CGI;

# print header and start the markup output # Напечатать заголовок и начните разметки выходной

print $q->header( “text/html” ),$q->start_html( “hello from perl cgi!” ); распечатать $ q-> заголовок ( "текст / html"), $ q-> start_html ( "привет из perl cgi!");
print $q->h2(”hello dave…”); распечатать $ q-> h2 ( "привет dave…");
print $q->end_html; распечатать $ q-> end_html;
# end code # Конец кода

Now go to Теперь переходим к http://localhost/cgi-bin/test.cgi (scripts in Apache2/cgi-bin/ are read as http://localhost/cgi-bin/ by default). (скрипты в Apache2/cgi-bin / читаются как http://localhost/cgi-bin/ по умолчанию). You should see a page that displays a level two heading with the following text: Вы должны увидеть страницу, которая отображает два уровня с заголовком следующий текст:

hello dave привет dave

If you see the above message, CGI is running. Если вы видите выше сообщение, CGI выполняется. If you get a 500 error, go to the last entry in your Apache2/logs/error.log (or the Review Error Log in the Start menu) to see exactly what caused this error. Если вы получите 500 ошибку, перейдите к последней записи в вашем Apache2/logs/error.log (или Обзор Ошибка Войдите в меню "Пуск"), чтобы посмотреть именно то, что в результате этой ошибки.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. ВАЖНО: Это машина переведена страница, на которой предоставляется "как есть" без гарантий. Machine translation may be difficult to understand. Машинный перевод может быть трудным для понимания. Please refer to Обратитесь к original English article Английский оригинал статьи whenever possible. когда это возможно.

Share and contribute or get technical support and help at Доля и вклад или получить техническую поддержку и помощь в My Digital Life Forums Моя Цифровая жизнь форумах .



6 Responses to “Install, Setup and Configure CGI and Perl in Windows XP” 6 Ответы на "Установка, настройка и конфигурирование CGI и Perl в Windows XP"

  1. Install AWStats- Free Logfile Analyzer for Site Statistics » My Digital Life Установить AWStats-Free анализатор лог-файл для сайта Статистика »Моя Цифровая жизнь
    January 2nd, 2006 02:19 2 января 2006 года 02:19
    1

    [...] As AWStats is Perl based, a Perl Interpreter need to be installed first to take anvantage of AWStats. [...] Как AWStats является Perl основе, Интерпретатор Perl должны быть установлены первые принять anvantage из AWStats. For instruction on how to install Perl in Windows machine, check out this article. В инструкции по установке Perl в Windows машины, ознакомьтесь с этой статьей. [...]

  2. Besart
    July 25th, 2006 20:53 25 июля 2006 20:53
    2

    I have installed cgi and configured apache as you said, but i got this erro: Я установил cgi apache и настроен, как вы сказали, но я получил эту erro:

    Internal Server Error Внутренняя ошибка сервера
    The server encountered an internal error or misconfiguration and was unable to complete your request. Сервер сталкиваются внутренние ошибки или неправильной и не смог завершить свой запрос.

    Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. Обратитесь к администратору сервера, веб-мастер @ lokalny_host и информировать их о времени произошла ошибка, и все, что вы могли бы сделать, что может быть причиной ошибки.

    More information about this error may be available in the server error log. Подробнее об этой ошибке могут быть доступны в лог ошибок сервера.

    ——————————————————————————– ---------------------------

    Apache/2.0.58 (Win32) PHP/5.1.4 Server at localhost Port 80 Apache/2.0.58 (Win32) PHP/5.1.4 Server на локальный порт 80

  3. jack джек
    May 10th, 2007 19:25 10 мая 2007 19:25
    3

    Cool4you,guys. Cool4you, ребята.

  4. Mitchell Митчелл
    June 20th, 2007 08:09 20 июня 2007 08:09
    4

    Just for the record, the above test script throws a 500 error when used as is. Просто для записи, выше тестового скрипта броски 500 ошибку, когда используются как есть. Maybe it is just a problem with firefox displaying text or something, but the quotation marks are mixed up, so that could lead to problems Может быть, это просто проблема с firefox отображения текста или что-нибудь, но кавычки являются перепутали, так что может привести к возникновению проблем :)

  5. Johanna
    October 8th, 2007 23:05 8 октября 2007 23:05
    5

    Hi all, Привет всем,

    I really need some help on this subject =) Я действительно нужна помощь по данному вопросу =)

    I have followed the steps above, and changed the quotation marks, and what I get is 9 error messages: Я следовал описанные выше, и изменила кавычках, а что я получаю составляет 9 сообщений об ошибке:

    Backslash found where operator expected at Z.\test.cgi line 1, near “rtf1\” Найти обратную косую черту, где оператор ожидается на З. \ test.cgi линии 1, возле "rtf1 \"
    or …. или…. , near “ansi\” , Возле "ansi \"
    or …. или…. , near “deff0″ , Возле "deff0"
    or …. или…. , near “f1\” , Возле "f1 \"
    etc.. т.д..

    I am a total rookie with these things, any help appreciated =) Я в общей сложности с rookie эти вещи, любая помощь оценили =)

    Thanks, Спасибо,

    Johanna

  6. Munir Мунир
    November 28th, 2007 22:14 28 ноября 2007 22:14
    6

    I did everything you said. Я сделал все, что вам сказал. But cgi is still not running. Но cgi-прежнему не работает. Please help. Пожалуйста, помогите.
    my apache is 2.2 моя apache составляет 2,2

Leave a Reply Оставь Ответить

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Вы можете использовать эти теги: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <-дель-datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Подписка без комментариев


Custom Search

New Articles Новые статьи

Incoming Search Terms for the Article Входящий Условия поиска для статьи

download perl.exe скачать perl.exe - -- install perl on windows xp perl установить на окнах xp - -- Perl.exe download Perl.exe скачать - -- perl.exe perl.exe - -- apache2 enable cgi apache2, чтобы cgi - -- perl apache2 perl apache2 - -- perl for windows XP perl для окон XP - -- perl vista perl достопримечательность - -- enable cgi apache2 чтобы cgi apache2 - -- install perl on vista установить perl на достопримечательность - -- how to install perl on windows XP как установить perl на окнах XP - -- configure perl настроить perl - -- perl setup download perl настройка скачать - -- install perl xp установить perl xp - -- download perl for windows xp скачать perl для окон xp - -- PERL for windows vista PERL для окон достопримечательность - -- perl download for windows xp perl скачать для окон xp - -- XAMPP Perl CGI XAMPP Perl CGI - -- xampp path to perl xampp путь к интерпретатору Перл - -- download perl setup скачать perl установка - -- perl windows vista perl окна достопримечательность - -- install perl vista установить perl достопримечательность - -- xampp perl path xampp perl путь - -- free download perl.exe скачать бесплатно perl.exe - -- perl download xp perl скачать xp - -- apache2 perl apache2 perl - -- apache2 cgi enable apache2 cgi позволит - -- configure cgi настроить cgi - -- how to configure perl как настроить perl - -- free download perl interpreter скачать бесплатно perl интерпретатор - -- INSTALL PERL FOR WINDOWS XP Установки PERL для ОС Windows XP - -- apache2 configure cgi apache2 настроить cgi - -- Perl interpreter for windows XP Интерпретатор Perl для окон XP - -- all все - -- how to install perl on vista как установить perl на достопримечательность - -- perl interpreter free download perl интерпретатор скачать бесплатно - -- perl for xp perl для xp - -- install perl windows xp perl установки окон xp - -- perl interpreter vista perl интерпретатор достопримечательность - -- windows xp cgi окна xp cgi - -- how to install perl in windows xp как установить Перл на окнах xp - -- perl download for xp perl скачать для xp - -- apache perl configuration apache perl конфигурации - -- perl.exe free download perl.exe скачать бесплатно - -- install perl on xp установите на perl xp - -- how to configure cgi как настроить cgi - -- perl exe download perl exe скачать - -- perl setup perl настройка - -- enable cgi in apache2 cgi, чтобы в apache2 - -- apache2 allow cgi apache2 разрешить cgi - -- Free Download Perl for Windows XP Бесплатно скачать Perl для Windows XP - -- perl interpreter for vista perl интерпретатор для достопримечательность - -- perl for windows XP download perl для окон XP скачать - -- apache2 perl setup apache2 perl настройка - -- apache2 configure perl apache2 настроить perl - -- how to install perl on windows vista как установить perl на окнах достопримечательность - -- Perl Windows XP Perl Windows XP - -- perl setup for windows perl установки для производства окон - -- perl windows configuration perl конфигурации окон - -- download perl exe скачать perl exe - -- download perl Windows XP perl загрузить Windows XP - -- configure perl apache2 настроить perl apache2 - -- enable cgi on apache cgi, чтобы на apache - -- xampp perl configure xampp настроить perl - -- free perl download for Windows XP perl бесплатно скачать для Windows XP - -- "perl for vista" "perl для достопримечательность" - -- how to install perl on xp как установить perl на xp - -- perl windows install perl установка окон - -- How to Configure Perl in Windows Как настроить Perl в Windows - -- xampp enable cgi xampp чтобы cgi - -- apache2 cgi configuration apache2 cgi конфигурации - -- perl download windows xp perl скачать окна xp - -- perl configure настроить perl - -- perl interpreter windows vista perl интерпретатор окна достопримечательность - -- configure cgi apache2 настроить cgi apache2 - --