环境:Debian9,python2.7
过程:
1.
pip install web.py # 安装 web.py,本例版本是 web.py-0.39

2.
pip install pyOpenSSL # 还需安装这个包

3.
vi test.py # 创建测试文件,内容如下:(请替换相应的ssl证书存储路径)
import web from web.wsgiserver import CherryPyWSGIServer CherryPyWSGIServer.ssl_certificate = "/root/swas.anqun.org.pem" CherryPyWSGIServer.ssl_private_key = "/root/swas.anqun.org.key" urls = ("/.*", "hello") app = web.application(urls, globals()) class hello: def GET(self): return 'Hello, world!' if __name__ == "__main__": app.run()

4.
python test.py # 运行测试,默认在8080端口上

5.在浏览器里访问,如本例,https://swas.anqun.org:8080,正常
