banner.jpg
Web Development and Tools Powered by WebSellerTM

 

Home

Tips
  Umlauts/UTF-8
  Normalization
  OemToAnsi
  MySQL Import
  Site Search
  City Desk
  DynDNS
  MXLookup
  SPAM

SDT

Support
  Downloads
  Contact Us

Impressum

German

RSS Feed

Site search:

Web Search

Made with CityDesk


A full featured Web Site Template made with CityDesk

By Uwe Holz
Last Update: Sunday, September 14, 2003

More about CityDesk including documentation and online demos can be found at www.fogcreek.com.

All possible information about WebSeller are available at www.webseller.de.

MySQL downloads and more can be found at www.mysql.com.

Other CityDesk related sites:
CityDesk Forum
CityDesk Pool Room
CityDesk Templates
CityDesk News
Knowledge Base
Telepark
TK's City Desk


To set up a full featured Web Site including shopping area, discussion board and search capabilities can be a demanding challenge especially if you have to combine it with an easy to use Content Management System. But I am pretty sure that I finally found exactly what I need and ended up with following solution:

  • CityDesk for content management
  • WebSeller for implementing server side based discussion forum and
  • SqlDBU for Database Maintenance  

Since WebSeller itself is a web shop solution we already inherited additional basic features of a full fledged Web presentation:

  • A shopping area and
  • Server based search capabilities.

CityDesk is the foundation, because it provides an effective way to create and manage your own web site. With CityDesk you can make changes to content, add, delete, move and rename the pages in your site. But the most exciting fact about CityDesk is its simplicity. It is very easy to use and works extremely well.

SQL Database Utility is designed to maintain used MySQL tables and selections in table and form view fashion. Selections, views and input forms can be customized at table and column level (See SqlDBU for more Information).

WebSeller is a multi functional MySQL based CGI script available for almost every platform. Article Forumware demonstrates, how WebSeller can be tailored in order to set up a discussion board. It works based on HTML templates and consists of one executable binary and the appropriate configuration file. This configuration file is a key component because WebSeller has the capability to define every functions needed, therefore you don't really have to write them by yourself. You just have to create appropriate entries in configuration file webseller.ini. Each entry has following arguments:

  • Response - Html template used to generate the HTTP response entity.
  • Action - WebSeller base function called to generate the response (Link, TableUpdate, Login, SetLanguage ...).
  • Select - SQL statement to create the data for generating the response.
  • Id - Id to keep track of the session (user).

All Server Side components, binary, configuration file and all HTML templates are part of this CityDesk project file (see folder cgi-bin and cgi-htm).

This template is based upon the basics described  here. Please, don't expect it to work in the CityDesk preview. Spent a couple of minutes reading this article in order to see how it works.

Prerequisites

In order to use your own CityDesk site in conjunction with WebSeller based shop and forum solution you'll need to set up a couple of things, first of all a MySQL database installed on your server. Check with your ISP, he will have to provide you with some necessary information for database access like

  • MySQL host name
  • MySQL Database name
  • MySQL User Name
  • MySQL Password

If you want to test it locally first you'll need these installed on your own PC. Once again: You'll no longer be able to use the preview option in CityDesk. At least response entities of Shopping and Forum Area  will not work at all, because they are all linked via WebSeller CGI script which needs to be run on a web server.

I'm not going to explain how to install MySQL on a Windows machine. Please refer the MySQL Web Site instead. Installation and set up are pretty straightforward on Windows anyway.

Executable Directory cgi-bin

