⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configure.htm

📁 goahead是linux下的轻量级web服务器
💻 HTM
字号:
<html>
<head>
<title>Configuring WebServer</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../style/normal.htm"></head>

<body bgcolor="#FFFFFF">
<h1>Configuring WebServer</h1>
<p>To change the default settings and configuration of WebServer, you will need 
  to modify the Makefile and main program file (main.c) for your target operating 
  system. The table below outlines the settings and configuration operations available 
  on the current release, as well as the file you need to edit to make the change.</p>
<p>When editing source files, set your tab stop setting to 4.</p>
<TABLE WIDTH="90%" BORDER="0" CELLPADDING="6" ALIGN=CENTER>
  <TR BGCOLOR="#0066CC" ALIGN="NONE"> 
    <TD WIDTH="27%" ALIGN="NONE"><b><font color='#FFFFFF'>Item</font></b></TD>
    <TD WIDTH="52%"><b><font color='#FFFFFF'>Description</font></b></TD>
    <TD WIDTH="21%"><b><font color='#FFFFFF'>File</font></b></TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Document Root Directory</TD>
    <TD WIDTH="52%">The directory on the server in which Web documents will be 
      stored. For example, if you define /web/doc/ as the directory, and the URL 
      http://www.yourhost.com/myfile.htm is requested, the Web server will return 
      the file myfile.htm located in /web/doc/ (unless the file does not exist).</TD>
    <TD WIDTH="21%">main.c</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Default Server Home Page</TD>
    <TD WIDTH="52%">The Web page that is returned when the server is accessed 
      by its hostname (e.g., http://www.yourhost.com).</TD>
    <TD WIDTH="21%">main.c</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Default Directory Index File</TD>
    <TD WIDTH="52%">The name of the file that will be returned by default when 
      the URL requested is a directory path. For example, if the index file is 
      home.htm and the URL requested is http://www.yourhost.com/directory, the 
      server will return the file /directory/home.htm.</TD>
    <TD WIDTH="21%">main.c</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Password</TD>
    <TD WIDTH="52%">The password required to access your server</TD>
    <TD WIDTH="21%">main.c</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Port</TD>
    <TD WIDTH="52%">The port that the server will run on.</TD>
    <TD WIDTH="21%">main.c</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Retries</TD>
    <TD WIDTH="52%">The number of times the system will try a different port if 
      the specified port is not available.</TD>
    <TD WIDTH="21%">main.c</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Retrieve from ROM</TD>
    <TD WIDTH="52%">&nbsp;</TD>
    <TD WIDTH="21%">Makefile</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Enable Access Logging</TD>
    <TD WIDTH="52%">Enables logging of access to your server.</TD>
    <TD WIDTH="21%">Makefile</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Enable Keep-Alive</TD>
    <TD WIDTH="52%">Enables the HTTP 1.1 Keep-Alive feature (persistent connections)</TD>
    <TD WIDTH="21%">Makefile</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Enable If-Modified-Since</TD>
    <TD WIDTH="52%">Enables the HTTP If-Modified-Since request header field.</TD>
    <TD WIDTH="21%">Makefile</TD>
  </TR>
  <TR BGCOLOR="#FFFFCA"> 
    <TD WIDTH="27%" ALIGN="NONE">Enable Memory Leak Logging</TD>
    <TD WIDTH="52%">Enables logging of memory and stack statistics for debugging 
      purposes. </TD>
    <TD WIDTH="21%">Makefile</TD>
  </TR>
</TABLE>
<H2>Document Root Directory</H2>
<P>The WebServer default document root directory is &quot;web&quot;, which is 
  created under webserver/ when 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).</P>
<PRE>     *rootWeb = T(&quot;web&quot;);</PRE>
<P>Change <TT>web</TT> to the new directory name.</P>
<H2>Default Server Home Page</H2>
<P>The WebServer default home page is &quot;home.asp&quot;. 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):</P>
<PRE>     websRedirect(wp, T(&quot;home.asp&quot;));</PRE>
<P>Change <TT>home.asp</TT> 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.</P>
<H2>Default Directory Index File</H2>
<P>The WebServer default directory index file is set to &quot;default.asp&quot;. 
  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):</P>
<PRE>     websSetDefaultPage(T(&quot;default.asp&quot;));</PRE>
<P>Change <TT>default.asp</TT> to the file name you want to use. Note that, if 
  a &quot;default.asp&quot; is not found in the directory requested by the browser, 
  the server will return a 404 Document Not Found error.</P>
<H2>Password</H2>
<P>The default 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):</P>
<PRE>     *password = T(&quot;&quot;);</PRE>
<P>Insert the password you want to use inside the quotation marks.</P>
<H2>Port</H2>
<P>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):</P>
<PRE>      port = 80;</PRE>
<H2>Retries</H2>
<P>By default, 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):</P>
<PRE>     retries = 5;</PRE>
<H2>Retrieve From ROM</H2>
<P>By default, WebServer retrieves Web pages from a file system. To force WebServer 
  to retrieve Web pages from ROM, set the following compiler define in the Makefile 
  for your target operating system.</P>
<PRE>     WEBS_PAGE_ROM</PRE>
<P><B>Note:</B> This release of 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.</P>
<H2>Enable Access Logging</H2>
<P>To enable logging of access to your server, set the following compiler define 
  in the Makefile of your target operating system.</P>
<PRE>     WEBS_LOG_SUPPORT</PRE>
<P><B>Note:</B> The content and format of the information logged is found in a 
  gsnprintf function call within the function websLog located in webs.c.</P>
<H2>Enable Keep-Alive</H2>
<P>To enable HTTP 1.1 Keep-Alive support, set the following compiler define in 
  the Makefile for your target operating system.</P>
<PRE>     WEBS_KEEP_ALIVE_SUPPORT</PRE>
<P>The code for this feature has not been fully tested in this release so it may 
  required some debugging.</P>
<H2>Enable If-Modified-Since</H2>
<P>To enable support for the HTTP If-Modified-Since request header field, set 
  the following compiler define in the Makefile for your target operating system.</P>
<PRE>     WEBS_IF_MODIFIED_SUPPORT</PRE>
<P><B>Note:</B> Date parsing has not been implemented in this release, therefore 
  developers wishing to use this feature will need to write code for parsing the 
  incoming date and time.</P>
<H2>Enable Memory Leak</H2>
<P>To enable the logging of memory and stack statistics for debugging purposes, 
  set the following compiler define in the Makefile for your target operating 
  system.</P>
<PRE>     B_STATS</PRE>
<P>If B_STATS is defined, the memLeaks function, when called, will output the 
  balloc (basic allocation) statistics to a file called &quot;leak.txt&quot; in 
  the directory from which the 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.</P>
<H2>Additional Configuration Notes</H2>
<H3>UEMF Symbolic Constant</H3>
<P>Make sure the symbolic constant UEMF is defined in the command line arguments 
  to the compiler in the Makefile of the target operating system.</P>
<H3>Windows CE and UNICODE</H3>
<P>The 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.</P>
<H3>Windows 95/98/NT</H3>
<P>When you run 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).</P>
<PRE>     *title = T(&quot;GoAhead WebServer&quot;);
     *name = T(&quot;gowebs&quot;);</PRE>
<H3>VXWORKS</H3>
<P>You 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).</P>
<P>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.</P>
<P>&nbsp;</P>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -