Home
Download
User Info
New User FAQ
Tutorials
Demos
Commands
Variables
Troubleshooting
Code Examples
Sysop Info
Sysop FAQ
Theory
Installation
Management
Tests
Troubleshooting
FAQ
Feedback
Useful Links
Release Notes
Credits
Disclaimer

SourceForge Logo

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.



Questions

1. 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:

  • AddType image/gif .gd
  • AddHandler neo-generate-image .gd

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]
OR
TclAuthBasic tcl_passwd_auth
AND
TclAuthAccess tcl_passwd_access
require valid-user DB function can be either of:

  • tcl_db_auth - To search a db file for the username.
  • tcl_passwd_auth - To search the /etc/passwd file for the username.
Username is only required for tcl_db_auth. It tells NeoWebScript which user to look for the DB file under. So, if the db file was created with a page owned by user foo, you would put foo as the username.
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.

HavePostgres Tells NeoWebScript that you have Postgres enabled.
SendMail Tells NeoWebScript where your sendmail binary is for use with the open_outbound_mail.
Du Tells NeoWebScript where your du binary is for use with the directory_listing command
WebUnpack Tells NeoWebScript where your webunpack binary is installed for use with MIME uploads.
UrlAccessCounter Tells NeoWebScript which db file to use when storing CGI-style counters.
PostgresLib Tells NeoWebScript where your libpgtcl.so file is located.
PostgrePkg Tells NeoWebScript the name of the Postgres package to require.
PostgresHost Tells NeoWebScript the default host to connect to for contacting your Postgres server.
PostgresPort Tells NeoWebScript the default port to connect to for your Postgres server.

Q. What options can I set using the NeoWebDirConf directive?

A.

Supervisor [0|1] Turns Supervisor mode on or off for the directory. 0 is off (default), and 1 is on.
Postgres [Yes|Any] Tells NeoWebScript to turn on Postgres support for this directory. Yes means the user has Postgres access but can only access tables within their own username. Any means the user can access tables under any username.
WebPageOwnerName [user] Tells NeoWebScript to make every file in the directory owned by user instead of taking ownership from the file.
PostgresVersion [version] Tells NeoWebScript to load a particular version of Postgres. Good when you have more than one version of the Postgres libraries, and you wish to load a different one for each directory.
PostgresOptions [options] A string of options passed to the pg_option command after the Postgres library has been loaded.

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.