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

Alex Clemesha clemesha at gmail.com
Wed Jun 17 16:48:00 EDT 2009


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').

Are you running this at root? Aka "sudo twistd ...".

Specifically:
Programs written to listen on a port number lower than 1024 must
be executed with root privilege (that is, UID 0)


-Alex




> 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
>



-- 
Alex Clemesha
clemesha.org




More information about the Twisted-Python mailing list