Can I run two web servers on the same computer?

后端 未结 7 1006
执笔经年
执笔经年 2020-12-23 22:12

I just found out that I can write a really simple web server using Python. I have already an Apache web server I would like to try the Python based web server on this machi

7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-23 22:37

    I would suggest you dedicate one server to serving https (port 443) requests.

    That way you can avoid the port conflict others have mentioned while also not requiring users to type anything strange into their browsers (arbitrary port numbers). You can even have each server redirect traffic to the other (e.g. the http server recieves an http request for a host name it knows the https server handles so it can redirect the request to https witht the same host name, thereby transferring the request to the appropriate server).

    Server A:

    http://localhost
    

    Server B:

    https://localhost
    

提交回复
热议问题