{= include("docs.util"); start_docs_page(docs.technical_manual.page_titles.webstarv); =}

This chapter was contributed by David Wrubel.

If you choose to run $PRODUCT_NAME in web server mode, it will run as a separate webserver application with its own default port number 8987 on the same Mac as WebStar V.

Installation

Because of the way WebStar V is installed on MacOS X, the installation process of $PRODUCT_NAME is a little tricky. Part of the $PRODUCT_NAME (for WebStar V) installation process involves command line work in the OS X UNIX "Terminal". This work is done, using the root user privileges and should be done with extreme caution since the root user has write access to all files, including system files.

Because of security reasons, 4D instructs WebStar users only to install the WebStar application when logged in MacOS X as the admin user. 4D advises WebStar V users to create a MacOS X user that does NOT have admin privileges. The user is normally called "webstar" and is used when WebStar V is running. This setup protects system files and the WebStar V application against some types of unauthorized intrusions. At the same time there is full access to all website files that users upload and download.

The above imposes a problem for $PRODUCT_NAME, since $PRODUCT_NAME must be installed in MacOS X when the user is logged in as the admin user. When $PRODUCT_NAME is installed and you log out and then log in as the "WebStar" user, to run WebStar V, you will not have access to run $PRODUCT_NAME, since $PRODUCT_NAME will only run when logged in as the MacOS X admin user.

You have to change the ownership ID (or valid user name) of all $PRODUCT_NAME files from the admin user (typically the user that installed Mac OS X) to the "webstar" user, to be sure that $PRODUCT_NAME will run when logged in as the webstar user.

To do this follow these steps, remember to be careful, as you will be logged in as the root user as long as you are working in the Terminal:
  1. Webstar V and the "webstar" user must already be installed and configured.

  2. If you haven't done it already, login as the admin MacOS X user and install $(PRODUCT_NAME). The default installation process will create a "$PRODUCT_NAME" folder in the MacOS X "Applications" folder. All $PRODUCT_NAME files and folders will be installed in the $PRODUCT_NAME folder. Do not start $PRODUCT_NAME after the installation.

  3. In the /Applications/Utilities folder, start the "Terminal" application.
    At the command prompt use the following commands and use your admin user password when asked, in this example the admin user is "davidw". Also be sure that the Terminal gives you the same returns. If you experience any differences, you can always type "Exit" to log out from the root user and thereby (hopefully) protect against damage:

    Commandline (bold type = your input) Comments
    Welcome to Darwin!
    [localhost:~] davidw%
    When you start the Terminal and choose "New" in the "Shell" menu, you will see this in a new terminal window.
    [localhost:~] davidw% sudo su
    Password:
    SUDO SU gives you root access. Type your admin password and hit the return key.
    [localhost:/Users/davidw] root# cd /applications/sawmill/ Navigates you to the $PRODUCT_NAME folder. Note that the commandline says you are now "root#".
    [localhost:/applications/sawmill] root# ls -ls
    total 9104
    0 drwxrwxr-x 3 davidw admin 58 Apr 21 09:43 Extras
    24 -rwxr-xr-x 1 davidw admin 9348 Apr 21 09:43 License.txt
    8 -rwxrwxr-x 1 davidw admin 3113 Apr 21 09:43 ReadMe.txt
    0 drwxrwxr-x 3 davidw admin 58 Apr 21 09:43 $(PRODUCT_NAME).app
    0 drwxrwxr-x 6 davidw admin 160 Apr 21 09:43 Startup
    9072 -rwxr-xr-x 1 davidw admin 4641768 Apr 21 09:43 sawmill
    [localhost:/applications/sawmill] root# cd.. Navigate back to the Applications folder.
    [localhost:/applications] root# chown -R webstar sawmill Now be careful: key the command exactly as shown. This changes the ownership of all files in the $PRODUCT_NAME folder including the $PRODUCT_NAME folder itself.
    [localhost:/applications] root# cd sawmill Navigate into the $PRODUCT_NAME folder
    [localhost:/applications/sawmill] root# ls -ls
    total 9104
    0 drwxrwxr-x 3 webstar admin 58 Apr 21 09:43 Extras
    24 -rwxr-xr-x 1 webstar admin 9348 Apr 21 09:43 License.txt
    8 -rwxrwxr-x 1 webstar admin 3113 Apr 21 09:43 ReadMe.txt
    0 drwxrwxr-x 3 webstar admin 58 Apr 21 09:43 $(PRODUCT_NAME).app
    0 drwxrwxr-x 6 webstar admin 160 Apr 21 09:43 Startup
    9072 -rwxr-xr-x 1 webstar admin 4641768 Apr 21 09:43 sawmill
    This lists the files and folders in the $PRODUCT_NAME folder to check that the ownerships have really been changed. Note that the owner is now "webstar" instead of "davidw".
    [localhost:/applications/sawmill] root# exit
    exit
    [localhost:~] davidw%
    Log out the root user by typing "exit" and hit the return key. Note that the admin user is returned.

  4. Be sure that you have typed "exit" and you are now the admin user. Close Terminal.

  5. Log out of Mac OS X (not shut down, only log out).

  6. Log in as the "webstar" user.
You can now use $PRODUCT_NAME at the same time as running Webstar V.

Log formats

When choosing log formats in WebStar V's "Admin Client" for a specific website, use "WebSTAR Log Format". Select all tokens and schedule WebStar V to archive log files once every day.

In $PRODUCT_NAME's "Quick Start" you will be asked where the log files are located. WebStar V always creates log files for each defined website in the "logs" folder that is in the "WS_Admin" folder for each website.

$PRODUCT_NAME will automatically choose "WebSTAR Log format" and ONLY that format, if, and only if, the log is written correctly. If $PRODUCT_NAME gives you another log file format to choose from (including the correct format), then there is an error. $PRODUCT_NAME will only choose the correct log format when the first line in the log file, in the first log file that you want to be processed by $PRODUCT_NAME, has the correct log file header.

If you experience this error do the following:
1. Open the first log file that is supposed to be processed by $PRODUCT_NAME, in your favorite text editor on a MacOS X machine (this is important, since WebStar V log files now have file names that can be longer than 32 characters).

2. Find the first instance of the following text and move your cursor just before the text (with your date and time):
!!WebSTARSTARTUP 25/May/02 01:19:40
!!LOG_FORMAT BYTES_RECEIVED BYTES_SENT C-DNS.....

3. Mark all text from before the text and to the top of the file and delete the marked text. The above text should now be the very first text in the log. Save the file. Run "Quick Start" again.
{= end_docs_page() =}