This document is designed to answer some questions that we frequently get in our mailbox. New questions will be answered and added as time allows with each release. There are very few code examples listed in this section. If you would like to see some common code examples, you can look at the NeoWebScript Common Code Examples page. Questions1. How do I build and enable GD Dynamic Image Generation support for my NeoWebScript Server?2. How do I build and enable Postgres support for my NeoWebScript Server? 3. How can I make a single header file appear at the top of all my documents? 4. How can I make a single footer file appear at the bottom of all my documents? 5. How do I use the mod_auth_tcl module to password protect a directory? 6. What options can I set using the NeoWebServerConf directive? 7. What options can I set using the NeoWebDirConf directive? 8. What is the NeoWebUserConf directive and what does it do? 9. Why don't some of the commands I read about in my TCL book work in NeoWebScript? 10. What is the difference between a regular NeoWebScript interpreter and a Supervisor interpreter page? 11. Can NeoWebScript run together on a server with PHP? Q. How do I build and enable GD Dynamic Image Generation support for my NeoWebScript Server? A. If you are installing NeoWebScript 3.2 or later, GD support is enabled in the build by default. All you need to do is uncomment the two lines in your httpd.conf file which read:
If you are using an earlier version of NeoWebScript, or you are compiling the mod_nescoript module by hand, you must include -DGDTCL in your command line. Q. How do I build and enable Postgres support for my NeoWebScript Server? A. When you run the ./configure script for your NeoWebScript modules (in the modules/ directory), you must specify the --enable-postgres option. This will turn on Postgres support in mod_neoscript.c Q. How can I make a single header file appear at the top of all my documents? A. You can either add a directory-specific directive in your httpd.conf file or create a .htaccess file in the HTML directory and add the following directive: NeoWebUserConf HeaderFile yourFileHere.nhtml Once this is done, yourFileHere.nhtml will be output before every file in the directory in the directory tree. This means that any file in a subdirectory beneath the current directory will also include this file as a header. WARNING: The document you are requesting must be parsed by the NeoWebScript module, and the header must be parsed by the same parser. This means that the file must be of a filetype in the line in your httpd.conf file that read: AddHandler neo-server-parsed .nhtml .nws ... With the default settings, any file called .nhtml or .nws will be parsed by the NeoWebScript module. So, if you wanted to include a file called header, it would be named header.nhtml so that NeoWebScript can parse it. This does not mean that the file needs to have NeoWebScript code in it. It can be just a plain HTML file without any code and it will work just fine. NOTE: The HeaderFile directive only works in NeoWebScript v3.3+ Q. How can I make a single footer file appear at the bottom of all my documents? A. You can either add a directory-specific directive in your httpd.conf file or create a .htaccess file in the HTML directory and add the following directive: NeoWebUserConf FooterFile yourFileHere.nhtml Once this is done, yourFileHere.nhtml will be output after every file in the directory in the directory tree. This means that any file in a subdirectory beneath the current directory will also include this file as a header. WARNING: The document you are requesting must be parsed by the NeoWebScript module, and the footer must be parsed by the same parser. This means that the file must be of a filetype in the line in your httpd.conf file that read: AddHandler neo-server-parsed .nhtml .nws ... With the default settings, any file called .nhtml or .nws will be parsed by the NeoWebScript module. So, if you wanted to include a file called footer, it would be named footer.nhtml so that NeoWebScript can parse it. This does not mean that the file needs to have NeoWebScript code in it. It can be just a plain HTML file without any code and it will work just fine. NOTE: The FooterFile directive only works in NeoWebScript v3.3+ Q. How do I use the mod_auth_tcl module to password protect a directory? A. If you have built mod_auth_tcl with your NeoWebScript server, you can use the following directives in a directory directive within your httpd.conf file or within a .htaccess file. TclAuthBasic tcl_db_auth [username] [db filename]
DB filename is the actual name of the .db file in the user's db directory. NOTE: getpass must have been compiled and installed with your NeoWebScript server in order for tcl_passwd_auth to work. Once getpass is installed, you must make it SETUID root. Do this by going to where getpass was installed and typing: chmod u+s ./getpass Q. What options can I set using the NeoWebServerConf directive? A.
Q. What options can I set using the NeoWebDirConf directive? A.
Q. What is the NeoWebUserConf directive and what does it do? A. NeoWebUserConf is a NeoWebScript directive to Apache that sets a variable in the NeoWebUserConf array in the safe interpreter. By setting up a .htaccess file, you can set a variable that will get set everytime a document within that directory is output. Example: NeoWebUserConf turnOnOptions yes Will set NeoWebUserConf(turnOnOptions) to yes. NOTE: Any variable set through this method will be set in all documents in the current directory and below. Q. Why don't some of the commands I read about in my TCL book work in NeoWebScript? A. Unless you are in a Supervisor directory, NeoWebScript creates for each page what is called a Safe Interpreter. This means that certain commands which have been considered harmful to the system or users have been disabled. If you are running your own server and would like access to these commands, you can give yourself a Supervisor directory, and you will have a full TCL interpreter at your disposal. If you are on a system run by an administrator, you will have to ask them to grant you a Supervisor directory to execute your webpages. Q. What is the difference between a regular NeoWebScript interpreter and a Supervisor interpreter page? A. When NeoWebScript creates an interpreter for a document, it creates what is called a Safe interpreter. What this does is remove some commands from the TCL interpreter that would be considered dangerous or harmful to the system and the rest of the user base. When a directory has been given Supervisor permissions, it is created as a full TCL interpreter without any restrictions. This gives full access to all the commands available in TCL. Most Supervisor commands are not document through the NeoWebScript documentation, so you'll need to use TCL's help files and man pages in order to learn more about the commands available within a Supervisor interpreter. Q. Can NeoWebScript run together on a server with PHP? A. Yes. NeoWebScript and PHP can live harmoniously together on the same system. Both are simply modules that install into a standard version of Apache. You can either install Apache and then install each module seperately, or just install the full NeoWebScript release with Apache included and then install PHP's module into that server. |