I want to start a web server simply and temporarily for the purpose of measuring download speed. However, I don't like the fact that files unrelated to production remain in lib and bin after installing apache. In such a case, you can start the web server with python (listen http). And with one liner!
Become root
Create a file in the current directory. This will be the file delivered via http
# echo hoge > index.html
Execute the following to put port 80 in the LISTEN state (start the web server)
# python -m SimpleHTTPServer 80
Get index.html with curl or wget
$ wget http://Server host name/index.html
Check the file
$ cat index.html
$ hoge
http://d.hatena.ne.jp/rx7/20090812/p1
Recommended Posts