import templates from cherrypy.process.plugins import DropPrivileges class DropSock(DropPrivileges): def start(self): if cherrypy.server.socket_file: import os os.chown(cherrypy.server.socket_file, self.uid, self.gid) DropPrivileges.start(self) start.priority = 78 import cherrypy DropSock(cherrypy.engine, uid='lighttpd', gid='apache').subscribe() from handler import Root as _root root = _root()