Configuration from the command line.

Obyx can be invoked from the command line and can be configured for run-time in one of 3 ways.

  1. Absolute environment variables.
    Doing things this way requires you to set all of the environment variables before invoking obyx. This is not ideal.
  2. Single environment variable
    Using the OBYX_CONFIG_FILE envar you can specify the path to a configuration file that can be used to configure obyx. This can be useful in some circumstances but is not ideal for most tasks.
  3. The '-c' switch
    Using the '-c ' switch you can specify a configuration file to parse for variables. This way is most flexible as your administrator can specify different configurations for different run time tasks directly from cron without maintaining a calling script.

Below is an example configuration file for obyx. Notice it is very similar to the Apache configuration without the setenv command. It is up to you to maintain the security of this file but due to the potentially sensitive nature of it it certainly shouldn't be world readable.


    #OBYX_DEVELOPMENT on
    OBYX_SQLSERVICE_REQ true
    OBYX_ROOT_DIR /var/www/site/example/pubroot/
    OBYX_SCRIPTS_DIR /var/www/site/example/scripts/
    OBYX_SCRATCH_DIR /tmp/

    OBYX_SQLSERVICE mysql
    OBYX_SQLDATABASE obyx_database
    OBYX_SQLHOST localhost
    OBYX_SQLUSER obyx_db_user
    OBYX_SQLUSERPW obyx_password
    OBYX_SQLPORT 3306

    OBYX_VALIDATE_ALWAYS true
     
    ### IGNORE THESE - Unless you're using a mac
    # OBYX_LIBCURLSO libcurl.dylib
    # OBYX_LIBPCRESO /usr/local/lib/libpcre.dylib
    # OBYX_LIBMYSQLCRSO /usr/local/mysql/lib/libmysqlclient_r.dylib
    # OBYX_LIBPQSO /usr/local/pgsql/lib/libpq.dylib
    # OBYX_LIBZIPSO libz.dylib

With a configuration file such as this you are now able to invoke obyx like this:

./obyx.cgi -c /etc/obyx/obyx.conf updateRSS.obyx
Obyx will look for updateRSS.obyx within the OBYX_ROOT_DIR in this case /var/www/site/example/pubroot/ and run it.
On a final note data can be piped to in to obyx like this:
echo "twitterUser" | ./obyx.cgi -c /etc/obyx/obyx.conf getTwitterStatus.obyx




Last Modified: Thu, 15 Jan 2015