How to create and run CGI programs using the CS web server.

Slides:



Advertisements
Similar presentations
1 Copyright © 2002 Pearson Education, Inc.. 2 Chapter 2 Getting Started.
Advertisements

Coursework 2: getting started (3) – hosting static web pages Chris Greenhalgh G54UBI /
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Introducing the Command Line CMSC 121 Introduction to UNIX Much of the material in these slides was taken from Dan Hood’s CMSC 121 Lecture Notes.
Web basics Keywords: Web Server, Browser, Local, Remote, HTML, URL.
George Blank University Lecturer. Creating A Web Site at NJIT Professor Blank.
CS /13 DePaul University SNL 262 Advanced Web Page Design Review & Introduction - I Instructor: David A. Lash.
Its easy to be an information provider Tutorial: Web Publishing.
Web Pages Publishing your page on ASUWlink. Unix Directory Commands ls –la –will show all directories and files –will show directory and file permissions.
CMPE 151: Network Administration Spring Class Description Focus: system and network administration. Sequence of exercises. E.g., installing/configuring.
Introduction to UNIX A User’s Perspective: Day 2 – Command Basics.
Computers in Principle and Practice Servers and Operating Systems.
A crash course in njit’s Afs
CS 141 Labs are mandatory. Attendance will be taken in each lab. Make account on moodle. Projects will be submitted via moodle.
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
1 Homework / Exam Exam 3 –Solutions Posted –Questions? HW8 due next class Final Exam –See posted schedule Websites on UNIX systems Course Evaluations.
Web Servers Installation and Configuration May 24, 2001 CIS System Administration Problem Statement The class topic is setting up a Linux server to support.
File Systems Sources and Resources: 1. A Students Guide to UNIX, by Hahn 2. Paula Davidson’s Handout on UNIXHandout on UNIX.
Nick Geoghegan1 Introduction to Linux Workshop. Nick Geoghegan2 Getting Started Download the following files:
CNIT 132 Intermediate HTML and CSS Publish Web Page.
Let’s Make An Form! Bonney Armstrong GD 444 Westwood College February 9, 2005.
1 John Magee 9 November 2012 CS120 Lecture 17a: Publishing Web pages.
Essential Unix at ACEnet Joey Bernard, Computational Research Consultant.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
Unix Basics Chapter 4.
Introduction to Programming the WWW I CMSC Summer 2004 Lecture 6.
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.
HTML Hyper Text Markup Language A simple introduction.
ECT 250: Survey of E-Commerce Technology FrontPage Publishing pages Unix.
UNIX Workshop Freshmen Orientation UNIX workshop Before we begin…  Does everybody have a computer?  Does everybody have your account slips?
1 © Copyright 2000 Ethel Schuster The Web… in 15 minutes Ethel Schuster
CGI Common Gateway Interface. CGI is the scheme to interface other programs to the Web Server.
November 5, 2015CIS 118 Intro to UNIX What’s a Unix? Unix is an Operating System Designed for high-traffic usage Many variants –Linux, BSD: free versions.
Slide No. 1 Slide No. 1 HTML and Web Publishing Continued CS 104 CS 104.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
ECMM6018 Enterprise Networking for Electronic Commerce Tutorial 7
Accessing the Lab. Putty Available via links on course page Creates secure (SSH) command line session between your machine and SCS network Uses tunnelling.
Preliminary PreparationS for the Training AIST=Innovation 1.WinSCP Installation Download Site: 2. Putty.exe file download.
1 Lecture 2 Working with Files and Directories COP 3353 Introduction to UNIX.
1 More About HTML Images and Links. 22 Objectives You will be able to Include images in your HTML page. Create links to other pages on your HTML page.
Introduction to HTML C151 Multi-User Operating Systems.
1 Introduction to Unix. 2 What is UNIX?  UNIX is an Operating System (OS).  An operating system is a control program that helps the user communicate.
A Brief Overview of Unix Brandon Bohrer. Topics What is Unix? – Quick introduction Documentation – Where to get it, how to use it Text Editors – Know.
 Last lesson, the Windows Operating System was discussed along with the Windows command shell  Unix is a computer operating system, that similarly manages.
