parameters: (document_root=None, output_dir=None, apache2=False)
return_statement: return httpd
docstring: Starts a local server on port 8000 using the basic configuration files.
  
    Args:
      document_root: If present, specifies the document root for the server;
          otherwise, the filesystem's root (e.g., C:/ or /) will be used.
      output_dir: If present, specifies where to put server logs; otherwise,
          they'll be placed in the system's temp dir (e.g., $TEMP or /tmp).
      apache2: boolean if true will cause this function to configure
               for Apache 2.x as opposed to Apache 1.3.x
  
    Returns: the ApacheHttpd object that was created
docstring_summary: Starts a local server on port 8000 using the basic configuration files.
docstring_tokens: Starts a local server on port 8000 using the basic configuration files .
function: def StartServer(document_root=None, output_dir=None, apache2=False):
    """Starts a local server on port 8000 using the basic configuration files.
  
    Args:
      document_root: If present, specifies the document root for the server;
          otherwise, the filesystem's root (e.g., C:/ or /) will be used.
      output_dir: If present, specifies where to put server logs; otherwise,
          they'll be placed in the system's temp dir (e.g., $TEMP or /tmp).
      apache2: boolean if true will cause this function to configure
               for Apache 2.x as opposed to Apache 1.3.x
  
    Returns: the ApacheHttpd object that was created
    """
    script_dir = google.path_utils.ScriptDir()
    platform_util = google.platform_utils.PlatformUtility(script_dir)
    if not output_dir:
      output_dir = platform_util.GetTempDirectory()
    if not document_root:
      document_root = platform_util.GetFilesystemRoot()
    apache_config_dir = ApacheConfigDir(script_dir)
    if apache2:
      httpd_conf_path = os.path.join(apache_config_dir, 'httpd2.conf')
    else:
      httpd_conf_path = os.path.join(apache_config_dir, 'httpd.conf')
    mime_types_path = os.path.join(apache_config_dir, 'mime.types')
    start_cmd = platform_util.GetStartHttpdCommand(output_dir,
                                                   httpd_conf_path,
                                                   mime_types_path,
                                                   document_root,
                                                   apache2=apache2)
    stop_cmd = platform_util.GetStopHttpdCommand()
    httpd = ApacheHttpd(start_cmd, stop_cmd, [8000],
                        cygserver_path=GetCygserverPath(script_dir, apache2))
    httpd.StartServer()
    return httpd
function_tokens: def StartServer ( document_root = None , output_dir = None , apache2 = False ) : script_dir = google . path_utils . ScriptDir ( ) platform_util = google . platform_utils . PlatformUtility ( script_dir ) if not output_dir : output_dir = platform_util . GetTempDirectory ( ) if not document_root : document_root = platform_util . GetFilesystemRoot ( ) apache_config_dir = ApacheConfigDir ( script_dir ) if apache2 : httpd_conf_path = os . path . join ( apache_config_dir , 'httpd2.conf' ) else : httpd_conf_path = os . path . join ( apache_config_dir , 'httpd.conf' ) mime_types_path = os . path . join ( apache_config_dir , 'mime.types' ) start_cmd = platform_util . GetStartHttpdCommand ( output_dir , httpd_conf_path , mime_types_path , document_root , apache2 = apache2 ) stop_cmd = platform_util . GetStopHttpdCommand ( ) httpd = ApacheHttpd ( start_cmd , stop_cmd , [ 8000 ] , cygserver_path = GetCygserverPath ( script_dir , apache2 ) ) httpd . StartServer ( ) return httpd