osx - python -m SimpleHTTPServer - Listening on 0.0.0.0:8000 but http://0.0.0.0:8000/test.html gives "Page Not Found" -


after cding folder enter

python -m simplehttpserver 

and

serving http on 0.0.0.0 port 8000 ... 

in reply. when hit http://0.0.0.0:8000/test.html page not found error.

i've tried

pushd /path/you/want/to/serve; python -m simplehttpserver; popd 

taken this question

when hit ls can see file , directory. know i'm doing wrong?

i think other 2 answers trying make clear 0.0.0.0 not url should visiting. when python web server (like cherrypy instance) says serving on 0.0.0.0 means listening tcp traffic ends @ machine no matter hostname or ip requested. but, if change such socket listens on 127.0.0.1 or 'localhost', unless request ip/hostname, won't respond request. example, many times can use machine name instead of localhost (ubuntu allows example). if machine name 'brian' , have server listening on 0.0.0.0:8080, should able reach server http://brian:8080. if server listening on 'localhost', though 'brian' set point 'localhost', server won't receive message.

you need sure file in directory running command from. otherwise, 404 response correct :)

good luck!


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -