dongruoqiong9017 2014-08-11 05:31
浏览 66
已采纳

如何设置一个简单的测试Web服务器?

I'm a bit new to php so I've never dealt with test servers before, but with the release of Google's Polymer project I now need a test server in order to go through their tutorial, so here it goes!

I use Intellij for all of my web coding and am having trouble trying to get a test server up and running. I'm on OSX and have downloaded things such as MAMP but can't seem to get the test server actually.. running with Intellij. Or know how to view my website on the test server with Intellij. I've looked up so many guides but just can't seem to figure it out.

Any help? Even a link to something useful? Please!

Thank you for any help!

  • 写回答

1条回答 默认 最新

  • douxuanpa8298 2014-08-11 05:51
    关注

    You can start up a simple HTTP server for debugging purposes from any directory, if you have Python installed. Run:

    $ python -m SimpleHTTPServer 8000
    

    Now you can access the directory as a web site directory using:

    http://localhost:8000
    

    You'll need better alternatives as you explore more advanced stuff, but this works just fine as a starting point.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?