类似 python -m SimpleHTTPServer e:\www 这种
按e:\www做为DocumentRoot 做为web服务根目录
按e:\www做为DocumentRoot 做为web服务根目录
1
vmebeh Apr 6, 2014
cd /d e:\www
python -m SimpleHTTPServer |
2
mdjhny Apr 6, 2014 http://gist.github.com/10006674.git
里面有一行path = os.getcwd(),这里可以改一下 |
3
icylogic Apr 7, 2014 via Android
它是把启动目录当根目录的,所以。。。cd ... && python ...
|
4
yakczh OP 找到一款nodejs写的
npm install http-server -g nodejs http-server . #当前目录做根目录 nodejs http-server e:\www #指定目录 这个对中文支持要好得多 SimpleHTTPServer 显示中文文件全是方块 |
5
baocaixiong Apr 7, 2014
|
6
xnh Apr 8, 2014
SimpleHTTPServer好像是默认设置的当前路径,如果你是linux的话可以先alias pythonhttp="python -m SimpleHTTPServer"
然后cd到你想设置为DocumentRoot的目录, 执行 pythonhttp 或 pythonhttp 想要的端口 就可以了 |