DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone >

FastCGI Test Script

Snippets Manager user avatar by
Snippets Manager
·
May. 15, 05 · · Code Snippet
Like (0)
Save
Tweet
2.60K Views

Join the DZone community and get the full member experience.

Join For Free
If you're having trouble with FastCGI (as I was), this Perl script can help you see if the problem is at the Apache end or the app end. In my case I'd simply not deleted the old Ruby sessions for my Rails app when switching from CGI to FCGI ;-) This script proved my Apache wasn't broken, at least.

#!/usr/bin/perl

use FCGI;

$cnt = 0;

while (FCGI::accept() >= 0)
{
   print ("Content-type: text/html\r\n\r\n");
   print ("\nFastCGI Demo Page (perl)\n\n");
   print  ("

FastCGI Demo Page (perl)

\n"); print ("This is coming from a FastCGI server.\n
\n"); print ("Running on $ENV{USER} to $ENV{REMOTE_HOST}\n
\n"); $cnt++; print ("This is connection number $cnt\n"); }
Test script Testing

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • On Some Aspects of Big Data Processing in Apache Spark, Part 1: Serialization
  • Apache Kafka in Crypto and Finserv for Cybersecurity and Fraud Detection
  • What You Need to Know to Debug a Preempted Pod on Kubernetes
  • Data Software Design Pitfalls on Java: Should We Have a Constructor on JPA?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo