Getting Started with IBM HTTP Server Powered by Apache and CGI

Slides:



Advertisements
Similar presentations
Introduction to Web Design Lecture number:. Todays Aim: Introduction to Web-designing and how its done. Modelling websites in HTML.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
® Microsoft Office 2010 Browser and Basics.
FIRST SESSION - XAMPP Jeongmin Lee.  Jeongmin Lee  CS  PHD  Machine Learning, AI  Web System Development.
beas WEB App Installation
4.01 How Web Pages Work.
1 Configuring Internet- related services (April 22, 2015) © Abdou Illia, Spring 2015.
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
XP Browser and Basics1. XP Browser and Basics2 Learn about Web browser software and Web pages The Web is a collection of files that reside.
Tutorial 6 Working with Web Forms
Layer 7- Application Layer
Introduction to Web Database Processing
CIS101 Introduction to Computing Week 05. Agenda Your questions CIS101 Survey Introduction to the Internet & HTML Online HTML Resources Using the HTML.
Chapter Apache Installation in Linux- Mandrake. Acknowledgment The following information has been obtained directly from
Introduction to Web Interface Technology (CSE2030)
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
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.
Tutorial 6 Working with Web Forms. XP Objectives Explore how Web forms interact with Web servers Create form elements Create field sets and legends Create.
70-293: MCSE Guide to Planning a Microsoft Windows Server 2003 Network, Enhanced Chapter 7: Planning a DNS Strategy.
Browser and Basics Tutorial 1. Learn about Web browser software and Web pages The Web is a collection of files that reside on computers, called.
FIRST COURSE Creating Web Pages with Microsoft Office 2007.
Internet Basics.
Web Client/Server Communication A290/A590, Fall /09/2014.
WebServer & Tomcat By B. Venkateswarlu M.Tech Assoc Prof IT(Dept) Newton’s Institute of Engineering.
Linux Operations and Administration
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
Using Bloglines Presented by Bonnie Shucha © University of WI Law Library
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Web Administration.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
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.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Server-side Scripting Powering the webs favourite services.
Introducing Dreamweaver MX 2004
Tutorial 1 Getting Started with Adobe Dreamweaver CS3
XHTML Introductory1 Linking and Publishing Basic Web Pages Chapter 3.
XP New Perspectives on Browser and Basics Tutorial 1 1 Browser and Basics Tutorial 1.
CIM6400 CTNW (04/05) 1 CIM6400 CTNW Lesson 6 – More on Windows 2000.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
HOW WEB SERVER WORKS? By- PUSHPENDU MONDAL RAJAT CHAUHAN RAHUL YADAV RANJIT MEENA RAHUL TYAGI.
1 In the good old days... Years ago… the WWW was made up of (mostly) static documents. –Each URL corresponded to a single file stored on some hard disk.
SUSE Linux Enterprise Desktop Administration Chapter 12 Administer Printing.
Database-Driven Web Sites, Second Edition1 Chapter 5 WEB SERVERS.
Client – Server Application Can you create a client server application: The server will be running as a service: does not have a GUI The server will run.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
Overview Web Session 3 Matakuliah: Web Database Tahun: 2008.
ISeries GUI Debugger Chris Adair Information Systems Director - National Envelope Treasurer – Metro Midrange Systems Association
Microsoft FrontPage 2003 Illustrated Complete Creating a Form.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
XP Browser and Basics COM111 Introduction to Computer Applications.
Free Powerpoint Templates Page 1 Free Powerpoint Templates Users and Documents.
Web Design and Development. World Wide Web  World Wide Web (WWW or W3), collection of globally distributed text and multimedia documents and files 
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Tutorial 6 Working with Web Forms. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore how Web forms interact with.
Microsoft Office 2008 for Mac – Illustrated Unit D: Getting Started with Safari.
COM: 111 Introduction to Computer Applications Department of Information & Communication Technology Panayiotis Christodoulou.
Getting Your Content in the Penn State Student Portal Presented By James Leous, Program Manager James Vuccolo, Lead Research Programmer.
1.Switch on the computer and wait for loading. 2.Select the Windows 7 OS at the end of the list. 3.Click on the link ‘Administrator’ 4.Enter the administrator.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
WWW and HTTP King Fahd University of Petroleum & Minerals
Data Virtualization Tutorial… CORS and CIS
Adding a File to a Course
Chapter 27 WWW and HTTP.
Title: Tech Training Certificate: Ace of Initiative Program
Configuring Internet-related services
PHP and Forms.
Lecture 5: Functions and Parameters
Presentation transcript:

