📄 main.pi3
字号:
#!../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/SiteRoot.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
# 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
# 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|SetPeerAddress|SetLocalAddress
</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" Flag="Verbose"
#
# 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
HostMap ReturnCode ReturnCode=COMPLETED
# Mapping DirectoryMappings
#
# Default mappings
#
Mapping MapToErrorDocument \
IgnoreStatus="0 200" \
DefaultMessage="/errors/unknown.htm" \
301="/errors/301.ssi" \
304="/errors/304.ssi" \
400="/errors/400.htm" \
401="/errors/401.ssi" \
403="/errors/403.ssi" \
404="/errors/404.ssi" \
500="/errors/500.ssi" \
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)"
#
# Default document root
#
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"
#
# Cause a '501 Not Implemented' Message for requests that
# are not 'GET' or 'HEAD', i.e.
# if !( Method=='GET' || Method=='HEAD' )
# then
# set status = 501
# endif
#
CheckType Condition="¬(&or(&cmpi($m,GET),&cmpi($m,HEAD)))" \
StatusCode StatusCode="501"
# 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(¬(&dblookup(response,string,ObjectMap)),\
¬(®exp('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 SendFile
Log AccessLogger File="Logs\Access.txt"
Log ReturnCode ReturnCode=COMPLETED
Destroy DeleteTemporaryFiles
</Object>
# ---
#
# SiteRoot object, root for this website
#
# ---
<Object>
Name TopSiteRoot
Class SiteRootClass
LogicObject "Default"
ConfigFile "P:/Parent.Com/Conf/Config.pi3"
</Object>
# ---
#
# HTTPLogicObject
#
# HTTP Logic object, dispatches requests to all other handlers
#
# ---
<Object>
Name HTTPLogicObject
Class HTTPDispatcherClass
AddMIMEEntry "ai application/postscript"
AddMIMEEntry "aif audio/x-aiff"
AddMIMEEntry "aifc audio/x-aiff"
AddMIMEEntry "aiff audio/x-aiff"
AddMIMEEntry "au audio/basic"
AddMIMEEntry "avi video/x-msvideo"
AddMIMEEntry "bcpio application/x-bcpio"
AddMIMEEntry "bin application/octet-stream"
AddMIMEEntry "bmp image/x-MS-bmp"
AddMIMEEntry "c text/x-code"
AddMIMEEntry "cc text/x-code"
AddMIMEEntry "cdf application/x-netcdf"
AddMIMEEntry "class application/octet-stream"
AddMIMEEntry "cpio application/x-cpio"
AddMIMEEntry "cpp text/x-code"
AddMIMEEntry "csh application/x-csh"
AddMIMEEntry "cxx text/x-code"
AddMIMEEntry "dcr application/x-director"
AddMIMEEntry "dip image/x-MS-bmp"
AddMIMEEntry "dir application/x-director"
AddMIMEEntry "dms application/octet-stream"
AddMIMEEntry "doc application/msword"
AddMIMEEntry "dvi application/x-dvi"
AddMIMEEntry "dxr application/x-director"
AddMIMEEntry "eps application/postscript"
AddMIMEEntry "etx text/x-setext"
AddMIMEEntry "exe application/octet-stream"
AddMIMEEntry "fcgi internal/x-fastcgi"
AddMIMEEntry "gif image/gif"
AddMIMEEntry "gtar application/x-gtar"
AddMIMEEntry "gz application/x-gzip"
AddMIMEEntry "hdf application/x-hdf"
AddMIMEEntry "htm text/html"
AddMIMEEntry "html text/html"
AddMIMEEntry "html-ssi internal/x-server-parsed-html"
AddMIMEEntry "ice x-conference/x-cooltalk"
AddMIMEEntry "ief image/ief"
AddMIMEEntry "imap internal/x-imagemap"
AddMIMEEntry "jpe image/jpeg"
AddMIMEEntry "jpeg image/jpeg"
AddMIMEEntry "jpg image/jpeg"
AddMIMEEntry "kar audio/midi"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -