我可以在同一台计算机上运行两个Web服务器吗? [英] Can I run two web servers on the same computer?

查看:478
本文介绍了我可以在同一台计算机上运行两个Web服务器吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚发现我可以使用Python编写一个真正的简单的Web服务器.我已经有一个Apache Web服务器,我想在这台机器上尝试基于Python的Web服务器.但是,如果尝试尝试,可能会引起某种冲突.我的意思是两个Web服务器将如何决定"谁需要处理来自客户端的请求?

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 machine. But I am afraid that I can get some kind of conflict if I try it. I mean how two web server will "decide" who needs to server a request from a client?

推荐答案

让他们监听不同的端口,您会没事的.

Make them listen to different ports and you will be fine.

默认Web端口是80.当您在浏览器中打开某些网址而不指定端口时,默认使用80.

The default web port is 80. When you open some url in browser without specifying a port, 80 is used by default.

您可以将Web服务器配置为侦听其他端口,但随后还需要在url中明确指定它:

You can configure your web server to listen to a different port but then you will also need to specify it explicitly in the url:

http://localhost:8080

在选择端口时,请注意,此特定端口号尚未被您已安装并在盒子上运行的任何软件使用.否则,您猜对了,就会发生冲突.

When choosing a port pay attention that this particular port number is not yet in use by any software you have installed and running on your box. Otherwise, as you correctly guessed, there will be a conflict.

P.S.就在几天前,我重新安装了IIS,但无法启动IIS(看似无故).原来新版本的Skype占用了此默认端口!必须删除其设置使用端口80和443作为传入连接的替代方法".

P.S. Just a few days ago doing reinstallation I got IIS not able to start (seemingly without reason). Turned out the new version of Skype occupied this default port! Had to remove its setting "Use port 80 and 443 as alternatives for incoming connections".

这篇关于我可以在同一台计算机上运行两个Web服务器吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