Commit f614eced authored by sroberts's avatar sroberts

Updated z2.py so that a ZServer can be told to listen for FastCGI requests.

parent cb85a655
......@@ -122,6 +122,8 @@ except:
from medusa import resolver, logger, asyncore
from HTTPServer import zhttp_server, zhttp_handler
from PCGIServer import PCGIServer
from FCGIServer import FCGIServer
from FTPServer import FTPServer
from PubCore import setNumberOfThreads
from medusa.monitor import secure_monitor_server
......@@ -122,6 +122,8 @@ except:
from medusa import resolver, logger, asyncore
from HTTPServer import zhttp_server, zhttp_handler
from PCGIServer import PCGIServer
from FCGIServer import FCGIServer
from FTPServer import FTPServer
from PubCore import setNumberOfThreads
from medusa.monitor import secure_monitor_server
......@@ -165,6 +165,13 @@ Options:
%(PCGI_FILE)s, relative to the Zope location. If this is an empty
string (-p '') or the file does not exist, then PCGI is disabled.
-F path_or_port
Either a port number (for inet sockets) or a path name (for unix
domain sockets) for the FastCGI Server. If the flag and value are
not specified then the FastCGI Server is disabled.
-m port
The secure monitor server port. If this is an empty string
......@@ -268,11 +275,16 @@ MODULE='Zope'
# The size of the thread pool, if ZODB3 is used.
NUMBER_OF_THREADS=4
# Localization support
LOCALE_ID=None
# Socket path or port for the FastCGI Server
FCGI_PORT=None
#
########################################################################
......@@ -283,7 +295,8 @@ try:
if string.split(sys.version)[0] < '1.5.2':
raise 'Invalid python version', string.split(sys.version)[0]
opts, args = getopt.getopt(sys.argv[1:], 'hz:Z:t:a:d:u:w:f:p:m:Sl:2DP:rL:')
opts, args = getopt.getopt(sys.argv[1:], 'hz:Z:t:a:d:u:w:f:p:m:Sl:2DP:rF:L:')
DEBUG=0
READ_ONLY=0
......@@ -351,6 +364,8 @@ try:
elif o=='-L':
if v: LOCALE_ID=v
else: LOCALE_ID=''
elif o=='-F': FCGI_PORT=v
__builtins__.__debug__=DEBUG
......@@ -375,6 +390,7 @@ sys.path=[os.path.join(here,'lib','python'),here
]+filter(None, sys.path)
# Try to set the locale if specified on the command
# line. If the locale module is not available or the
# requested locale is not supported by the local
......@@ -403,7 +419,6 @@ if LOCALE_ID is not None:
set_locale(LOCALE_ID)
# from this point forward we can use the zope logger
# Import ZServer before we open the database or get at interesting
......@@ -450,7 +465,9 @@ if MODULE=='Zope':
setNumberOfThreads(NUMBER_OF_THREADS)
from ZServer import resolver, logger, asyncore
from ZServer import zhttp_server, zhttp_handler, PCGIServer,FTPServer
from ZServer import zhttp_server, zhttp_handler, PCGIServer,FTPServer,FCGIServer
from ZServer import secure_monitor_server
## ZServer startup
......@@ -508,6 +525,23 @@ if PCGI_FILE and not READ_ONLY:
resolver=rs,
logger_object=lg)
# FastCGI Server
if FCGI_PORT and not READ_ONLY:
fcgiPort = None
fcgiPath = None
try:
fcgiPort = string.atoi(FCGI_PORT)
except ValueError:
fcgiPath = FCGI_PORT
zfcgi = FCGIServer(module=MODULE,
ip=IP_ADDRESS,
port=fcgiPort,
socket_file=fcgiPath,
resolver=rs,
logger_object=lg)
# Monitor Server
if MONITOR_PORT:
from AccessControl.User import super
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment