| |||||||||||
1. Getting acquainted 2. Basic demos 3. Setup commands 4. CGI services available through CGIDEV2 service program 5. Apache HTTP error codes and CGI debugging tips 6. Error number meanings 7. Performance tips 8. About persistent CGI 9. ZIP and UNZIP commands 10. CGIDEV2 updates 11. XSS vulnerability 1. Getting acquaintedIf you are not yet familiar with CGI programming and with CGIDEV2 service program, please read the following:2. Basic DemosOur demos are the best way to learn in practice how to develop RPG-ILE CCGI programs. After reading about CGIDEV2 service program functions, we recommend you visit them.3. Set up commandsYou should not develop your CGI's in one of the libraries (e.g. CGIDEV2) downloaded from our site. Installing a refresh would delete your developments.You should instead develop your CGI's in your (source and object) libraries. The problem of copying all the pieces needed for development and for execution of your CGI's is solved through some commands. We have commands to easy your setups:
4. CGI services available through CGIDEV2 service programFor a comprehensive walk through all the features of CGIDEV2 service program, you may go to Mel Rothman's Readme page. We recommend however you go through the following scheme, which provides you with a smooth learning path: 5. Apache HTTP error codes and CGI debugging tips
6. Error number valuesIn some circumstances some subprocedures of the service programs may end with non-zero return codes. Usually such error codes are also reported in the CGIDEBUG file. The guess would be about the meaning of such codes. To find out about them:
7. Performance tipsIn order to obtain the best performance from your CGI's, you may want to adopt the following tips:
8. About persistent CGISo far, without mentioning them, we have being talking about non persistent CGI. Traditionally, CGI programs are not persistent, that is, a CGI program, the next time it is called, does not remember (or, better, must not remember - as no guarantee exists that it is called by the same client as before) what values where left in its variables, and where files are positioned. This fact of course has a relevant impact in program design, because the values of the variables which are important for a program at the time it is invoked must be saved in the previous response HTML (usually as hidden fields) and sent with the program invocation request.Since V4R3, however, persistent CGI have been
implemented for OS/400 HTTP. Because of this second problem, the implementation of persistent CGI is not very frequent and left to cases where a COMMIT technique is mandatory. Our recommendation is not to use persistent CGI, unless strictly necessary. Persistent CGI
However, should you like to know more
on this subject,
this is your page.
9. ZIP and UNZIP commandsLibrary CGIDEV2 includes commands ZIP and UNZIP.These commands allow to compress and decompress IFS stream files using standard .zip files. The requests entered from commands ZIP and UNZIP are transformed to QSHELL commands, that are run in batch mode. Results from ZIP and UNZIP commands can optionally be displayed. 10. CGIDEV2 updates
Some releases of CGIDEV2 may include new subprocedures for service program CGIDEV2/CGISRVPGM2. Since March 25, 2009 service program CGIDEV2/CGISRVPGM2 has a zero signature. If you already have installed CGIDEV2 and you are going to install a new release of it, you should first check the release date of the existing CGIDEV2. You do that by running command CGIDEV2/RELEASED. During CGIDEV2 installation, service program CGIDEV2/CGISRVPGM2 is created with activity group
CGIDEV2. If the activity group of your current service program CGIDEV2/CGISRVPGM2 is *CALLER,
after the installation of the new CGIDEV2 completes, you MUST run command 11. XSS VulnerabilityOne of the major security problems with WEB pages comes from Cross-Site scripts (known as XSS).Cross site scripting (also known as XSS) occurs when a web application gathers malicious data from a user. The data is usually gathered in the form of a hyperlink which contains malicious content within it. The user will most likely click on this link from another website, instant message, or simply just reading a web board or email message. Usually the attacker will encode the malicious portion of the link to the site in HEX (or other encoding methods) so the request is less suspicious looking to the user when clicked on. After the data is collected by the web application, it creates an output page for the user containing the malicious data that was originally sent to it, but in a manner to make it appear as valid content from the website. XSS effects vary in range from petty nuisance to significant security risk, depending on the sensitivity of the data handled by the vulnerable site and the nature of any security mitigation implemented by the site's owner network. This vulnerability is not restricted to CGI pages, it applies to all dynamic WEB pages, wherever they come from. To protect your dinamic WEB pages (example: WEB pages dynamically sent to the browser from your CGI programs), you must provide a given HTTP header, which is understood by all major popular browsers (Firefox, Internet Explorer, Chrome, Opera, Safari). Such a HTTP header is named X-XSS-Protection and has two options: Example: Content-type: text/html X-XSS-Protection: 1; (mandatory blank line to signal end of HTTP headers) <html> <head> ... ... ... ... ... </head> |