def start_server_servestatic(*args, **options):
    """
    Start CherryPy server AND serve default static files

    Want SSL support?
    a. The new (3.1 or 3.2) way: Just set server.ssl_adapter to an SSLAdapter 
       instance.

    b. The old way (deprecated way) is to set these attributes:

       server.ssl_certificate = <filename>
       server.ssl_private_key = <filename>

       But this is the only way from the management command line
       in the future I may need to adapt this to use a server.ssl_adapter
    """
    
    options['mount'] = '/' + settings.MOUNT
    splunkdj_port = settings.DJANGO_PORT
    options['port'] = int(options.get('port', splunkdj_port))

    print 'starting server with options: %s' % json.dumps(options, sort_keys=True, indent=2)
    
    if options['daemonize'] and options['server_user'] and options['server_group']:
        #ensure the that the daemon runs as specified user
        change_uid_gid(options['server_user'], options['server_group'])
    
    from wsgiserver.server import CherryPyWSGIServer, WSGIPathInfoDispatcher

    app = LoggingWSGIHandler()
    
    if options['adminserve']: # serve the admin media too
        # AdminMediaHandler is middleware for local use
        import django.core.servers.basehttp
        app = django.core.servers.basehttp.AdminMediaHandler(app)
    # another way to serve the admin media three application
    path = { 
        options['mount']: app,
        settings.STATIC_URL: mediahandler.MediaHandler(settings.STATIC_ROOT),
    }
    dispatcher =  WSGIPathInfoDispatcher(path)
        
    server = CherryPyWSGIServer(
        (options['host'], int(options['port'])),
        dispatcher,
        int(options['threads']), 
        options['server_name']
    )
    if options['ssl_certificate'] and options['ssl_private_key']:
        server.ssl_certificate = options['ssl_certificate']
        server.ssl_private_key = options['ssl_private_key']  
    try:
        server.start()
    except KeyboardInterrupt:
        server.stop()
dataset/ETHPy150Open splunk/splunk-webframework/server/splunkdj/management/commands/runwsgiserver.py/start_server_servestatic/original