Customer center

We are a boutique essay service, not a mass production custom writing factory. Let us create a perfect paper for you today!

Example research essay topic: Httpd Logs Httpd Pid' Httpd Logs Httpd Fastcgi - 2,235 words

NOTE: Free essay sample provided on this page should be used for references or sample purposes only. The sample essay is available to anyone, so any direct quoting without mentioning the source will be considered plagiarism by schools, colleges and universities that use plagiarism detection software. To get a completely brand-new, plagiarism-free essay, please use our essay writing service.
One click instant price quote

... t CGI with Perl and Tcl You can run Perl- and Tcl-interpreted programs under FastCGI. In order to run them, you " ll have to compile a specially modified version of the interpreter that has been modified to work with FastCGI. You will not, however, need to maintain both a regular and a special version of the interpreter. The special version will work as expected when used under a normal context. Future versions of Perl and Tcl will incorporate changes that will make it possible to use unmodified versions of the program with FastCGI.

Patches for both Perl and Tcl are available. Some prebuilt binaries are also available at web Installing and Configuring FastCGI To build and run FastCGI applications, you " ll need to have two different pieces of software: the FastCGI module for Apache and the FastCGI Developer's Kit. Both the toolkit and the Apache module are included in the CD-ROM that accompanies this book; however, you should make sure that they are still current. At the time of this writing, the Apache module was still based on a beta version of 1. 1. The latest and greatest versions of the module and developer's kit are available at the FastCGI Web sites: web and web respectively. The version of the toolkit included on the CD-ROM is 1. 5.

Incorporating FastCGI Functionality into Apache To add the FastCGI module to Apache is simple. Copy apache-fastcgi / src /mod fastcgi. c to the Apache source directory (/usr / local /etc / httpd /src). Then you need to add an entry for the module in Apache's src/Configuration file. Add the following line at the end of the Module listings: You " ll need to run Apache's configuration program, src/Configure, and rebuild the Apache by issuing a make command while focused on the Apache src directory.

While Apache builds, you can add the following configuration directives to your servers conf / srm . conf configuration file: Add Type application / x -httpd-fri. fri Alias /fri-bin/ /usr / local /etc / httpd /fri-bin Create the fri-bin directory, while in /usr / local /etc / httpd : As you may be able to guess by now, FastCGI applications should be run from a directory other than the cgi-bin directory. After Apache builds, issue the following commands: % kill -HUP 'cat /usr / local /etc / httpd /logs / httpd . pid' This will restart the server and force rereading of the new configuration directives you just added. Watch for any error messages.

If you get an error, more than likely one of the directives you added is If the restart of the server proceeded without problems, congratulations your sever is now ready to run FastCGI programs. cgi-fri An alternative way of implementing FastCGI on Apache, or any other server, is to use the cgi-fri program. cgi-fri is a standard CGI program that uses TCP/IP sockets to communicate with FastCGI applications. cgi-fri takes the pathname or host / port name as a parameter and connects to the FastCGI application listening on that TCP port.

cgi-fri then forwards the environment variables and stdin to the FastCGI application and returns to the server the stdout and stderr streams. When the FastCGI application ends the connection, cgi-fri flushes and exits. Although this is not as efficient as a module imbedded into the server because the cgi-fri program gets forked with every request, it is much better than not having it. For example, if your Perl FastCGI program takes 1 second to compile and 2 seconds to connect to a database, you " ll still have significant savings over forking Perl and recompiling the program with each request. cgi-fri is a tiny program when compared to Perl and many other programs. Building the FastCGI Developer's Kit To build the developer's kit, you " ll need to configure it.

The folks at Open Market have provided a nice script that automates the configuration process to run it. Just type. /configure while focused inside the fri-devel-kit directory. After a few moments you should be able to type make and have the libraries built. You will need this kit to build FastCGI-savvy interpreters or C programs. After you build the kit, you may be interested in installing the library libffi / libffi . a to some place useful such as /usr / local /lib.

Remember to do a ranlib on the library after you move it to refresh it. While you " re at it, you may want to copy the include directory to /usr / local /include / fri . That way it will be easier for you to reference it while building your own programs. After the kit is built, you may want to try your luck at building the sample HelloWorld. c program listed earlier. Note that you may need to change the location of the fri stdio.

