Campuses:
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
computing:accounts:web_publishing:cgi [2007/06/12 11:46] – rubin | computing:accounts:web_publishing:cgi [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | <box 30% right right-clear red|More Web Publishing Information> | ||
- | {{indexmenu>: | ||
- | </ | ||
- | <box 30% right right-clear red|More Account Information> | ||
- | {{indexmenu>: | ||
- | </ | ||
- | ====== Creating Dynamic Web Content ====== | ||
- | While simple websites are just a collection of .html files which are sent to browsers directly when they ask for a webpage, it is possible to make more advanced sites which execute a program when someone asks for a page, and the output of the program is sent instead of a simple html file. This is handy for processing web forms, adapting output for each user, and creating full blown applications on the web. Many pages you use every day work this way, such as search engines, content management systems, comment engines, and anything else interactive on the web. | ||
- | |||
- | <note important> | ||
- | Because dynamic websites are taking input from anonymous users on the internet, and executing code, there is a very strong need to focus on security and safety. | ||
- | </ | ||
- | |||
- | There are a few different ways to do the actual code that runs when someone requests your webpage: | ||
- | |||
- | ===== PHP ===== | ||
- | PHP is a very popular programming language designed specifically for serving dynamic websites. We support PHP on the physics webserver. | ||
- | |||
- | For security reasons, all PHP code is executed as you, so it will have access to anything you yourself do when logged into one of our Unix/Linux boxes. | ||
- | |||
- | ===== CGI ===== | ||
- | CGI stands for " | ||
- | |||
- | Execution of CGI programs is possible from personal web areas, provided certain fairly stringent conditions are followed. CGI programs are executed via the Apache suEXEC feature. The documentation at the Apache site details the conditions under which suEXEC will run a user-supplied CGI program. The main things to watch for are: | ||
- | |||
- | * CGIs must be run from a directory named cgi-bin (within your public_html directory). | ||
- | * The cgi-bin directory must not be writable by anyone other than yourself. | ||
- | * The program file itself must not be writable by anyone other than yourself. | ||
- | * The program file must be owned by you. | ||
- | * The program file can't be setuid or setgid. | ||
- | * The program filename must end in .cgi | ||
- | |||
- | None of these restrictions is hard to satisfy, but they help to prevent a defective CGI program from affecting other users. Inherent in this is a warning - the CGI program will be running under your user ID, so be sure that it isn't going to do anything unexpected with or to your files! | ||
- | |||
- | ===== Mod-Perl ===== | ||
- | Mod-Perl is a special way to run perl programs especially designed for use on the web. We do have mod-perl support on the department webserver, however it is not enabled automatically for groups or personal webpages. | ||
- | |||