Getting Started with IBM HTTP Server Powered by Apache and CGI Chris Adair Information Systems Director - National Envelope cadair@natenv.com Treasurer – Metro Midrange Systems Association treasurer@metromidrange.org

iSeries GUI Debugger Chris Adair Information Systems Director - National Envelope cadair@natenv.com Treasurer – Metro Midrange Systems Association treasurer@metromidrange.org

Disclaimer Note: In this presentation, when we refer to the eServer i5 or iSeries primary operating system, we refer to OS/400, even though the operating system name has changed to i5/OS in V5R3. If it is not explicitly stated otherwise, the term OS/400 also refers to i5/OS.

HTTP Server And CGI How many of you have a HTTP Server running on a Systemi? How many of you have CGI running on that server?

What is an HTTP Server? A computer that is responsible for accepting HTTP requests from clients, which are known as Web browsers, and serving them HTTP responses along with optional data contents, which usually are Web pages such as HTML documents and linked objects (images, etc.).

Why the Apache HTTP Server? Most popular Web server in the industry 70% of the web sites on the internet are using Apache ( 2005 Netcraft Web Server Survey) Easily maintainable Many Apache skills in the marketplace Scalable Handles the small usage sites to the well traveled sites Affordability Most likely, you already have everything you need.

What Do You Need? 5722–DG1 IBM HTTP Server for iSeries HTTP Server (original) - Only until OS/400 V5R2 HTTP Server Powered by Apache Net.Data Webserver Search Engine and Crawler Apache Software Foundation’s Jakarta Tomcat Highly Available HTTP Server Triggered Cache Manager 5722-TC1 TCP/IP Utilities 5722-JV1 Java Developer Kit 1.3

The Admin Server A HTTP Server used to manage Web Servers To Start the Admin Server iSeries Navigator Under Network > Servers > TCP/IP: Right Click HTTP Administration Command STRTCPSVR SERVER(*HTTP) HTTPSVR(*ADMIN)

Accessing the Admin Server The Admin Server “listens” on port 2001 for normal HTTP traffic Using a browser, enter this URL http://your_system:2001/ The Admin Server is secured by i5/OS user profiles User profiles must have *IOSYSCFG and *ALLOBJ special authority to perform configuration activities IBM does not recommend using QSECOFR

Now that the Admin Server is started, we can use the wizard to create a new IBM HTTP Server Powered by Apache

Create a New HTTP Server From the Admin Server, click IBM Web Administration for iSeries When the HTTPAdmin page is displayed, be sure to select the “Manage” and “All Servers” tabs From the navigation pane on the left, click “Create HTTP Server”

Step 1: Server Name and Desc. On the Create HTTP Server pane, key a name and description for your server. On the bottom of the page, click “Next”.

Step 2: Specify Root Directory The root directory is where the configuration files and log files are kept. This will be in the Integrated File System. Typically, this will just be defaulted, and there’s nothing to key. On the bottom of the page click “Next”.

Step 3: Specify Document Root The document root directory is where all the servable files are kept. You will put all your HTML’s, images, etc... under this directory or subdirectories Typically, this will just be defaulted, and there’s nothing to key. On the bottom of the page click “Next”.

Step 4: Specify IP Addresses / Port Typically, you will want all IP addresses Key the desired port number The HTTP default is 80 Do not use a port number already in use On the bottom of the page click “Next”.

Step 5: Access Log You can indicate whether or not you want an access log. An access log will keep track of who is making requests of your server. The error log will automatically be created, regardless of this selection. On the bottom of the page click “Next”.

Step 6: Specify Time to Keep Logs New log files will be created on a daily basis to prevent any one file from becoming to large. Specify whether or not to keep log files, both error and access logs. And, how many days to wait before they’re purged On the bottom of the page click “Next”.

Step 7: Summary Screen The wizard displays all the information from the prior steps for a final review. If any changes are needed, click the “Back” button. If no changes are needed, and your ready to create the server, click “Finish”.

Back To The Admin Server Once completed, the Admin Server is displayed with the new server. We can continue to make configuration changes, or start the server and give it a test, We’ll start the server by clicking the green arrow.

Here’s What We Added Some IFS Directories/Files to hold our configuration and content 5 Jobs running in the QHTTPSVR subsystem Let’s take a look……

Serve Some Static Reports

