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

📄 config.pi3

📁 mini http server,可以集成嵌入到程序中,实现简单的web功能
💻 PI3
📖 第 1 页 / 共 3 页
字号:
#!../bin/Pi3

#+++---AD Generated Section, modifications will be lost---+++
# ===
#
#	AUTOMATICALLY GENERATED FILE
#
#	This files was automatically generated by the Pi3 enhanced GUI
#	(EnhPi3.exe) for Windows 95 and Window NT 4.0
#
#	Any changes you make to this file will be lost next time the 
#	configuration GUI (server admin) is run and changes 
#	are saved.
#
# ===


# ===
#
# Top level configuration
#
#	** IMPORTANT **
#	If you do nothing else then do this:
#

#... ### ### Customize server settings

# Skip below to the definition of 'MainVirtualHostInformation', change
# the settings for Hostname (*Mandatory* redirects will not work without
# this!) and Administrator (optional).
#
# ===

# Include  standard IO and server stuff
include ../Conf/IO.cnf
include ../Conf/Server.cnf
include ../Conf/Pi3API.cnf
include ../Conf/HTTP.cnf
include ../Conf/Fcgi.cnf
include ../Conf/Plugins.cnf
include ../Conf/ISAPI.cnf
include ../Conf/PHP4.cnf
include ../Conf/SSL.cnf

# ---
#
# IO Object for main listening socket.
#
# ---
<Object>
    Name ServerIOObject
    Class TCPIPIOClass
    Type Passive

# A hostname must be specified for the Pi3Web HTTP server. The hostname
# will be used by the server lookup the IP address that this server will
# listen on. A value of INADDR_ANY let the server listen on any IP address.
	BindHost localhost

# A TCP port must be specified for this HTTP server. The TCP port
# is the port that the HTTP will listen for requests on. This is
# typically 80 for HTTP servers. 
#
# Note that UNIX operating systems normally require that the server
# initially run as user 'root' to bind on ports between 0 and 1024
	BindPort 80
#	BindPort 443

# Timeout accepting connections. -1 specifies no timeout.
	AcceptTimeout -1

# Specify timeout for sending data. -1 specifies no timeout. 
	RecvTimeout 400

# Specify timeout for receiving data. -1 specifies no timeout. 
	SendTimeout 350

	PeerIPVariable STRING:RemoteAddr
	PeerHostNameVariable STRING:RemoteHost
	LocalAddressVariable STRING:LocalAddr
	ServerPortVariable RFC822:ServerPort
	
# Flags
#
#   OwnDB - Object adds its own DB, rather than use the parents
#               this is necessary to avoid collision of values placed in
#               the DB between different connection. 
#
#   SetPeerAddress - IP address of remote peer with be put
#               into the specified variable.
#
#   DNSReverseLookup - Use reverse DNS to get the hostname of the 
#               peer and place it in the specified variable.
#
#   SetLocalAddress - Put local address in the specified variable.
	Flags OwnDB|DNSReverseLookup|SetPeerAddress|SetLocalAddress
</Object>

# ---
#
# SSL IO filter object
#
# ---
<Object>
    Name SSLIOObject
    Class SSLClass

# Type, passive (server) or active (client)
	Type "Passive"

# SSL version, "2"=SSLv2 only, "3"=SSLv3 only and "23"=SSLv2 or SSLv3
	Version 23

# Verify depth to verify client certificates before giving up.
	VerifyDepth 1

# Client certificate verification,
#	0=No verification performed
#	1=Certificate is verified, but not mandatory
#	2=Certificate must be present
	Verify 0

# lower level IO object that SSL layer uses for transport
#	IOObject SnoopIO IOObject="ServerIOObject" OutFile="./encrypt.dbg" Flag="Verbose"
	IOObject ServerIOObject

	CACertificatePath "./"
	CACertificateFile "cacert.pem"

# insert the name of your key file here
	PrivateKeyFile "./key.pem"

# insert the name of your certificate file here
	CertificateFile "./cert.pem"

# DebugFile output, filename or 'STDERR' or 'STDOUT'
#	DebugFile "STDERR"
#	DebugFile "../Logs/SSL.txt"

# Flag, miscellanious options, "Bugs", "Hack", etc.
	Flag "Bugs"
	Flag "Hack"

# List of acceptable ciphers, disable to allow all valid cipher suites.
#	CipherList "DEFAULT"
#	CipherList "NULL-MD5"
	CipherList "!ADH:RC4+RSA:HIGH:MEDIUM:LOW:EXP:+SSLv2:+EXP"
