[Twisted-Python] Twisted perspective broker on port 80, problem

Dorian Raymer deldotdr at gmail.com
Wed Jun 17 16:48:14 EDT 2009


If you want to run PB on port 80, you need to start twistd with root
privileges.

Do you really want to serve PB on port 80?
You probably want to serve it on an un-privileged port (> 1023). I think the
spread source suggests 8787 as the port to use for a PBServer.

-Dorian

On Wed, Jun 17, 2009 at 1:32 PM, hbd <happybrowndog at hotmail.com> wrote:

> Is there any reason why I am getting this error when I try to get
> perspective broker to be on port 80?
>
> twisted.internet.error.CannotListenError: Couldn't listen on any:80:
> (13, 'Permission denied').
>
> I made sure port 80 was not used by Apache or anything else by checking
> with netstat.
>
> Here is the relevant pieces of twisted code:
>
> application = twisted.application.service.Application("eventserver")
>
> rpcservice = TheService()
> flashservice = XMLSocket(FlashReceiver)
>
> myServiceCollection =
> twisted.application.service.IServiceCollection(application)
>
> portalmonitor = portal.Portal(DefaultRealm())
> dbu=twisted.cred.checkers.InMemoryUsernamePasswordDatabaseDontUse()
> dbu.addUser("user1","pass1")
> portalmonitor.registerChecker(dbu)
>
> internet.TCPServer(5002,
>
> server.Site(rpcservice.getResource())).setServiceParent(myServiceCollection)
>
> internet.SSLServer(80,
>
> pb.PBServerFactory(portalmonitor),ssl.DefaultOpenSSLContextFactory('privkey.pem','cacert.pem')).setServiceParent(myServiceCollection)
>
> internet.TCPServer(5001,
> flashservice).setServiceParent(myServiceCollection)
>
>
> _______________________________________________
> Twisted-Python mailing list
> Twisted-Python at twistedmatrix.com
> http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090617/add8e9fe/attachment.htm 


More information about the Twisted-Python mailing list