1 File Permissions Look at permissions with ls -l Output: –-rw-r--r-- 1 enda users 1234 Jun 2 10:51 file.ext.
The Unix File sytem. Introduction Tree structure …
CS 330 Class 8 Homework A pattern that contains a word with an optional period A pattern that contains Fred with a space (not Freddy) See regexp.txt guest4.htm.
ICE UNIX TUTORIAL. File System Commands cd – change directory cd – change directory ls – list contents ls – list contents rm – remove/delete rm – remove/delete.
Learning basic Unix command It 325 operating system.
Day 15 Apache. Being a web server Once your system is correctly connected to the network, you could be a web server. –When you go to a web site such as.
Chapter 2: Exploring the UNIX File System (For Tuesday Section) File and File Systems.
Using UNIX Charles Duan FAS Computer Services June 12, 2016.
University of Kansas Department of Electrical Engineering and Computer Science Dr. Susan Gauch April 21, 2005 I T T C Introduction to Web Technologies.
Topic 2: Hardware and Software
UNIX To do work for the class, you will be using the Unix operating system. Once connected to the system, you will be presented with a login screen. Once.
Introducing the UNIX Operating System.
CS 330 Class 7 Comments on Exam Programming plan for today:
Redirection Allow requests to be moved about your file system or around the web ScriptAlias Allows you to run CGI scripts Simple to use.
Lecture 2 Working with Files and Directories
Some Linux Commands.
Introduction to Programming the WWW I
Lab 1 introduction, debrief
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.
UNIX Basics Internet Technology.
FTP and UNIX TOPICS Exploring your Web Hosting Site FTP UNIX
Web Programming Essentials:
Server Side Programming Overview And file system basics
World Wide Web Components
January 26th, 2004 Class Meeting 2
Presentation transcript:

How to create and run CGI programs using the CS web server. CGI and cs.rpi.edu How to create and run CGI programs using the CS web server. Netprog: cgi.cs.rpi.edu

Web Servers & CGI Most web server are capable of running CGI programs. The server must be able to determine whether a URI refers to: document - just send it back CGI program - run it and send back the result. Netprog: cgi.cs.rpi.edu

/CGI-BIN /cgi-bin /CGI /cgibin CGI recognition Some servers insist that CGI programs be in a special place typically the URL path is one of: /CGI-BIN /cgi-bin /CGI /cgibin Some servers look at the filename: filename ends with .cgi Some servers are given a list of URLS that are CGIs Netprog: cgi.cs.rpi.edu

User files and Web Servers On Unix based web servers, the URL /~username is typically mapped to the directory ~username/public.html -or- ~username/public_html Netprog: cgi.cs.rpi.edu

www.cs.rpi.edu On the CS web server you should put your files in ~/public.html The URI http://www.cs.rpi.edu/~you is your home page. you is your CS username. Netprog: cgi.cs.rpi.edu

Directories Most web servers do the following when a URL maps to a directory: if there is a file named index.html in the directory - it is sent back. if there is no index.html, an HTML formatted directory listing is sent back. Netprog: cgi.cs.rpi.edu

Create a Home Page The file must be readable by anyone! cat > ~public.html/index.html <H1>Master Network Programmer for Hire</H1> ^D > chmod go+r ~public.html/index.html The file must be readable by anyone! (the web server runs as nobody) Netprog: cgi.cs.rpi.edu

CGI & cs.rpi.edu The web server www.rpi.edu will not run user CGI programs. Neither will www.cs.rpi.edu cgi.cs.rpi.edu will! Netprog: cgi.cs.rpi.edu

cgi.cs.rpi.edu Your executable file's name should end with .cgi Your executable will be run as you (with your userid permissions). Make sure the file/directory are not world or group writeable! Netprog: cgi.cs.rpi.edu

IMPORTANT cgi.cs.rpi.edu is a BSD computer! You need to build your CGI on a BSD machine! You should use: freebsd.remote.cs.rpi.edu Netprog: cgi.cs.rpi.edu

Getting Started Copy one of the examples and get it running: > cd ~/public.html > cp -r ~hollingd/public.html/netprog/code/CGI/pizza . > chmod -R go-w pizza Netprog: cgi.cs.rpi.edu

Debugging It's hard to debug a CGI program! Debugging print statements should generate HTML. You can run the program from the Unix command line - you just need to set the environment variables right (use GET for this). Netprog: cgi.cs.rpi.edu

/servers/cgi2/logs/error_log Log Files cgi.cs.rpi.edu has a log file that can be helpful when your program won't run: /servers/cgi2/logs/error_log The command "tail -f" may come in useful... Netprog: cgi.cs.rpi.edu

More Help Look at "Guide to CGI programming on cgi.cs.rpi.edu". Lots of links to CGI resources. Netprog: cgi.cs.rpi.edu