def set_server_conf(config, input, session):
    if os.path.exists(LIGHTTPD_CONF_TEMP_DIR) is False:
        os.mkdir(LIGHTTPD_CONF_TEMP_DIR)

    tmp_file_names = {}

    # port.conf
    try:
        port_conf_path = LIGHTTPD_CONF_TEMP_DIR + "/kss_port_" + uniq_filename()
        port_conf = LighttpdPortConf(port_conf_path)
        port_conf.write(input)
        tmp_file_names["port"] = port_conf_path
    except AttributeError:
        raise KaresansuiGadgetException(
            "Failed to write configuration value input.port=%s at %s" % (input.port, port_conf_path)
        )

    # access.conf
    try:
        access_conf_path = LIGHTTPD_CONF_TEMP_DIR + "/kss_access_" + uniq_filename()
        access_conf = LighttpdAccessConf(access_conf_path)
        access_conf.write(input)
        tmp_file_names["access"] = access_conf_path
    except AttributeError:
        raise KaresansuiGadgetException(
            "Failed to write configuration value input.access=%s, input.access_ipaddress=%s, input.ip_list=%s at %s"
            % (input.access, input.network, input.access_ipaddress, access_conf_path)
        )

    # ssl.conf
    try:
        ssl_conf_path = LIGHTTPD_CONF_TEMP_DIR + "/kss_ssl_" + uniq_filename()
        ssl_conf = LighttpdSslConf(ssl_conf_path)
        ssl_conf.write(input)
        tmp_file_names["ssl"] = ssl_conf_path
    except AttributeError:
        raise KaresansuiGadgetException(
            "Failed to write configuration value input.ssl_status=%s at %s" % (input.ssl_status, ssl_conf_path)
        )

    config["application.uniqkey"] = input.uniqkey

    # check temporary files
    for key in ("port", "access", "ssl"):
        if not tmp_file_names.has_key(key):
            raise KaresansuiGadgetException("Failed to make temporary file for %s", key)
        elif os.path.isfile(tmp_file_names[key]) is False:
            raise KaresansuiGadgetException("Not exist temporary file for %s", key)

    return tmp_file_names