return m.group(1), m.group(2), version else: return None, None, None if __name__ == '__main__': if len(sys.argv) < 2: print('usage: %s <root> <port>' % (sys.argv[0])) else: import supervisor.medusa.monitor as monitor import supervisor.medusa.filesys as filesys import supervisor.medusa.default_handler as default_handler import supervisor.medusa.ftp_server as ftp_server import supervisor.medusa.chat_server as chat_server import supervisor.medusa.resolver as resolver rs = resolver.caching_resolver('127.0.0.1') lg = logger.file_logger(sys.stdout) ms = monitor.secure_monitor_server('fnord', '127.0.0.1', 9999) fs = filesys.os_filesystem(sys.argv[1]) dh = default_handler.default_handler(fs) hs = http_server('', int(sys.argv[2]), rs, lg) hs.install_handler(dh) ftp = ftp_server.ftp_server(ftp_server.dummy_authorizer(sys.argv[1]), port=8021, resolver=rs, logger_object=lg) cs = chat_server.chat_server('', 7777) if '-p' in sys.argv: def profile_loop(): try:
PUBLISHING_ROOT = '/home/www' HTTP_PORT = 8080 # The standard port is 80 FTP_PORT = 8021 # The standard port is 21 CHAT_PORT = 8888 MONITOR_PORT = 9999 # =========================================================================== # Caching DNS Resolver # =========================================================================== # The resolver is used to resolve incoming IP address (for logging), # and also to resolve hostnames for HTTP Proxy requests. I recommend # using a nameserver running on the local machine, but you can also # use a remote nameserver. rs = resolver.caching_resolver ('127.0.0.1') # =========================================================================== # Logging. # =========================================================================== # There are several types of logging objects. Multiple loggers may be combined, # See 'logger.py' for more details. # This will log to stdout: lg = logger.file_logger (sys.stdout) # This will log to syslog: #lg = logger.syslog_logger ('/dev/log') # This will wrap the logger so that it will
PUBLISHING_ROOT = "/home/www" HTTP_PORT = 8080 # The standard port is 80 FTP_PORT = 8021 # The standard port is 21 CHAT_PORT = 8888 MONITOR_PORT = 9999 # =========================================================================== # Caching DNS Resolver # =========================================================================== # The resolver is used to resolve incoming IP address (for logging), # and also to resolve hostnames for HTTP Proxy requests. I recommend # using a nameserver running on the local machine, but you can also # use a remote nameserver. rs = resolver.caching_resolver("127.0.0.1") # =========================================================================== # Logging. # =========================================================================== # There are several types of logging objects. Multiple loggers may be combined, # See 'logger.py' for more details. # This will log to stdout: lg = logger.file_logger(sys.stdout) # This will log to syslog: # lg = logger.syslog_logger ('/dev/log') # This will wrap the logger so that it will