Selection and construction of Web server under Windows

Source: Internet
Author: User
Tags perl interpreter install perl

This article is based primarily on the selection of Web servers that support Perl.

has been based on web development, the server is Linux under the use of webmin built, ashamed to say, so many years, also studied the Web server, single from this angle, is not able to reflect the Webmin architecture and our product build is still OK, So that the big guys will concentrate more energy on their own products, rather than spending a lot of time on some already mature technology, if every product is done with this idea, then this society will have less duplication of labor, and more efficient output, pull away, Come back and continue to build Web servers under Windows.

A long time ago, Windows included A simple program called Personal Web Server (PWS) which provided an easy little we Bserverto use with Perl. With the release of Windows ME and XP, PWS is discontinued and replaced with the Internet information Server, known as IIS. Last time I tried, which I freely admit is quite a while ago now, configuring IIS for use with Perl is not so easy. There is simpler ways of doing it.

If You just want a simple webserver-to-test with, I recommend a different webserver than IIS. This webserver are free, and are well documented. You can find it at Aprelium. Look for the Abyss Web Server X1. It works very well and was much easier to set up than IIS. The exact configuration details is spelled out of the documentation for the X1 server so I won ' t repeat them here. But I'm think you'll find it's pretty easy-to-install and set up.

If you want something more configurable and powerful, you can ' t go wrong with the Apache webserver, which is available for Windows just as readily as for Linux. Again, the exact configuration details is provided here, and since there is Apache documentation for this. However, if enough users ask for explicit instructions to is included here, the start asking by email, and I'll add them in.

1 PWS (perlwerbserver)

After 2000 is no longer maintained and used, the use of method reference documents less, the initial test found under Windows use, the service will often stop. It is not recommended.

Install Web server:https://www.gossland.com/perlcourse/default/install_pws.html

Perlwebserver by year:http://perlwebserver.sourceforge.net/

2 Aprelium

Download Abyss Web Server X1 free version, try to install, error, failed to install successfully, it seems that the free version error handling and redundancy did not do too well, did not make more attempts.

aprelium:http://www.aprelium.com/

3 Apache-based Web server

Today, the mainstream Web server software is primarily made up of IIS or Apache. IIS supports ASP and only runs under the Windows platform, Apache supports php,cgi,jsp and can run on many platforms, although Apache is the world's top-ranked Web server platform, but it is well known that Windows is famous for its ease of use. And therefore occupy a lot of server market. This topic we divide the Web server into Windows platforms and Linux platforms (including various Unix).

Simple process

1. Install Apache Web server

2. Run the first Apache Web page

Turn on services, manage services, and run Apache.

After the service is turned on, accessing the 127.0.0.1,apache server via the browser will default to the default existing index.html under the Htdocs directory of the installation directory.

3. Install Perl Interpreter

4. Configure Apache to allow the CGI page to open

Config file directory, conf directory under installation directory, modify httpd.conf file, DirectoryIndex index.html index.cgi (join index.cgi)

5. Run the first CGI page

Place the program in the Cgi-bin directory of the Apache installation directory and access the http://127.0.0.1/cgi-bin/index.cgi via the web.

index. CGI: # !c:/perl/bin/perl (Installation directory for Perl)  Use CGI QW (: Standard);  Use  print  header; Print " <b>it works! Hello world</b> ";

6. Use template mode to separate HTML from CGI

Index.CGI:#!c:/perl/bin/perl UseStrict;Print "content-type:text/html\n\n";Print&template (".. /htdocs/index.html"); Subtemplate{my $file; my $HTML; $file=$_[0] || die "template:no Template file specified.\n"; Open(FILE,"< $file") || die "template:couldn ' t open $file: $!\n";  while(<FILE>) {$HTML.=$_; } Close(FILE); #The following two statements implement the same functionality  $HTML=~ s/(\$\w+)/Eval " $"/GE; #$HTML =~ s/\$ (\w+)/${$1}/g;  return $HTML;}

Reference documents

Web Server Setup:

http://school.cfan.com.cn/zhuanti/webserver/

Apache Web Server Build:

http://carywu.blog.51cto.com/13185/9551

Apache-based Perl implements dynamic pages:

Http://www.oschina.net/question/17_71

CGI mates with HTML templates using:

http://www.linuxfly.org/post/335/

Selection and construction of Web server under Windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.