Book description
Visually explore the range of built-in and third-party libraries of Perl and Apache
Perl and Apache have been providing Common Gateway Interface (CGI) access to Web sites for 20 years and are constantly evolving to support the ever-changing demands of Internet users. With this book, you will heighten your knowledge and see how to usePerl and Apache to develop dynamic Web sites.
Beginning with a clear, step-by-step explanation of how to install Perl and Apache on both Windows and Linux servers, you then move on to configuring each to securely provide CGI Services. CGI developer and author Adam McDaniel shows techniques for effectively developing and maintaining dynamic sites and he shares real-world examples describing MySQL database access, PayPal credit-card transactions, and sample Facebook and Twitter interfaces.
Apache and Perl have been providing Common Gateway Interface (CGI) access to Internet Web sites for more than two decades, and both products are constantly evolving to support today's user requirements
Shows how to install Perl and Apache on Windows and Linux servers and configure each to securely provide CGI services
Details techniques for effectively developing and maintaining dynamic Web sites
Addresses MySQL database access and PayPal credit-card transactions, and examines sample Facebook and Twitter interfaces
With this book, you'll benefit from a wealth of techniques and resources that you won't find anywhere else.
Table of contents
- Copyright
- Credits
- About the Author
- Author's Acknowledgments
- How to Use This Book
-
1. INTRODUCING PERL AND APACHE WEB SITE DEVELOPMENT
- 1.1. Introducing Apache and Perl
- 1.2. Introducing the Common Gateway Interface
- 1.3. Understanding CGI from the End-User's Point of View
- 1.4. Understanding CGI from the Web Browser's Point of View
- 1.5. Understanding CGI from the Web Server's Point of View
- 1.6. Understanding CGI from the CGI Program's Point of View
- 1.7. Compare Perl to Other CGI Languages
- 1.8. Compare Apache to Other Web Servers
- 1.9. Developing Your Web Site
- 1.10. Find Perl- and Apache-Friendly Hosting Providers
- 1.11. Find Help Developing CGI Programs
- 2. INSTALLING PERL ON WINDOWS
- 3. INSTALLING PERL ON LINUX
- 4. INSTALLING APACHE ON WINDOWS
- 5. INSTALLING APACHE ON LINUX
-
6. INTRODUCING THE FUNDAMENTALS OF PERL
- 6.1. Understanding Perl Syntax
- 6.2. Understanding the Anatomy of a Perl Script
- 6.3. Create a New Perl Script
- 6.4. Print Output to the Screen
- 6.5. Execute a Perl Script
- 6.6. Introducing Perl Scalars
- 6.7. Store Data into Scalars
- 6.8. Retrieve Data from Scalars
- 6.9. Introducing Perl Arrays
- 6.10. Store Data into Arrays
- 6.11. Retrieve Data from Arrays
- 6.12. Introducing Perl Hashes
- 6.13. Store Data into Hashes
- 6.14. Retrieve Data from Hashes
-
7. BUILDING AN INTERACTIVE PERL SCRIPT
- 7.1. Introducing Perl Conditions
- 7.2. Introducing Perl Operators
- 7.3. Control Program Flow with if, elsif, else
- 7.4. Introducing Perl Loops
- 7.5. Loop Program Flow with foreach, while
- 7.6. Introducing Perl Subroutines
- 7.7. Organize Program Code with Subroutines
- 7.8. Manipulate Variables in Subroutines
- 8. USING PERL REFERENCES AND MODULES
-
9. INSTALLING THIRD-PARTY PERL MODULES
- 9.1. Introducing CPAN
- 9.2. Configure CPAN
- 9.3. Search for Perl Modules with CPAN
- 9.4. Install Perl Modules with CPAN
- 9.5. Introducing ActivePerl Perl Package Manager
- 9.6. Configure ActivePerl PPM
- 9.7. Search for Perl Modules with ActivePerl PPM
- 9.8. Install Perl Modules with ActivePerl PPM
- 9.9. Search for Perl Modules in Debian/Ubuntu Linux
- 9.10. Install Perl Modules in Debian/Ubuntu Linux
- 9.11. Search for Perl Modules in Red Hat Linux
- 9.12. Install Perl Modules in Red Hat Linux
- 9.13. Search for and Download Perl Modules Manually
- 9.14. Build and Install Perl Modules Manually
-
10. CONFIGURING APACHE TO EXECUTE PERL
- 10.1. Introducing the Apache CGI Handler
- 10.2. Create a User Directory for Apache in Windows
- 10.3. Create a User Directory for Apache in Linux
- 10.4. Enable the Apache CGI Module and Handler
- 10.5. Configure a Directory to Use the CGI Handler
- 10.6. Understanding the Apache Logs
- 10.7. Configure the Apache Logs
- 10.8. Read the Apache Logs
- 10.9. Forward Perl Activity into the Apache Logs
- 11. INTRODUCING DO-IT-YOURSELF PERL/CGI INTERACTION
-
12. USING PERL'S BUILT-IN CGI LIBRARY
- 12.1. Introducing the Built-In CGI Library
- 12.2. Import the CGI Library as an Object
- 12.3. Import the CGI Library's Routines as Functions
- 12.4. Read HTTP GET/POST Parameters with the CGI Library
- 12.5. Store HTTP Cookies with the CGI Library
- 12.6. Retrieve HTTP Cookies with the CGI Library
- 12.7. Return Useful Error Messages with CGI::Carp
-
13. SEPARATING HTML CODE FROM PERL CODE
- 13.1. Understanding the Benefits of Separating HTML from Perl
- 13.2. Introducing the Perl HTML::Template Module
- 13.3. Understanding the Structure of an HTML::Template File
- 13.4. Create a New Template File
- 13.5. Import the HTML::Template Module
- 13.6. Display Data with TMPL_VAR
- 13.7. Control Template Content with TMPL_IF, TMPL_ELSE
- 13.8. Repeat Template Content with TMPL_LOOP
- 13.9. Nest Templates with TMPL_INCLUDE
- 13.10. Create an HTML::Template Header and Footer
- 13.11. Create an HTML::Template Toolbar
- 13.12. Link the Header, Toolbar, and Footer with Dynamic Perl Content
- 13.13. Extend HTML::Template to Non-HTML Formats
-
14. ADDING DYNAMIC CONTENT WITH SERVER-SIDE INCLUDES (SSI)
- 14.1. Introducing Server-Side Includes
- 14.2. Enable the Apache SSI Module and Output Filter
- 14.3. Configure a Directory to Use SSI
- 14.4. Understanding SSI Elements
- 14.5. Import Files with SSI
- 14.6. Execute Programs with SSI
- 14.7. Set Variables within SSI
- 14.8. Retrieve Variables with SSI
- 14.9. Use Conditional Expressions with SSI
- 14.10. Display File Statistics with SSI
- 14.11. Link the Header, Toolbar, and Footer with Static HTML Content
-
15. AUTHENTICATING A USER SESSION
- 15.1. Understanding Apache User Authentication
- 15.2. Secure a Directory Path with Apache
- 15.3. Use an Authentication Password File
- 15.4. Require Only Authorized Users
- 15.5. Understanding User Authentication in Perl
- 15.6. Create a Perl Authentication Module
- 15.7. Access a User's Database
- 15.8. Store User Credentials in a User's Database
- 15.9. Check for Session Authorization (Step 1)
- 15.10. Display a Login Prompt (Step 2)
- 15.11. Validate a User's Credentials (Step 3)
- 15.12. Authorize a User's Session (Step 4)
- 15.13. Restrict Access to a CGI Script
- 15.14. Terminate a User Session
- 16. INTERFACING YOUR WEB SITE WITH FACEBOOK
-
17. INTERFACING WITH THE TWITTER API USING PERL
- 17.1. Introducing the Twitter APIs
- 17.2. Introducing the Perl Twitter Modules
- 17.3. Register a New Twitter Application
- 17.4. Authenticate to Twitter Using OAuth
- 17.5. Create a MyTwitter Perl Module That Inherits Net::Twitter
- 17.6. Post a Twitter Status Update
- 17.7. Retrieve a Twitter Timeline
- 17.8. Retrieve a List of Twitter Users You Follow
- 17.9. Retrieve a List of Twitter Followers
- 17.10. Search for Content Using the Twitter Search API
- 17.11. Use the Twitter @Anywhere JavaScript API
- 17.12. Follow Real-Time Activity with the Twitter Streaming API
-
18. CREATING DYNAMIC IMAGES WITH PERL
- 18.1. Accept a File for Upload
- 18.2. Open an Image with Image::Magick
- 18.3. Resize or Crop an Image with Image::Magick
- 18.4. Manipulate an Image with Image::Magick
- 18.5. Save an Image to Disk
- 18.6. Display a Dynamic Image to the Browser
- 18.7. Implement an Image Captcha Test
- 18.8. Produce an Image Gallery
- 19. FACILITATING DYNAMIC AJAX CALLS WITH PERL
-
20. PROCESSING CREDIT CARD TRANSACTIONS WITH PERL
- 20.1. Introducing PayPal
- 20.2. Sign Up for a PayPal Sandbox Account
- 20.3. Create Buyer and Seller Sandbox Accounts
- 20.4. Retrieve Your Seller's Sandbox API Credentials
- 20.5. Use Business::PayPal::NVP to Connect to PayPal
- 20.6. Process a Credit Card Payment with PayPal
- 20.7. Use the PayPal Express Checkout API
- 20.8. Search Your PayPal Transaction History
- 20.9. View a PayPal Transaction's Details
- 20.10. Refund a PayPal Transaction
-
21. ACCESSING A BACK-END MYSQL DATABASE WITH PERL
- 21.1. Introducing the MySQL Database
- 21.2. Understanding the SQL Syntax
- 21.3. Download MySQL for Windows
- 21.4. Install MySQL for Windows
- 21.5. Install MySQL for Debian/Ubuntu Linux
- 21.6. Install MySQL for Red Hat Linux
- 21.7. Introducing the Perl DBI Library
- 21.8. Connect to a MySQL Database with the DBI Library
- 21.9. Retrieve SQL Data Using the DBI Library
- 21.10. Display SQL Data Through HTML::Template
- 21.11. Change SQL Data Using the DBI Library
-
22. SECURING DYNAMIC WEB SITES
- 22.1. Understanding TLS/SSL Encryption
- 22.2. Create a Private SSL Key
- 22.3. Generate an SSL Certificate Signing Request
- 22.4. Sign Your Own CSR to Create a Test SSL Certificate
- 22.5. Submit Your CSR to Be Signed by a Certificate Authority
- 22.6. Configure Apache to Use TLS/SSL
- 22.7. Understanding Security in Perl CGI Development
- 22.8. Limit CGI Access in Apache
- 22.9. Identify Unusual Activity on Your Web Site
- 22.10. Sanitize User Content in Perl CGI
- 22.11. Validate User Content in Perl CGI
- 23. SPEEDING UP DYNAMIC WEB SITES
- A. PERL REFERENCE
- B. APACHE CONFIGURE AND MODULE REFERENCE
- C. USEFUL PERL MODULES
Product information
- Title: Perl and Apache: Your visual blueprint for developing dynamic Web content
- Author(s):
- Release date: October 2010
- Publisher(s): Visual
- ISBN: 9780470556801
You might also like
book
Web, Graphics & Perl/Tk Programming
In its first five years of existence, The Perl Journal (TPJ) became the voice of the …
book
Database-Driven Web Development: Learn to Operate at a Professional Level with PERL and MySQL
Learn to operate at a professional level with HTML, CSS, DOM, JavaScript, PERL and the MySQL …
book
Developing Web Applications with Perl, memcached, MySQL® and Apache
The only book to address using cache to enhance and speed up Web application development Developers …
book
Perl 6 Deep Dive
Learn Perl 6 effortlessly to solve everyday problems About This Book Filled with practical examples, this …