h header file to reflect its new To build the FastCGI program, issue the following commands: cc -o Hello. fri -luigi HelloWorld. c Put the resulting Hello. fri on your fri-bin directory. Before you can access it, you " ll need to add an App Class entry into your srm. conf: App Class /usr / local /etc / httpd /fri-bin/Hello.

fri % kill -HUP 'cat /usr / local /etc / httpd /logs / httpd . pid' The App Class directive takes care of starting and maintaining the FastCGI application. At this point you should be able to access it by pointing your browser to http: //localhost / fri -bin/Hello. fri. You should get a similar result to those displayed in Figure C. 2. Figure C. 2.

The FastCGI version of Hello World! . Notice that it keeps state. My version is fancier than the HelloWorld listing. Making Perl Fly You will notice an even bigger improvement on Perl Cgi's.

This is because FastCGI will keep the Perl program running; the interpreter won't have to fork, exec, compile, and execute for each request. A Before you can incorporate FastCGI into your Perl programs, you have to build a special version of Perl. The FastCGI Developer's Kit contains the patches you " ll need to build a version of Perl that supports FastCGI. After you build this version, there's no need to keep your old Perl around. A FastCGI-savvy Perl binary will work just fine with regular Perl scripts. Future versions of Perl may have support for FastCGI right out of the box.

Currently there's an active discussion on the perl 5 -porters mailing list regarding the issues that need to change in Perl's implementation to support FastCGI as a true Perl module that is, requiring no recompiling. The Tcl 7. 5 FastCGI module, when it makes its debut, won't require a rebuilt of Tcl. The new Python module also At the time of this writing, the patches available for FastCGI were for version 5. 002 of Perl. By the time you read this, they will be updated to the current Perl version, 5. 003. The patch process is simple; you just replace a few files in the standard Perl distribution with files provided in the kit. Here's the process: 1. 1.

Put the un archived Perl and fri-devel-kit on a directory side by side and issue the following commands: % cp -r... /fri-devel-kit / perl - 5 /perl 5. 002 / % cp -r... /fri-devel-kit / perl - 5 /common/ 2. 2. Set the environment variable FCGIDIR to the absolute path of the fri-devel-kit. In my case, the distribution was in the /tmp / fri Perl directory. This variable will tell the configuration program where setenv FCGIDIR /tmp / fri Perl / fri -devel-kit 3. 3. If you don't use gcc, set the environment variable CC to the name of your compiler: 4. 4. If you want to install the Perl distribution somewhere other than /usr / local /bin, define the environment variable PERL PREFIX.

I kept the default setting. 5. 5. Execute the fri-configure script: The fri-configure script is a wrapper that automatically sets some of the configure variables without requiring user input. If this fails, you " ll have to run the Configure command in the Perl directory. You may want to take a look at the documentation that came with the FastCGI Developer's Kit for any tips to solve the problem. 6. 6. Do a make to build the software: If it all goes smoothly, you can finish the installation with a make install, which will install Perl to the location specified. That's it for the install!

Make sure your scripts reference the correct version of Perl. Perl FastCGI Programs The modified version of my HelloWorld. c looks like this: print "Content-type: text / plain "; H 1 Hello, this is a FastCGI program! /H 1 P I can tell that you are visiting from $ENV{REMOTE HOST} /P P This page has been accessed: ++$times Visited /P As you can see, this is pretty much the same organization as the C program. The one gotcha with Perl is that if the initial environment to a FastCGI Perl application is empty when the first call to FCGI: : accept returns, the environment will still be empty. The easiest workaround is to add an environment with the App Class -initial-env directive. See the section entitled, "The App Class Directive, " for more detailed The mod fastcgi Module The FastCGI module provides Apache compatibility to FastCGI applications.

This module is not part of the standard Apache release, so you " ll have obtain a copy from web A copy of the latest version at the time this was written, August 1996, is included on the CD-ROM. This module processes any file with a MIME-type application / x -httpd-fri. Because the Script Alias directive may have higher priority over Add Type, FastCGI applications should not reside on the cgi-bin directory; if they do, they may be processed by the mod cgi module regardless of the extension given. This means that the application / x -httpd-fri MIME type is given to files that do not reside in the Script Alias directory and that have a name using the extension defined by the Add Type application / x -httpd-cgi directive. Typically this will be. fri.

