Caravan in brief: --------------------------------- Caravan PM version is now available. Easy to install and setup . Just copy it into a new directory and run it. Caravan is an application server which has built-in http, smtp, ftp and database engines. It also provides a scripting langauge, a dynamic compiler and basic features needed to develop , test and run applications. Caravan can parse xml documents and publish information about its database tables in xml format. Caravan language provides a sophisticated platform for creating applications using various objects like files, folders queues, mail, ftp, xml and database tables. It has a built-in search engine integerated with the database. Caravan runs on mutli-threaded, 32bit operating systems -- OS/2, Windows98 /NT/2000 and Linux. Caravan is available for os/2, windows and linux --- all data and code are compatible across the platforms supported. In effect caravan applications are platform independent. Caravan code is embedded in .html files which are placed in the templates directory. Caravan is a stand-alone system, using bare essential operating system features , everything being built from scratch so that it can be as independent as possible from the OS. Caravan features and operations are identical on all platforms. In essence caravan is like having apache, jsp/php ,oracle and lot more in one neat package. The advantage of caravan is that it is a powerful, integrated and platform independent solution for internet/intranet. Caravan is written in c++ and compiled using watcom c++ 10.6 for os/2. The development of caravan is an ongoing effort, there are still some rough edges! Note: Caravan is being made free for OS/2 users only. -------------------------------------------------------------------------------------------------------------------------------------------------------------------- Getting Started -- installation (for older version) ----------------------- Caravan needs to know the basic settings during startup. These are defined in a file named httpd.cnf. The path of this file is set by the environment variable "CARAVAN". Example. If the configuration file httpd.cnf is in the c:\caravan path set the ewnvironment variable by the following cmd: set caravan=c:\caravan To run caravan open an os/2 window and use the folloing commands: C:>set caravan= C:>caravan Creating the httpd.cnf file. #Following is the contents of a sample httpd.cnf file: #lines starting with a # are comments. #----------------------- html text/html htm text/html #mime content-type for files with extention html gif image/gif jpg image/gif #mime content-type for files with extention jpg/gif #content-type for those not defined here default to unknown/unknown #these are necessary for the browser to understand the documents served by caravan. location London #the location property of this server. can be used in application logic. templates c:\caravan\templates #caravan script files are located in the templates directory defined above. #please create before running caravan dbhome c:\caravan\dbase #caravan database home directory is created in the directory defined above. #please create before running caravan documents c:\caravan\doc #caravan will look for static documents in the directory defined above. #please create before running caravan bin c:\caravan\exe #caravan looks for binary executable here datacache 16M #memory caravan uses for caching database records. defaults to 1M. caravan-http 80 #caravan with use this port number for http services. #caravan will not start http services if this is not available; This is necessary. smtp 25 #caravan with use the port defined here for smtp services. #caravan will not start smtp services if this is not available/defined ftp 21 #caravan with use the port defined here for ftp services. #caravan will not start ftp services if this is not available/defined domain mydomain.com #caravan will use the above domain in smtp transactions nameserver 124.89.89.8 nameserver 124.89.89.88 #caravan can pickup this information from etc/resolv also. #multiple entries are allowed for nameserver; #needed for smtp to work properly ---------------------------------- end of httpd.cnf-------------------------------- The downloaded zip file contains the folowing. caravan.exe for os/2 sample httpd.cnf user.html -- a utiliy written in caravan script for managing users. ----------------------------------------------------------------------------------------- To install caravan : 1. Create a directory say c:\caravan 2. Create the following subdirectories c:\caravan\templates -- for dynamic scripts c:\caravan\dbase ---- for caravan databases c:\caravan\doc - for static pages c:\caravan\exe -- for external applications which can be run from caravan script. 3.copy the httpd.cnf file to c:\caravan 4. set the env "Set caravan=c:\caravan" in config.sys or in a batch file 5.run caravan executable from any window. Note : Caravan also needs the tmp and etc paths which are already defined in the OS/2 environment. The above also applies to Linux and windows, though "\" is now "/" for linux users. Something like the following will be displayed: [c:\caravan]caravan location=Bombay caravan-http Server Started, listening on port: 80 CARAVAN ENTERPRISE SERVER v2.00/03D Copyright (c) 1999,2000,2001 : Niti Telecom Consultancy (www.nititelecom.com) All rights are reserved. SMTP Server Started, listening on port: 25 FTP Server Started, listening on port: 21 caravan-http:Ready to accept connections FTP:Ready to accept connections SMTP:Ready to accept connections --------------------------------------------------- ......-------------------- Press 'q' to exit caravan . Getting Started - Caravan menu. Open a browser window and type http://localhost/caravan.html You will be asked for a user name and password. The default username is "admin" and password is "password" The following menu will be displayed: Caravan Enterprise Server One stop solution for the web All Rights Reserved Configure Caravan Server ------disabled Restart Server -----------------------disabled Server Information -----------------disabled Logout Caravan Data Base Manager Create A User Edit Change Password. Select "change password" - other items will not work with the default password. Once you have changed the password you can select other links and explore. 1. You can use create a user to create more users. The domain field in the user form defines the user's access rights. The domain for admin is "admin". 2. Edit -- you can edit or create caravan scripts using the edit link. 3. Change password --- change the password. The link is "password.html" 4. Logout - to sign off. Note : you may use "127.0.0.1" in case "localhost" is not defined. Using the ftp server: 1. To use the ftp server of caravan , be sure the port defined in httpd.cnf (21) is available and caravan ftp server has started. ---- See if caravan has printed somthing like this on the console: >FTP Server Started, listening on port: 21 2. Create a new user - use any domain - say "ftpuser". Go to the caravan database manager menu. select caravan database and users table. find the user you have just created , and in the ftpDirectory field enter the home directory for this user's ftp access. 3. logout 4.open http://localhost/login.html 5. login with the new user name and default password "password" 6. if login was successful , open http://password.html 7. change password -- caravan does not allow ftp access unless the default password has been changed. 8. open an ftp client and access the caravan ftp port using the new username and password . -- in an os/2 window type : ftp localhost >IBM TCP/IP for OS/2 - FTP Client ver 22:15:24 on Sep 22 1997 >Connected to localhost. >220 caravan ftp server ready >Name (localhost): If you have done this successfully -- you can now access any database record , create users and modify fields in database tables. You now have a new ftp server for os/2. Getting Started with caravan script. Most of the functionality of caravan will be evident only when the user learns the caravan scripting langauge. Caravan script is embedded in html files which are to be located in the templates path defined in the httpd.cnf file. To start with lets make a very simple dynamic html. Caravan looks for *.html files in the "templates" directory and compiles them at startup. Please note that the extention is "html" not "htm". Files which are in the documents path is served as static files. You can also create new templates online by the following method: 1. goto caravan menu 2. select edit you will see that location is http://127.0.0.1/edit_tmpl.html 3.instead enter : " http://127.0.0.1/edit_tmpl.html?c=test.html" in the location and press enter; test.html is the name of the new file you want to create. click on "create file" ---- please dont ask why ! 4. You will be given a text box in which to enter the script: type the following in the text box -- you can cut and paste time x "It is now";" ";x(hour);":";x(minute);" on ";x(day);" ";x(month);" ";x(date);" ";x(year);"
"
Press the "Save File" button . You will see the name test.html in the list of templates you can edit from the template manager. Now you have created a dynamic html document. In the location of the browser, type :" http://localhost/test.html" and press enter: Time will be displayed something like: It is now 10:48 on Wed Nov 06 2002. If you have come this far you know how to create and edit the caravan scripts! Caravan script begins with the tag and ends with the tag Caravan script can be anywhere in the html file. Some variations of the above which produce essentially the same output. ------ 1. Constant strings are either outside caravan script or are quoted. Comments start after ";" with "//"; ";" or end of line is used to seperate caravan statements; "\r\n" time x ;// x is a variable of type time . "It is now";" ";x(hour);":";x(minute);" on ";x(day);" ";x(month);" ";x(date);" ";x(year);"
" ;// month, date, day etc are properties of time "\r\n"
1. You can end and restart caravan script anywhere. The flow of logic is not affected! Comments start after ";" with "//". Caravan language is not case sensitive. "\r\n" Time x ;// x is a (object) variable of type time . "It is now";" ";x(hour);":";x(minute);" on "x(day);" ";x(month);" ";x(date);" ";x(year);"
" ;// month, date, day etc are properties of time "\r\n"
Time is a predefined caravan object type; x is an instance of time. It has the property of the current time; Similarly caravan uses the following object types: 1.user object having the properties of the caravan user 2.table object having the properties of a caravan database table 3.file object of type file 4.folder represents a directory on the file system 5.var a user defined object having user defined properties 6.ftp an object used to access ftp servers 7.form an object similar to var but which can be posted to other http servers 8.mail an object representing mail which can be posted to smtp servers 9.queue a user defined event queue - which is linked to a user created eventhandler, which is also a caravan script file in the templates directory. 10.time an object representing time. etc.. etc.. In addition caravan has conditional statements, iteration, assignment, scheduling and security features. I will be posting various utilities and updated files on www.response4u.com/os2.html. user.html is one such utility which I am including with this package. In this concepts like iteration, user object and contitional statements are used.