mod_snake Apache API

The mod_snake Apache API is available as methods within the mod_snake module. The mod_snake module can be imported into any Python module, and the routines accessed directly. The Apache API contains routines which should be accessable by regular modules, CGIs, and embedded Python.

ap_server_root_relative

Synopsis

mod_snake.ap_server_root_relative( path)

Arguments

Return Value

The return value is a new string, containing the absolute path on the filesystem. For example, if the server's root directory was /home/jtravis/apache, then ap_server_root_relative('logs/mylog') would return /home/jtravis/apache/logs/mylog.

ap_log_error

Synopsis

mod_snake.ap_log_error( level, server, err_string)

Arguments

Return Value

No values are returned from this function.

ap_getwords_conf

Synopsis

mod_snake.ap_getwords_conf( str)

Arguments

Return Value

A list containing elements of the split-up str is returned.

Description

Apache uses the ap_getword_conf routine to obtain a new argument to a configuration directive. Arguments may be quoted strings or plain strings. The ap_getwords_conf routine returns a list of arguments as parsed from the str argument.

ap_get_server_version

Synopsis

mod_snake.ap_get_server_version()

Return Value

Returns a string containing the Apache server version

Description

The server version as returned by the function is the same that is sent to clients via the server string. The common form of the server-version is ``Apache/version''. e.g.: ``Apache/2.0a3''

ap_validate_password

Synopsis

mod_snake.ap_validate_password(pword, hashed)

Return Value

Returns a true value of the hashed argument is a hashed representation of the password, else false.

Description

This routine compares a plaintext password with a hashed password (which is often created with the htpasswd program, for instance). Hashed passwords are often stored in a database or file as opposed to their plaintext counterparts. This provides safety against theft of the password file.