Sambar Server Documentation

Quick Start Guide


This is a brief tutorial for those who wish to build their own web applications and services or customize the sample code provided.

Is it running?
After installing the server, you can start it from the Windows Start menu. A small green S in a box in the icon tray on the far right side of the Windows menu indicates that the server is running.

The content that the server serves is located in the docs directory. By default, the docs directory is located in the directory in which the Sambar Server is installed. When you install the default distribution, this folder contains a number of sample pages you are free to reuse; you can also add your own pages to the docs folder, which the Sambar Server will happily serve.

Many of the examples below are most easily performed if the server is installed and running on your machine.

Hello World
Let's start by creating an HTML file in your docs folder. Using notepad create a file called test.htm and put the following text in the file:

<html><body>Hello World</body></html>

Using your browser, you can access that file as: http://localhost/test.htm

So what is localhost? That's corresponds to the IP address 127.0.0.1 which is always the IP address of the local machine. The same machine might also be accessible through a domain name like www.sambar.com or another IP address like 209.157.142.114, but we always know that 127.0.0.1 works on your local machine.

Dynamic Content
Now rename the page created above from text.htm to text.stm. The .stm suffix on the page is used to indicate that the page has "dynamic" content that must be rendered before returning it to the client. In the first example, the .htm suffix was used, indicating that all the content in the file is "static" and does not need any special processing. In addition, let's modify the content of the test.stm file using notepad to the following:

<html><body>Hello World <RCElocaltime></body></html>

We added the "dynamic" content request <RCElocaltime> which will display the current time when the page is requested.

Using your browser, access the file: http://localhost/test.stm

There are a great many scripting elements that can be used to display dynamic content from databases, perl scripts, Java code, and even other remote systems. A tutorial on the Scripting Language is available online.

Edit-This-Page
Now open the default "home page" for your site: http://localhost/

The page being opened is the index.stm file under the docs directory. This file contains some rather simple "dynamic" content elements used to display a standard header and footer for the site. You can see the exact contents by clicking on the Edit-This-Page link in the bottom right-hand-side of the "home page". You will be prompted for the username and password of the Sambar Server adminstrator (the default username is admin with no password).

Once logged in, the contents of the index.stm are displayed in a text area. At the top and bottom you will see directives to include a header and footer files:

<RC$title = My Web Site>
<RCinclude /header.stm>
...
<RCinclude /footer.stm>

In addition, the title of the page is set in the RC$title variable (the header.stm file makes use of this variable for displaying the current page name.)

Hopefully with this brief introduction to the server you can now start modifying the content of the sample pages and begin enhancing your site.

© 2002-2005 Sambar Technologies. All rights reserved. Terms of Use.