</Object>

# ---
# Main virtual host object.
# ---
<Object>
	Name MainVirtualHostInformation
	Class VirtualHostClass
	Administrator webmaster@localhost
	HostName localhost
</Object>

# ---
#
#    Thread dispatch object
#
#   This is an instance of MultiThreadedIOServerClass with appropriate
#   parameters
#
# ---
<Object>
	Name ThreadPoolDispatcher
	Class MultiThreadedIOServerClass

# The IOObject is the object that will be used for the listening socket
# it can be a real IOObject (such as TCP/IP), as test IO object which 
# feeds stub data into the server or a filter IO object which encrpts
# or logs data passed through it.
#
#    Example test IO object:
# 	IOObject TestIOObject
#
#    Log IO to file:
#	IOObject SnoopIO IOObject="ServerIOObject" OutFile="./snoop.dbg"
#
	IOObject ServerIOObject

# Dispatch accepted IO connection to the HTTPLogicObject
	LogicObject HTTPLogicObject

# Number of threads to use 

	MaxThreads 20

# Number of requests to exit after
	ExitAfter 1000

</Object>


# ---
#
# Main Pi3 object. 
#
# This is an instance of the UNIXDaemonClass to fork the server into
# one monitor process and 'NumberOfProcesses' child processes. 
#
# The monitor process automatically starts a new child processes whenever
# a child process exits.
#
# ---
<Object>
	Name Main
	Class UNIXDaemonClass

# Actual class to accept new IO requests and dispatch them
	ServerObject ThreadPoolDispatcher
	PIDFile "../Logs/pid.log"
	RLimitCpu Maximum

# User that child processes will run as. Server must run as root to 
# be able to change to the specified user. A user id number can be
# specified with #number. Server which start with root privileges should
# change to a user id with lesser privileges for security reasons.
#   User nobody

# Group that child processes will run as. Server must run as root to
# be able to change to a different group. A group id number can be
# specified with #number.
#   Group #-1

# generate a server unique lockfile name and write it into
# Logs/lockfile.txt
	LockFileName "../Logs/lockfile.txt"

# Message to write just before the server is ready to start accepting
# connections.
# default
	Message "Pi3Web HTTP Server Started"

# Specify the number of processes. 

	NumberOfProcesses 8
</Object>


# ---
#
# Start
#
#	Handle initial phases of requests, typically before we have enough
#	information to select different execution paths
#
# ---
<Object>
	Name Start
	Class FlexibleHandlerClass
	Init ReturnCode ReturnCode=COMPLETED
	Headers ReadRequestHeaders ReturnCode=COMPLETED
	HostMap ReturnCode ReturnCode=COMPLETED
#	Mapping DirectoryMappings

	#
	# Default mappings
	#
	Mapping MapToErrorDocument \
		IgnoreStatus="0 200" \
		DefaultMessage="/errors/unknown.htm" \
		301="/errors/301.htm" \
		304="/errors/304.htm" \
		400="/errors/400.htm" \
		401="/errors/401.htm" \
		403="/errors/403.htm" \
		404="/errors/404.htm" \
		500="/errors/500.htm" \
		501="/errors/501.htm"
#	Mapping UserDirectory UserDirectoryRoot="/home/" \
#		HTMLDirectory="/public_html"
	Mapping CGIMapper From="/cgi-bin/" To="Cgi-Bin\"
	Mapping WinCGIMapper From="/cgi-win/" To="Cgi-Win\"
	Mapping FCGIMapper From="/cgi-fcgi/" To="Cgi-Fcgi\"
	Mapping PathMapper From="/pidocs/" To="Pi3Docs\"
	Mapping PathMapper From="/icons/" To="Icons\"
	Mapping PathMapper From="/images/" To="Images\"
	Mapping PathMapper From="/errors/" To="Fragment\"
	Mapping ISAPIMapper From="/isapi/" To="Isapi\" 
	Mapping PathMapper From="/admin/" To="Logs\" \
		Action="&dbreplace(response,string,AuthenticationRealm,Administration)"
	Mapping PathMapper From="/" To="WebRoot\"
</Object>


