Enabling CGI & PHP With Apache

Slides:



Advertisements
Similar presentations
Adding Dynamic Content to your Web Site
Advertisements

DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
Multiple Tiers in Action
Definitions, Definitions, Definitions Lead to Understanding.
CP476 Internet Computing Browser and Web Server 1 Web Browsers A client software program that allows you to access and view Web pages on the Internet –Examples.
Dynamic Web site With PHP and MySQL. MySQL The combination of MySQL database and PHP scripting language is optimum for building dynamic websites. MySQL.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
Web Client/Server Communication A290/A590, Fall /09/2014.
Linux Operations and Administration
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
Server Side Scripting Norman White. Where do we do processing? Client side – Javascript (embed code in html) – Java applets (send java program to run.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
Apache Server The Apache Server Apache is a WWW server that implements the HTTP protocol. Apache runs as a daemon. This means that it is a resident.
Web Servers1-1 Web Servers Xingquan (Hill) Zhu
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Chapter 1: Introduction to Web
An introduction to Apache. Different Types of Web Servers Apache is the default web server for may Unix servers. IIS is Microsoft’s default web server.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
SQL Queries Relational database and SQL MySQL LAMP SQL queries A MySQL Tutorial and applications Database Building Assignment.
Java CGI Lecture notes by Theodoros Anagnostopoulos.
What does WWW stand for? And following abbreviations? HTTP: Hyper Text Transfer Protocol HTML: Hyper Text Mark-up Language URL: Uniform Resource Locator.
Implement An Online Management System for PBX Presented by: Bui Phuong Nhung Advisor: Dr. Wei, Chao-Huang.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 Welcome to CSC 301 Web Programming Charles Frank.
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
Computational Boot Camp HTML Mike Schaffer. 8/23/2002 (MES) HTML What is HTML? HTML stands for HyperText Markup Language HTML is the language for publishing.
CSU - DEO Introduction to CGI - Fort Collins, CO Copyright © XTR Systems, LLC Introduction to the Common Gateway Interface (CGI) Instructor: Joseph DiVerdi,
1 Session 1: Introduction to PHP & MySQL iNET Academy Open Source Web Development.
The HTTP is a standard that all Web browsers and Web servers must speak in order for the Web portion of the Internet to work.
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
UF and College of Medicine Web Pages. UF and Com Web Pages Makes heavy use of CSS Uses Server Side Includes Not the Dreamweaver kind of Templates.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
Security Issues with PHP  PHP installation  PHP programming Willa Zhu & Eugene Burger.
Week Fourteen Agenda Announcements Link of the week Review week thirteen lab assignment Upcoming deadlines Are there any lab assignments that need to.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
More than one site? Use multiple configuration files Use multiple configuration files  httpd –d {path}  Assumes “conf/httpd.conf” Logging transactions.
Server Side Scripting Perl, Python, Java Servlets  write complete programs in (Perl, Python, Java) to process HTTP requests and generate a complete HTTP.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
 Before you continue you should have a basic understanding of the following:  HTML  CSS  JavaScript.
©John Samuel 2008 Introduction to PHP Note: These slides are not included in coverage for the BIF703 final exam...
Introduction to Server Side Includes Fort Collins, CO Copyright © XTR Systems, LLC Introduction to Server Side Includes (SSI) Instructor: Joseph DiVerdi,
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Apache Web Server v. 2.2 Reference Manual Chapter 2 Starting Apache.
Lesson 11. CGI CGI is the interface between a Web page or browser and a Web server that is running a certain program/script. The CGI (Common Gateway Interface)
9/21/04 James Gallagher Server Installation and Testing: Hands-on ● Install the CGI server with the HDF and FreeForm handlers ● Link data so the server.
CX Introduction to Web Programming
Section 6.3 Server-side Scripting
Web Concepts Lesson 2 ITBS2203 E-Commerce for IT.
Redirection Allow requests to be moved about your file system or around the web ScriptAlias Allows you to run CGI scripts Simple to use.
Section 17.1 Section 17.2 Add an audio file using HTML
Introduction to Programming the WWW I
MapServer In its most basic form, MapServer is a CGI program that sits inactive on your Web server. When a request is sent to MapServer, it uses.
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Chapter 27 WWW and HTTP.
Unit-5 Chap-1 Configuring Web Server
Java Servlet Ziad A. Al-Sharif.
Common Gateway Interface (CGI current version 1.1)
Chengyu Sun California State University, Los Angeles
Lecture 5: Functions and Parameters

Web Servers (IIS and Apache)
Web Application Development Using PHP
Presentation transcript:

Enabling CGI & PHP With Apache Created by : Ashish Shah, J. M. Patel College Enabling CGI & PHP With Apache Unit- V Chap - II

Created by : Ashish Shah, J. M. Patel College What is CGI CGI, the Common Gateway Interface, is a protocol that defines a standard method enabling Web servers to communicate with external programs. These programs are known as CGI scripts, CGI programs, or, more colloquially, just CGIs. CGI scripts are commonly used to create or update Web pages or parts of Web pages dynamically. CGI is far more flexible than SSI and provides additional functionality that SSI cannot.

How CGI can be enabled with Apache Created by : Ashish Shah, J. M. Patel College How CGI can be enabled with Apache The ScriptAlias directive associates a directory name with a file system path, which means that Apache treats every file in that directory as a script. If not present, add the following directive to httpd.conf: ScriptAlias /cgi-bin/ “/var/www/cgi-bin”. This directive tells Apache that any URL beginning with /cgi-bin/ should be served from /var/www/cgi-bin. Apache reads and executes the script /var/www /cgi-bin/cgiscript.pl.

If necessary, modify the configuration file to Created by : Ashish Shah, J. M. Patel College If necessary, modify the configuration file to include the ScriptAlias directive shown, and restart Apache as explained previously.

Created by : Ashish Shah, J. M. Patel College Testing CGI script Save this script as cgitest.pl, make it executable (chmod 755 cgitest.pl), and then put it in /var/www/cgi-bin. Finally, open the URL http://localhost/cgi-bin/cgitest.pl. If you see similar output, your server’s CGI configuration works. If you enable CGI execution for other directories, make sure to test those configuration options as well before putting the server into production.

Created by : Ashish Shah, J. M. Patel College Output of CGI Test Page

Created by : Ashish Shah, J. M. Patel College Enabling PHP in Apache PHP is an extremely popular and capable HTML scripting language. As shipped in Fedora Core and RHEL, PHP is enabled and ready to run, simply presents a short PHP script you can use to make sure that PHP is working properly. Create the PHP script shown in Listing below, and save it as var/www/html/tests/phptest.php.

<html> <head> <title>PHP Test Page</title> <link rel=”stylesheet” type=”text/css” href=”rhlnsa3.css”> </head> <body> <h1>PHP Test Page</h1> <div id=”content”> <pre> <?php system(“ls -lh /var/www”); ?> </pre> </div> <!-- content --> <?php include(“footer.html”); ?> </body> </html> Created by : Ashish Shah, J. M. Patel College

Open the document in your Web browser, using the URL http: Created by : Ashish Shah, J. M. Patel College Open the document in your Web browser, using the URL http: //localhost/tests/phptest.shtml