Create Your Own index.html Using your favorite HTML editor, make your own index.html. I used IBM Rational Software Gave my page a title and image Moved it to the “HTDOCS” directory under APACHE01 in the IFS

Add Some Directories I added some links for a few locations Those links need to direct us to a directory under the APACHE01, where I plan to put some month end reports, stored as PDF’s But first, we’ll need to change the configuration of the server to allow directory listings.

Global Configuration I added all my directories under “Global Configuration”. Now, I need to go to each directory location and specify “Directory Handling” and “Security”

Create the IFS Directories Now that the server is set, we need to create the IFS directories Using iSeries Navigator: Under File Systems > IFS > Root > WWW > Apache01, Right click on HTDOCS and select “New Folder”.

Restart the Server All my directories have now been entered. I’ve secured the ones I need, based on a i5/OS profile. All the directories have been created on the IFS. Let’s restart the server and see what happens.

There’s Not Any Files Use your SPLF conversion utility to put some files in the directories If you don’t have a SPLF conversion utility Take a look at this site: http://www.code400.com/cvt2pdf.php Download 4 source members: CVT2CMD, CVT2CLP, CVT2HTML, and CVT2PDF Compile and Run

Summary Started the Admin Server Created an IBM HTTP Server (Powered by Apache) Configured the server Added some IFS directories Downloaded some conversion software Displaying static reports via the browser

Dynamic Data

Dynamic Data Examples CGI Net.Data PHP PERL WevDav

Step 1: CGI Create a new library to hold your new programs CGILIB Create source file CGILIB/QRPGLESRC Copy Service Program to your new library QHTTPSVR/QZHBCGI

QHTTPSVR/QZHBCGI Contains HTTP API procedures for communicating with server – just a few are: QtmhWrStout – The most used API that writes data to standard output. In other words, writes HTML or JavaScript commands to a browser. QtmhRdStin – This API will read information that is made available with a POST operation. QtmhGetEnv – Used to retrieve values set by the server. Typically used to retrieve GET data.

Step 2: Binding Directory Create a binding directory CGILIB/CGIBNDDIR Put your QZHBCGI service program in the binding directory. ADDBNDDIRE

Step 3: Change Your HTTP Server We’ll to change the configuration to allow for CGI programs Add a directory under Global configuration Add a “Script Alias Match” under URL Mapping in Global configuration Check security of new directory Enable CGI in new directory Stop the server and re-start

Step 4: Create a Sample Program Don’t let all the CGI routines scare you Basically, all it’s doing is formatting some HTML and giving it to the browser. Compile using CRTBNDRPG and place in the CGILIB

If It Doesn’t Work Check the error log in the IFS /www/apache01/logs/error_log Check you server configuration If you didn’t APPLY your changes, it may not have taken Check security of the CGI directory

Summary We made a library and put a service program and binding directory in it. Changed a few things on our HTTP Server to allow for CGI Wrote some sample code to test CGI

Interactive CGI

Interactive CGI Using you favorite HTML editor, create a page that asks for some input. I created an “Inventory Lookup” page The user keys a SKU number, presses “Submit” The “Submit” actually calls a CGI program I use the QtmhGetEnv API to retrieve the SKU number entered Process the request and display

Code Snippets

CGI Freebies

Some CGI Freebies WRKCGISPLF STRCGISQL http://www.mcpressonline.com/mc?23@.171132@1%40.6ae65eff STRCGISQL http://www.mcpressonline.com/mc?1@127.Glybd3myPT2.171158@.6b3cd474

WRKCGISPLF

STRCGISQL

STRCGISQL

Conclusion

Summary We started the Admin Server Created and configured a HTTP server Allowed for some static report serving Compiled and ran some CGI Cost = 0 Most likely, you already have everything you need.

Hints Learn some HTML Buy a good CGI book and read the online articles It doesn’t take much to get started. The basic syntax of creating some basic HTML Tables and Hyperlinks will go a long way Buy a good CGI book and read the online articles Brad Stone Paul Tuohy Bob Cozzi Jon Paris All are using RPG CGI and have written publications on how to get started

CGIDEV2 Thank You, Giovanni B. Perotti 39 years at IBM Creator of CGIDEV2 If you’re at V5R1 download CGIDEV2 http://www.easy400.net/easy400p/maindown.html Lot’s of code samples and pre-written procedures

You may contact me via email at: CADAIR@NATENV.COM Questions? You may contact me via email at: CADAIR@NATENV.COM