The reason for this is that Apache assigns priority to the directives based on the order of compilation in the modules. The App Class Directive App Class executable Path [-processes p] [-listen-queue-Depth q] [-restart-delay secs] [-priority N] [-initial-env key = value] App Class executable Path [-processes 1 ] [-listen-queue-Depth 5 ] [-restart-delay 5 ] [-priority sameAsHTTP] The App Class directive, provided by mod fastcgi, is responsible for starting up one or more FastCGI application processes using the executable specified by executable Path. When a request for the file specified by executable Path is received, the request is handled by the mod fastcgi module, which connects the request to the appropriate process belonging to the proper In addition to starting the process, the server will ensure that a process for handling a particular App Class will be available. Should a process exit because of an error or some other condition, the server will launch another process capable of handling the requests. App Class has several other options: Specifies the number of FastCGI processes that the server will spawn. Default value for this setting is 1.

Sets the depth of the listen queue that is shared by the processes. The listen queue stores additional requests that may be received while the FastCGI application is processing another. Requests will queue until they reach the limit imposed by listen-queue-depth. Additional requests beyond the size of the queue are responded with an error to the client. Default value is 5.

Specifies the number of seconds the server will wait before restarting a dead FastCGI process. The server won't restart a process more often than the time specified by this flag. The default value is 5 seconds. This flag specifies the execution priority of the FastCGI process. The default priority is inherited from the parent httpd server process. This flag allows you to specify the initial environment sent to a FastCGI program when the program initializes.

You can specify multiple initial-env flags, one per key = value pair. If not specified, the initial environment is empty. It would be very useful to provide the FastCGI application with information during its initialization phase. Example If you wanted to start the HelloWorld. fri program, you would need to type this: App Class /usr / local /etc / httpd /fri-bin/HelloWorld.

fri -processes 2 For a Perl program, to circumvent the environment problem, you would have to do this: App Class /usr / local /etc / httpd /fri-bin/HelloWorld. fri -processes 2 -initial- env: DB PATH NAME = /proj / accts /db 2 Summary Although FastCGI is not the sole alternative for high performance CGI alternatives, the features and price cannot be beat. It's especially interesting that existing code can be ported easily without a real learning curve. This alone makes it very attractive for programmers who have a backlog and don't have much time to spend experimenting with new tools, yet need to implement a high-performance CGI solution.

FastCGI is a great choice the learning-and-setup curve is hours, not days like other environments. Performance Enhancement What a FastCGI Application Looks Like FastCGI with Perl and Tcl Installing and Configuring FastCGI Incorporating FastCGI Functionality into Apache Building the FastCGI Developer's Kit Perl FastCGI Programs Bibliography:


Free research essays on topics related to: apache, perl, module, cgi, kit

Research essay sample on Httpd Logs Httpd Pid Httpd Logs Httpd Fastcgi

Writing service prices per page

  • $18.85 - in 14 days
  • $19.95 - in 3 days
  • $23.95 - within 48 hours
  • $26.95 - within 24 hours
  • $29.95 - within 12 hours
  • $34.95 - within 6 hours
  • $39.95 - within 3 hours
  • Calculate total price

Our guarantee

  • 100% money back guarantee
  • plagiarism-free authentic works
  • completely confidential service
  • timely revisions until completely satisfied
  • 24/7 customer support
  • payments protected by PayPal

Secure payment

With EssayChief you get

  • Strict plagiarism detection regulations
  • 300+ words per page
  • Times New Roman font 12 pts, double-spaced
  • FREE abstract, outline, bibliography
  • Money back guarantee for missed deadline
  • Round-the-clock customer support
  • Complete anonymity of all our clients
  • Custom essays
  • Writing service

EssayChief can handle your

  • essays, term papers
  • book and movie reports
  • Power Point presentations
  • annotated bibliographies
  • theses, dissertations
  • exam preparations
  • editing and proofreading of your texts
  • academic ghostwriting of any kind

Free essay samples

Browse essays by topic:

Stay with EssayChief! We offer 10% discount to all our return customers. Once you place your order you will receive an email with the password. You can use this password for unlimited period and you can share it with your friends!

Academic ghostwriting

About us

© 2002-2024 EssayChief.com