📄 features.pi3
字号:
#!Pi3
# ===
#
# Top level configuration file
#
# ** 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
# ---
#
# 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 60
# Specify timeout for receiving data. -1 specifies no timeout.
SendTimeout 45
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|SetPeerAddress|DNSReverseLookup|SetLocalAddress
# Pointer to file with lockfile name, to avoid collisions on accept
# with multiple processes
AcceptLockFile "../Logs/lockfile.txt"
</Object>
# ---
#
# Main virtual host object.
#
# ---
<Object>
Name MainVirtualHostInformation
Class VirtualHostClass
# Administrator for the primary virtual host
Administrator webmaster@localhost
# Hostname that this server uses in redirects.
HostName localhost
# Port that the server uses in redirects.
# Specify it only if it is not the standard port for the protocol in
# use, i.e. 80 for HTTP and 443 for HTTPS
# ServerPort 80
</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 10
# 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>
# ===
#
# Features.pi3
#
# Showcase features of Pi3Web server. Use this configuration
# only for personal or workgroup use. Its not optimal
# for use on the public internet. Here's why:
#
# - Performance is slower because of all the extra
# handlers that are added in and the funky things that they
# do.
#
# - Bigger and more complex is less secure against
# attack than smaller and featureless. The server created
# by this configuration is bigger and more complex.
#
# ===
#
# Load library definitions for classes used here.
#
include ../Conf/HTTP.cnf
include ../Conf/Fcgi.cnf
include ../Conf/Plugins.cnf
include ../Conf/ISAPI.cnf
include ../Conf/ISAPIFLT.cnf
include ../Conf/PHP4.cnf
# ---
#
# Documentation is handled as HTML regardless of file extension. Also,
# files have headers and footers attached to make them pretty.
#
# ---
<Object>
Name DocumentMapper
Class PathMapperClass
#
# leave calling card
#
Action "&dbreplace(response,string,ObjectMap,Pi3Docs)"
</Object>
# ---
#
# CGIMapper
#
# Instance of PathMapperClass to Map CGI URLs
#
# CGI Scripts set PATH_INFO.
#
# ---
<Object>
Name CGIMapper
Class PathMapperClass
CaseSensitive "No"
#
# Subdirectories below the mapping directory should be put in path info
#
PathInfo "Yes"
#
# Set the 'ObjectMap' variable in the response DB if this map is
# successful
#
Action "&dbreplace(response,string,ObjectMap,Scripts)"
</Object>
# ---
#
# WinCGIMapper and FCGIMapper
#
# Like CGIMapper, except it leaves a different marker to cause
# a different object to handle the request.
#
# ---
<Object>
Name WinCGIMapper
Class PathMapperClass
PathInfo "Yes"
Action "&dbreplace(response,string,ObjectMap,WinScripts)"
</Object>
<Object>
Name FCGIMapper
Class PathMapperClass
PathInfo "Yes"
Action "&dbreplace(response,string,ObjectMap,FastCGIScripts)"
</Object>
# ---
#
# DAFFLT
#
# Sample ISAPI filter DLL (Basic Auth)
#
# ---
<Object>
Name DAFFLT
Class ISAPIFLTClass
Condition "®exp('*/admin/*',$z)"
FilterDLLPath ".\Isapi\daf.dll"
Terminators Headers | Mapping
</Object>
# ---
#
# AdminMapper
#
# For protected spaces
#
# ---
<Object>
Name AdminMapper
Class PathMapperClass
#
# Set the authentication realm so the BasicAuth handler kicks in
Action "&dbreplace(response,string,AuthenticationRealm,Admin)"
</Object>
# ---
#
# AccessLogger
#
# An instance of ExpressionLoggerClass configured to generate an
# logfile
#
# ---
<Object>
Name AccessLogger
Class ExpressionLoggerClass
#
# Append
#
OpenMode "a"
#
# Line to log
Expression "$A $h - [$t] \"$r\" $s $b$M"
</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
#
# Give ISAPI filters the chance to handle this phase (CONTINUE)
# Otherwise set the ReturnCode to COMPLETED
#
Headers ReadRequestHeaders ReturnCode=COMPLETED
#
# The handler 'VirtualHosts' is described below
#
HostMap VirtualHosts
#
# Default mappings
#
Mapping MapToErrorDocument \
IgnoreStatus="0 200" \
DefaultMessage="/errors/unknown.htm" \
301="/errors/301.ssi" \
304="/errors/304.htm" \
400="/errors/400.htm" \
401="/errors/401.htm" \
403="/errors/403.ssi" \
404="/errors/404.ssi" \
500="/errors/500.ssi" \
501="/errors/501.htm"
#
# Mapping virtual paths to example directory with 'DirListType' set
#
Mapping DirectoryMappings
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/Features/NtlmFeature" To="Pi3Docs/Features/NtlmFeature/" \
Action="&dbreplace(response,string,AuthenticationRealm,NtlmTest)"
Mapping DocumentMapper From="/pidocs/" To="Pi3Docs/"
Mapping PathMapper From="/errors/" To="Fragment/"
Mapping PathMapper From="/icons/" To="Icons/"
# mapping to view logfiles disabled
# Mapping PathMapper From="/logs/" To="Logs/"
Mapping AdminMapper From="/admin/" To="Logs/"
Mapping PathMapper From="/Pi3Expressions/" To="**internal**/" \
Action="&dbreplace(response,string,ObjectMap,Pi3Expr)" \
PathInfo="Yes"
Mapping PathMapper From="/isapi/" To="Isapi/" \
Action="&dbreplace(response,string,ObjectMap,ISAPI)" \
PathInfo="Yes"
#
# Mapping specific to Host2
#
Mapping Host2Mappings
#
# Mapping specific to MainVirtualHostInformation
#
Mapping Host1Mappings
</Object>
# ---
#
# Default
#
# Handle requests that other handlers have passed up
#
# ---
<Object>
Name Default
Class FlexibleHandlerClass
CheckPath DirectoryExists \
IndexFile="index.ssi" IndexFile="Index.ssi" \
IndexFile="index.htm" IndexFile="Index.htm" \
IndexFile="index.html" IndexFile="Index.html" \
IndexFile="default.htm" IndexFile="Default.htm"
CheckPath RefuseFileByMask AllowFileMask="EF" RefuseStatus=404
CheckPath RefuseFileByMask AllowFileMask="F" RefuseStatus=403
CheckPath ReturnCode ReturnCode=COMPLETED
CheckAuth BasicAuth Realm="Admin"
# CheckAuth NtlmAuth Realm="NtlmTest"
CheckAuth BasicAuth Realm="NtlmTest"
CheckAuth ReturnCode ReturnCode=COMPLETED
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -