Configuring GoAhead WebServerTo change the default settings and configuration of GoAhead WebServer, you will need to modify the Makefile and main program file (main.c) for your target operating system (OS). To find out the name of the Makefile for your target OS, read your operating system's compile instructions provided in Installing GoAhead WebServer. The table below outlines the settings and configuration operations available in the current release, as well as the file you need to edit to make the change. When editing source files, set your tab stop setting to 4.
|
User ManagementTo enable the User Management API, which provides the user and security database, set the following compiler define in the Makefile for your target operating system.
The code for the user management functions reside in these files:
Digest Access AuthenticationTo enable the use of Digest Access Authentication, which provides encrypted password authentication, set the following compiler define in the Makefile for your target operating system:
The source code files, websda.c and md5c.c, contain the digest calculation routines. The files, webs.c, webs.h and security.c contain code that is activated when this compiler switch is defined. Document Root DirectoryThe GoAhead WebServer default document root directory is "web", which is created under webserver/ when GoAhead WebServer is installed and compiled. To change the directory, edit the following portion of code in the Web server's main program file (main.c). *rootWeb = T("web"); Change web to the new directory name. Default Server Home PageThe GoAhead WebServer default home page is "home.asp". To change the page, edit the following portion of code in the Home page handler function located in the server's main program file (main.c): websRedirect(wp, T("home.asp")); Change home.asp to the name of file you want to use as the home page and make sure to save the file in the document root directory. Default Directory Index FileThe GoAhead WebServer default directory index file is set to "default.asp". To change the file, edit the following portion of code in the Home page handler function located in the server's main program file (main.c): websSetDefaultPage(T("default.asp")); Change default.asp to the file name you want to use. Note that, if a "default.asp" is not found in the directory requested by the browser, the server will return a 404 Document Not Found error. PasswordThe default GoAhead WebServer password is blank. In other words, no password is required to access the server. To password-protect your server, edit the following portion of code in the Home page handler function located in the server's main program file (main.c): *password = T(""); Insert the password you want to use inside the quotation marks. PortGoAhead WebServer runs on port 80 by default. To change the server port, edit the following portion of code in the Home page handler function located in the server's main program file (main.c): port = 80; RetriesBy default, GoAhead WebServer retries five times to find an alternative port when the default port is not available. To change the number of retries, edit the following portion of code in the Home page handler function located in the server's main program file (main.c): retries = 5; Retrieve From ROMBy default, GoAhead WebServer retrieves Web pages from a file system. To force GoAhead WebServer to retrieve Web pages from ROM, set the following compiler define in the Makefile for your target operating system. WEBS_PAGE_ROM Note: This release of GoAhead GoAhead WebServer includes WebCompiler, which creates ROMable C source code for a set of Web documents. See the Readme (readme.txt) for information on using the compiler. Enable Access LoggingTo enable logging of access to your server, set the following compiler define in the Makefile of your target operating system. WEBS_LOG_SUPPORT Note: The content and format of the information logged is found in a gsnprintf function call within the function websLog located in webs.c. Enable Keep-AliveTo enable HTTP 1.1 Keep-Alive support, set the following compiler define in the Makefile for your target operating system. WEBS_KEEP_ALIVE_SUPPORT The code for this feature has not been fully tested in this release so it may required some debugging. Enable If-Modified-SinceTo enable support for the HTTP If-Modified-Since request header field, set the following compiler define in the Makefile for your target operating system. WEBS_IF_MODIFIED_SUPPORT Enable Memory Leak LoggingTo enable the logging of memory and stack statistics for debugging purposes, set the following compiler define in the Makefile for your target operating system. B_STATS If B_STATS is defined, the memLeaks function, when called, will output the balloc (basic allocation) statistics to a file called "leak.txt" in the directory from which the GoAhead WebServer executable was launched (webs). In the current release, the only call to memLeaks occurs in the main program (main.c) when the program does a normal exit. Developers can add the function to other appropriate locations to aid in the debugging process. Additional Configuration NotesUEMF Symbolic ConstantMake sure the symbolic constant UEMF is defined in the command line arguments to the compiler in the Makefile of the target operating system. Windows CE and UNICODEThe symbolic constant UNICODE needs to be defined in the Makefile for Windows CE compilations or any other builds that need to use unicoded character strings. Windows 95/98/NTWhen you run GoAhead WebServer, an icon is added to your Windows Taskbar. You can set the title and name of the icon's window by modifying the following two portions of code in the main program (main.c). *title = T("GoAhead GoAhead WebServer"); *name = T("gowebs"); VXWORKSYou may need to change the CC (compiler), AR (archiver) and LD (linker/loader) definitions in the VXWORKS Makefile if you are using a different BSP (Board Support Package). You will need to change the variable ROOT_DIR in the main program (main.c) to reflect the name of the root directory for your file system.
|