How to get CherryPy's cherryd serving static files -
i want start server, point @ directory , have serve static files. thought cherryd good/easy that.
i've read cherryd usage , portion of online docs, posts here static files , cherrypy, i've yet find information bare configuration file cherryd. i've been able piece following:
[global] server.socket_host: "127.0.0.1" server.socket_port: 8000 log.error_file = '/users/chb/code/app/test/log/cherrypy.error.log' [/] tools.staticdir.on: true tools.staticdir.root: '/users/chb/code/app' tools.staticdir.dir: '.' i tried alternate configuration:
[global] server.socket_host: "127.0.0.1" server.socket_port: 8000 log.error_file = '/users/chb/code/app/test/log/cherrypy.error.log' [/] tools.staticdir.root: '/users/chb/code/app' [/index.html] tools.staticfile.on: true tools.staticfile.filename: '/users/chb/code/app/index.html' the latter adheres more docs (see below).
visiting 127.0.0.1:8000 gets me 404. when tail error log after running cherryd -c /path/to/cherryd.cfg, nothing comes apart standard startup info.
this question relates cherrypy 3.2.2 , python 2.7.3
relevant pages in docs:
my error in thinking cherryd simple http daemon can run absent user-created python script.
what wanted lighttpd. came across this document , wondered if there simliar implemented in python.
fortunately, after more searching came across one-liner mentioned in comments original post.
Comments
Post a Comment