# ---
#
# Default
#
#	Handle requests that other handlers have passed up
#
# ---
<Object>
	Name Default
	Class FlexibleHandlerClass
	CheckPath DirectoryExists IndexFile="index.ssi" IndexFile="index.html" IndexFile="index.htm" IndexFile="default.ssi" IndexFile="default.htm" IndexFile="default.html"
	CheckPath RefuseFileByMask AllowFileMask="EF" RefuseStatus=404
	CheckPath RefuseFileByMask AllowFileMask="F" RefuseStatus=403
	CheckPath ReturnCode ReturnCode=COMPLETED
	CheckAuth Authenticate
	CheckAccess AccessByFile RequirePermissions="R"

#	CheckType ConditionalGet Flag="RefreshOlderThanServer"
	CheckType ConditionalGet 
	CheckType CheckForDirectory SetType="internal/x-directory"

	#
	# Otherwise: Set the media type based on the file extension
	#
	CheckType MIMETypeByExtension 

	#
	# Return 'COMPLETED' so an internal error will not be raised
	#
	CheckType ReturnCode ReturnCode="COMPLETED"

	#
	# Most requests refer to a file, so put that first 
	#
	# Handle the request by sending a file if
	#	- The Value of ObjectMap in the response DB is ""
	#	AND
	#	- The Media type of the resource does not match internal/* 
	#
	Handle Condition="&and(&not(&dblookup(response,string,ObjectMap)),\
&not(&regexp('internal/*',$c)))" SendFile
	Handle Condition="&cmp($c,internal/x-directory)" TableHTML
	Handle Condition="&cmp($c,internal/x-server-parsed-html)" SendSSI \
		Exec=Yes ExecFileFixup="\n/* exec file="" maps to Standard CGI (Scripts) */\
&dbreplace(response,string,ObjectMap,Scripts)\n&dbreplace(response,rfc822,Content-Type,internal/x-cgi)"
	Handle Condition="&cmp($c,internal/x-imagemap)" ImageMap
	Handle Condition="&cmp($c,internal/x-server-parsed-php)" PHP4
	Handle SendFile
	Log AccessLogger File="Logs/access.txt" 
	Log ReturnCode ReturnCode=COMPLETED
	Destroy DeleteTemporaryFiles
</Object>


# ---
#
# HTTPLogicObject
#
# 	HTTP Logic object, dispatches requests to all other handlers
#
# ---
<Object>
	Name HTTPLogicObject
	Class HTTPDispatcherClass
	AddMIMEEntry "xls	application/msexcel"
	AddMIMEEntry "xlt	application/msexcel"
	AddMIMEEntry "doc	application/msword"
	AddMIMEEntry "bin	application/octet-stream"
	AddMIMEEntry "dms	application/octet-stream"
	AddMIMEEntry "lha	application/octet-stream"
	AddMIMEEntry "lzh	application/octet-stream"
	AddMIMEEntry "exe	application/octet-stream"
	AddMIMEEntry "class	application/octet-stream"
	AddMIMEEntry "oda	application/oda"
	AddMIMEEntry "pdf	application/pdf"
	AddMIMEEntry "ai	application/postscript"
	AddMIMEEntry "eps	application/postscript"
	AddMIMEEntry "ps	application/postscript"
	AddMIMEEntry "ppt	application/powerpoint"
	AddMIMEEntry "rtf	application/rtf"
	AddMIMEEntry "bcpio	application/x-bcpio"
	AddMIMEEntry "vcd	application/x-cdlink"
	AddMIMEEntry "cpio	application/x-cpio"
	AddMIMEEntry "csh	application/x-csh"
	AddMIMEEntry "dcr	application/x-director"
	AddMIMEEntry "dir	application/x-director"
	AddMIMEEntry "dxr	application/x-director"
	AddMIMEEntry "dvi	application/x-dvi"
	AddMIMEEntry "gtar	application/x-gtar"
	AddMIMEEntry "gz	application/x-gzip"
	AddMIMEEntry "hdf	application/x-hdf"
	AddMIMEEntry "skp	application/x-koan"
	AddMIMEEntry "skd	application/x-koan"
	AddMIMEEntry "skt	application/x-koan"
	AddMIMEEntry "skm	application/x-koan"
	AddMIMEEntry "latex	application/x-latex"
	AddMIMEEntry "mif	application/x-mif"
	AddMIMEEntry "nc	application/x-netcdf"
	AddMIMEEntry "cdf	application/x-netcdf"
	AddMIMEEntry "sh	application/x-sh"
	AddMIMEEntry "shar	application/x-shar"

⌨️ 快捷键说明

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