Version 3.1 User's Guide |
|
Using the NetCloak CGI |
Previous |
Next Contents |
This and the Reference guide are written assuming that the NetCloak plug-in is being used. This section has more information particular to using the CGI version of NetCloak. There are important differences in installation, configuration URLs for cloaked files and other areas that are covered here.
Most Mac web servers support W*API plug-ins, and the plug-in version is recommended for servers that support it. The plug-in imposes less overhead on the server and is more convenient to use. For servers that do not support plug-ins, or special situations where the plug-in is not appropriate, use the traditional CGI version of NetCloak.
You may select either the CGI or the plug-in according to your site and server's needs, but under no circumstances should both be run simultaneously with the same server application.
If your server does not support action-based CGIs, you will need to add a command to your URLs to tell the web server that the NetCloak CGI must process the document. This applies to both dynamic pages and FDML templates for forms processing.
To invoke NetCloak for a particular page without a suffix mapping, simply add "/NetCloak.acgi$" between the server name and document path in URLs. For example, the URL:
http://www.server.com/myFolder/cool.html
would be cloaked if you change it to:
http://www.server.com/NetCloak.acgi$/myFolder/cool.html
For this to work correctly, NetCloak must reside in your server's root folder, and your server must recognize that filenames ending in ".acgi" are used to invoke CGI applications.
If you have installed NetCloak.acgi in the cgi-bin folder on your server, the URL would look like this:
http://www.server.com/cgi-bin/NetCloak.acgi$/myFolder/cool.html
The ACTION URL of a FORM tag might look like this:
ACTION=http://www.server/NetCloak.acgi$/moof.fdml
Note that this will direct the server to have NetCloak process the request regardless of the file suffix. Most servers also support calling a CGI in this manner, so it is a good way to force your web server to return a page through NetCloak when you are not sure if a suffix mapping is working correctly.
This technique is unreliable because if the CGI path and $ are left out of the URL the file will be served without being processed by NetCloak. In many cases this will only be a cosmetic problem since the NetCloak commands in the page will not work. If NetCloak dynamic page commands are being used for security this could cause a significant security hole.
The CGI version of NetCloak is normally installed in the web server root folder or cgi-bin folder. If the NetCloak CGI application is in a folder other than the web server root folder, you will need to launch NetCloak and select the root folder on the Files tab of the NetCloak Configuration window. The NetCloak Files folder, containing NetCloak's preferences, macros and other support files must be in the same folder as the NetCloak application.
While it is possible to use NetCloak without defining an action or suffix mapping, most users configure the web server so that it calls NetCloak to process all HTML files. This will allow you to use NetCloak in any of your HTML pages without worrying about whether the page is cloaked or not.
1. Copy the NetCloak.acgi application from the NetCloak folder to the same folder as the WebSTAR application. 2. Launch WebSTAR. 3. Launch NetCloak.acgi. 4. Select ".NCLK Files to CGI" from the "Auto-Map" menu.If you want to process all HTML files through NetCloak:
5. Select ".HTML Files to CGI" from the "Auto-Map" menu.
For forms processing with NetCloak Pro:
6. Select ".FDML Files to CGI" from the "Auto-Map" menu.
With AppleShare IP, the "NetCloak Files" folder used by the CGI is stored in the "Web Folder".
1. Copy the "NetCloak.acgi" application from the "NetCloak 3.1" folder to the Web Folder on your AppleShare IP server. 2. Start up the AppleShare IP server, then double-click the NetCloak.acgi application to launch it. Starting NetCloak by double-clicking on it is not required, as the web server will automatically start it as needed. However, starting by hand is recommended to avoid possible start-up errors (like out of memory problems). 3. Launch AppleShare IP Admin. 4. Select "Web & FTP MIME Types…" from the Server menu. 5. Click on the line with the suffix ".html", then click the Edit button. 6. Click on the pop-up menu for Action: and select Execute… 7. After the file open dialog box appears, select "NetCloak.acgi" in the file list, then click the Open button. 8. Click the OK button in the Edit MIME Type window, then click Save. Click the OK button in the alert that appears after you click the Save button. 9. Stop the AppleShare IP Web & File Server, then re-start it.
Create an additional MIME mapping for forms processing if you have NetCloak Pro:
1. Select "Web & FTP MIME Types…" from the Server menu. 2. Click on the line with the suffix ".html", then click the Duplicate button. 3. Change the suffix to ".fdml". 4. Click on the pop-up menu for Action: and select Execute… 5. After the file open dialog box appears, select "NetCloak.acgi" in the file list, then click the Open button. 6. Click the OK button in the Edit MIME Type window, then click Save. Click the OK button in the alert that appears after you click the Save button. 7. Stop the AppleShare IP Web & File Server, then re-start it.
1. Copy "NetCloak.acgi" from the "NetCloak 3.1" folder to the "cgi-bin" folder in the WebTen folder. 2. Double-click the "NetCloak.acgi" application to launch it. Starting NetCloak by double-clicking on it is not required, as the web server will automatically start it as needed. However, starting by hand is recommended to avoid possible start-up errors (like out of memory problems). 3. Launch WebTen. 4. Launch your web browser if it is not already running. 5. Access your server's "Administration Server" home page (at "http://www.yourserver.com/webten_admin") via your browser. 6. Click "Action Handlers". 7. In the table that appears, enter "CLOAK" in an empty cell in the first column ("Actions"), and enter "/cgi-bin/NetCloak.acgi" in the second column, "Action Handler". 8. Click "Save Handlers". 9. Click "MIME Extensions". 10. In the "User-Defined MIME Extensions" table that appears, enter ".nclk" in the first column, "text/html" in the second column, and pick "CLOAK" from the popup menu in the third column. 11. Click "Save MIME Extensions".
If you want to process all HTML files through NetCloak, also follow these steps:
12. Click "Built-In Extensions". 13. Select "CLOAK" from the "Action" popup menu for the ".html" extension. 14. Click "Save MIME Extensions".
Create a MIME extension for forms processing if you have NetCloak Pro:
Click "Action Handlers". In the table that appears, enter "NFORMS" in an empty cell in the first column ("Actions"), and enter "/cgi-bin/NetCloak.acgi" in the second column, "Action Handler". Click "Save Handlers". Click "MIME Extensions". In the table that appears, enter ".fdml" in the first column, "text/html" in the second column, and pick "NFORMS" from the popup menu in the third column. Click "Save MIME Extensions".
Personal Web Sharing does not support WebSTAR API plug-ins, so you will only be able to use the CGI version of NetCloak.
1. Copy the "NetCloak.acgi" application from the "NetCloak 3.1" folder into the folder selected as the Web Folder in the Web Sharing control panel. 2. Double-click the NetCloak.acgi application to launch it. Starting NetCloak by double-clicking on it is not required, as the web server will automatically start it as needed. However, starting by hand is recommended to avoid possible start-up errors (like out of memory problems). 3. Run the AppleScript named Map .NCLK Files to NetCloak, located in the For Web Sharing folder in the Goodies folder installed with NetCloak.If you want to process all HTML files through NetCloak, also follow this step:
4. Run the AppleScript named Map .HTML Files to NetCloak, located in the For Web Sharing folder in the Goodies installed with NetCloak.Create an additional action for forms processing with NetCloak Pro:
5. Run the AppleScript named Map .FDML Files to NetCloak, located in the For Web Sharing folder in the Goodies installed with NetCloak.
Both the CGI and plug-in have a complete web interface, but only the CGI has a traditional application interface (GUI). The application's GUI mirrors the web interface, with most settings accessed through tabs in the Configuration window or other windows opened by menu commands.
The CGI application must not be used to make configuration changes for the plug-in . This can lead to a conflict between the CGI and the plug-in which frequently causes lost changes to configuration settings or variable or counter values.
AppleEvents for manipulating NetCloak global variables are quite different between the plug-in and CGI application. Events can be sent directly to the application instead of being sent to the web server as with the plug-in. The application is also able to publish an AppleEvent dictionary, making it possible to use very English-like names for the events.
See the section Using AppleScript to Access Global Variables for details on AppleEvents for global variables using either the NetCloak plug-in or CGI.
Copyright © 1996-2000 Maxum Development Corporation http://www.maxum.com/ |
Previous |
Next Contents |