If you run this site on your local machine first you have to make sure that your executable directory cgi-bin (WebSeller's home directory) has necessary execution permission. If you work with Internet Information Server (IIS) you can use the Admin dialog (System Control, Administration Tools, Internet Services Manager) in order to set necessary permission: Bring up the property dialog for cgi-bin directory, check read and write access properties and select Scripts and Executables for the Execute Permissions property like follows:

 

If you have Apache Web server installed you need to modify configuration file http.conf manually in order to set up cgi-bin accordingly, e.g.:

# UH: Original out of the box setting
# DocumentRoot "C:/inetpub/Apache/htdocs"
DocumentRoot "C:/inetpub/wwwroot"

# UH: Original out of the box setting
# ScriptAlias /cgi-bin/ "C:/inetpub/Apache/cgi-bin/"
ScriptAlias /cgi-bin/ "C:/inetpub/wwwroot/cgi-bin/"

# UH: Original out of the box setting
# <Directory "C:/inetpub/Apache/cgi-bin">
<Directory "C:/inetpub/wwwroot/cgi-bin">
    AllowOverride None
    Options ExecCGI FollowSymLinks Indexes MultiViews
    Order allow,deny
    Allow from all
</Directory>

 

Http.conf entries above change the Apache default directories in order to match IIS directory setup. To do so you can have both web servers installed and test your web site against both by stopping one service and start the other and vice versa.

Note: On a Linux/Unix system the cgi-bin directory needs to have executable rights prepared (755). After the initial installation of the binary script file by CityDesk Publishing service the executable permission of WebSeller needs to be adjusted to 755 as well. Otherwise any call to the script will fail. The file permission will be kept for subsequent deployment of the appropriate file. In other words: Manual permission set up of WebSeller binary to 755 is necessary only ones.

Template Installation

  1. The first thing to do is download the CityDesk template: cityd-ws.zip
  2. Unzip archive cityd-ws.zip next in order to extract template ws.cty.
  3. Finally open template ws.cty by CityDesk and adjust all necessary settings (CityDesk variables).

Binary script setting

Since the executable script is platform dependent you have to make sure to install the right version. To do so, open  up CityDesk IDE and check out variable WSScriptUrl (click View > Variables). It needs to be set up like follows:

  • Target platform Linux: /cgi-bin/webseller.cgi
  • Target platform Solaris: /cgi-bin/webseller.bin
  • Target platform Windows: /cgi-bin/webseller.exe

Note: You can delete all unused binaries from the CityDesk folder cgi-bin., e.g. delete files webseller.bin and webseller.cgi if you use Windows platform only for your Internet server applications.   

MySQL Settings

While mentioning CityDesk variables there are more of them to be adjusted: MySQL access data provided by your ISP can be set up here as well. Open the variables dialog again (click View > Variables) for following definition:

  • WSMysqlUser - MySQL user name that has access to the database
  • WSMysqlDatabase - Name of the actual database
  • WSMySQLPassword - the MySQL user's password
  • WSMysqlHost - Usually localhost unless your ISP defines it differently

 

Miscellaneous Settings

Now you are almost set. The last couple of variables determine e-mail and other more general data. Emails are a key feature for shopping solutions and can be very useful for discussion boards as well. Therefore e-mails are used within the shopping and forum area for following notifications types:

  • A new user has registered to the shop.
  • A shop order has been generated by a registered user.
  • A new forum message has been stored.
  • etc.

In order to enable the capabilities above adjust following variables using CityDesk's variable dialog:

  • WSRelPathToDocRoot - Relative path from script folder to the document root (default setting "..")
  • WSDomainUrl - Full specified domain URL
  • WSCurrency - Default currency used by the shop
  • WSMailServer - Dotted domain name or IP for mail server used to send notification emails
  • WSAdminEmail - Shop or Forum Administrator e-mail 

After publishing the whole thing by CityDesk to your target server Shopping  and Forum area should work now as well. Check out the CityDesk documentation in order to figure out how to set up Publish Locations.

Initializing Database Tables

All necessary database tables should be initialized when WebSeller runs the first time. If it somehow went wrong you can initialize all tables manually. If your site has been uploaded to www.mydomain.com, please browse towww.mydomain.com/cgi-bin/webseller.cgi?action=import&batch=ws.sql. If you receive a failure response or nothing at all, do following checks:

  1. Check out for file webseller.log created in within the script root directory cgi-bin. If there is no log file at all you might have ran into a permission problem and WebSeller has not been started at all. Check permissions and contact your ISP. If the log file does exist, check it's content for the problem
  2. If the log file indicates MySQL access problems, check access data with your ISP.
  3. If the checks above did not solve your problems, send me an e-mail and attach webseller.log.

Feel free to use this template as the foundation for your Web site with forum and shop solution. Let me know if you have adjusted it for your own purpose so I can take a look.