KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: How to run the WebSTAR and 4D Web Servers simultaneously on port 80 on the same
PRODUCT: 4D | VERSION: 6.7.1 | PLATFORM: Mac
Published On: August 3, 2001
Your current browser may not allow you to download the asset. We recommend Mozilla Firefox or Google Chrome.
Log In

With Mac OS 8.1, Open Transport 1.3, and all later versions of these, it is now possible to have the WebSTAR server host a number of different Web sites on different IP numbers, using Virtual Hosts and IP Multi-Homing. This is done with the "IP Secondary Addresses" file located in your System Preferences folder. This is a text file which can be created with SimpleText or preferably BBEdit.

Note: Without multiple IP addresses you simply map the Primary IP Address to a Virtual Host (domain) and have WebSTAR route the URL request to the root folder of any given Virtual Host. With Multi-Homing you can actually respond to different IP addresses from the same machine.

If you do not already have an "IP Secondary Addresses" file present, the WebSTAR Installer will create a demo version of this file for you. Simply enter only your multiple secondary IP Addresses in this file and restart your computer. A restart is needed so that the information will be loaded and used by Open Transport. If the multiple IP Addresses are all on the same subnet mask and router, there is no need to enter this information. When a connection is made, Open Transport will use the default information listed in TCP/IP. A simple way of configuring this file, if all IP numbers are on the same subnet and router numbers, would be just e.g.:
ip=192.168.0.1

Make sure there are no erroneous characters (including no tabs) in this file, which is why using BBEdit with "show invisibles" and "show spaces" turned on in its preferences is helpful. There must be only letters, the equals sign, numbers, spacebar characters, and one Mac line break at the end of each line.

How to Configure TCP/IP

In the TCP/IP control panel, make sure that manual addressing is being used. If on a DHCP system, this will need to be changed to manual, entering into the "IP" field the IP address previously given dynamically. Enter the Primary IP address along with subnet and router information.

At startup, Open Transport looks for, and loads if present, the "IP Secondary Addresses" file. Open Transport checks this file to determine what other IP addresses this system supports. When a browser connects to your machine, Open Transport does routing based on the IP address. The WebSTAR server then looks in the Virtual Hosts table and routes the URL request to the root folder for the Virtual Host the browser requested.

If any Secondary IP address listed in the "IP Secondary Addresses" file is being used by another computer, a reboot of the Router will be needed in order to flush the router's "ARP" table. Also in TCP/IP, remember to enter the Name Server address; if you fail to enter this information DNS will not work.

How to Configure the 4D Web Server

Launch 4D, select to open your database. From Database Properties select the "Web Server I" tab using the pull-down menu of the IP Address field. Select the Secondary IP Address you want 4D to listen on. If the multiple IP Addresses that you have entered do not show up in this pull-down menu, the "IP Secondary Addresses" file has not been configured properly. If the multiple IP Addresses do show up, all is well and 4D Web serving can now be tested. Make sure port 80, the default port, is entered, and make sure that the Web server has started from the 4D "User Environment."

Caution

Always launch 4D first, including with aliases in the System Startup folder, to avoid having WebSTAR listen on the same IP address(es).

Then launch WebSTAR and WebSTAR Admin. Once both have started, select Virtual Hosts, and in the IP Address pull-down menu make sure WebSTAR is viewing the multiple IP addresses propagated from Open Transport. Test your site. Look in the WebSTAR Status window as the request hits your WebSTAR server.

Troubleshooting:

With 4D Server and WebSTAR running, type the IP address that 4D is listening on into your browser. Verify that in your WebSTAR Status window, no request for that IP Address shows up. This lets you know WebSTAR is not answering the request.

Note: This tech tip generally applies to any Web-serving application (other than AppleShare Web services) that you choose to run on the same computer as WebSTAR, running on port 80 and using IP Secondary Addresses. For best serving speed, it is always best to run 4D and WebSTAR on separate machines.