Apache 和 IIS 7 一起运行
我正在使用 Windows 7。IIS 7 和 XAMPP 安装在同一台计算机上。 我一直在研究 win 主机文件和 apache 配置文件以了解服务器根目录和目录。
我不知道我在哪里搞砸了,知道当我输入 localhost 时它显示 IIS 7 屏幕,当 localhost/xampp 时显示 apache 屏幕。
IIS和apache如何在80端口一起运行?使困惑。
I am working on windows 7. IIS 7 and XAMPP are installed on the same computer.
I have been playing with win host file and apache configuration files into to understand Server Root and directory.
I dont know where i messed up, that know when i type localhost it shows me IIS 7 screen and when localhost/xampp then apache screen.
How can IIS and apache run together at port 80 ? confused.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
这是可行的。需要记住的是,任何 2 个服务不能共享相同的端口和 IP 地址。不幸的是,IIS 完全接管了神奇的 0.0.0.0 地址上的端口 80。您需要做的是将 apache 和 IIS 重新绑定到不同的 IP 地址,并删除 0.0.0.0 绑定。不完全确定如何在 IIS7 上到达那里(假设您在屏幕中给出 IE9 的情况下运行它),上次我拉这个特技 IIS6 是轴。
一个更明智的选择是在 80 上设置一个反向代理,并让它根据您想要使用的任何合理标准将内容分发到不同的 Web 服务器。
编辑:找到了神奇的juju, IIS7 post #44 - IIS7 和 Apache 在同一台计算机上。
It is doable. The thing to keep in mind is that no 2 services can share the same port and IP address. Unfortunately, IIS takes over port 80 completely on the magic 0.0.0.0 address. What you need to do is re-bind apache and IIS to different IP addresses as well as remove the 0.0.0.0 binding. Not exactly sure how to get there on IIS7 (presuming you are running it given IE9 in the screenies), last time I pulled this stunt IIS6 was hawt.
A more sane option would be to setup a reverse proxy on 80 and have it hand stuff out to different web servers based on whatever rational criteria you want to use.
EDIT: found the magic juju, IIS7 post #44 - IIS7 and Apache on the same machine.
如何在同一台计算机上同时运行 IIS 和 XAMPP
只需更改任一服务器的端口号,即可在同一台计算机上同时运行 IIS 和 XAMPP 服务器。 XAMPP-Apache 和 IIS 两个服务器使用相同的端口 80 进行连接。在这篇文章中,我将向您展示如何更改 XAMPP-Apache 服务器的端口号。更改 Apache 服务器的端口号允许您使用不同的端口在同一台计算机上运行 IIS 和 XAMPP 服务器。
首先,您需要知道XAMPP的安装文件夹(根文件夹)。默认文件夹是 c:\xampp。从根文件夹导航到“ apache\conf ”文件夹并找到文件“httpd.conf”。
在编辑该文件之前,请使用名称“httpd.conf.bak”对其进行备份,以便在出现问题时可以替换该文件。
现在使用记事本等编辑器打开文件“httpd.conf”。您需要对该文件进行两次编辑。
第一个:
找出文件中的以下行。
更改如下:
第二次编辑:
找到以下行:
将其更改为:
您已完成更改端口号。现在从 xampp 控制面板重新启动您的 apache 服务器并准备运行。
打开浏览器并输入地址
localhost:8080
。可以看到apache的根文件夹打开了。无需对 IIS 服务器进行任何更改,只需在浏览器中输入地址localhost
即可访问它。在上面的屏幕截图中,您可以看到在同一台计算机甚至同一个浏览器上通过
localhost
访问 IIS 服务器,并通过localhost:8080
访问 XAMPP 服务器。How To Run IIS And XAMPP Together On Same Machine
It is possible to run both IIS and XAMPP servers together on same machine by just changing the port number of any one of the server's. XAMPP-Apache and IIS both the server's uses the same port 80 to connect. In this post i am going to show you how to change the port number for the XAMPP-Apache server. Changing the port number for Apache server allows you to run both IIS and XAMPP server's on same machine using different port's.
Firstly, You need to know the folder where XAMPP is installed (root folder). The default folder is c:\xampp. From the root folder navigate to " apache\conf " folder and find the file "httpd.conf".
Before editing the file, make a backup of it with a name "httpd.conf.bak" so that if something goes wrong you can replace this file.
Now open the file "httpd.conf" with an editor like notepad. You need to make two edits to the file.
The first one:
Find out the below lines in the file.
change it as shown below:
The second edit:
Find the below line:
change it to:
You have finished changing the port number. Now restart your apache server from the xampp control panel and its ready to run.
Open your browser and and enter the address
localhost:8080
. You can see the root folder of apache opened. There is no need to make any changes to the IIS server and you an access it by just entering the addresslocalhost
in your browser.In the above screenshot you can see the IIS server being accessed through
localhost
and XAMPP server throughlocalhost:8080
on the same machine and even the same browser at a time.如果尝试让 XAMPP (Apache) 和 IIS (5.1) 在 WinXP 上工作,这就是我所做的:
C:\xampp\apache\conf\httpd.conf:
搜索“Listen 80”,更改为“Listen 8080”
搜索“ServerName localhost:80”,更改为“ServerName localhost:8080”
C:\xampp\apache\conf\extra\httpd-ssl.conf
搜索“Listen 443”,更改为“Listen 4499”
搜索“”,更改为“”
搜索“ServerName localhost:443”,更改为“ServerName localhost:4499”
[然后,通过运行 localhost:8080 访问 Apache 端,通过简单的 loccalhost 访问 ISS 端]
In case of trying to get XAMPP (Apache) and IIS (5.1) working on WinXP this is what I did:
C:\xampp\apache\conf\httpd.conf:
Search for “Listen 80″, change to “Listen 8080″
Search for “ServerName localhost:80″, change to “ServerName localhost:8080″
C:\xampp\apache\conf\extra\httpd-ssl.conf
Search for “Listen 443″, change to “Listen 4499″
Search for “”, change to “”
Search for “ServerName localhost:443″, change to “ServerName localhost:4499″
[Then, access your Apache side by running localhost:8080 and ISS side by simple loccalhost]
只需更改 XAMPP 服务器使用的端口号,就可以在同一台计算机上运行 IIS 和 XAMPP。阅读本文以了解如何更改端口号:
http://www.gooshareit.com/2012/03/how-to-run-iis-and-xampp-together-on.html
It is possible to run both IIS and XAMPP on same machine by just changing the port number which is used by XAMPP server. Read this article to know how to change port number:
http://www.gooshareit.com/2012/03/how-to-run-iis-and-xampp-together-on.html
我也遇到过同样的问题。不过我已经用这种方法解决了。我从这里得到它,它对我来说真的很有效所有解决方案都无法为我提供绝对的解决方案。
如果这不能解决问题,您可以找出正在使用的内容端口 80 如下:
在命令提示符下,运行“netstat -ao >” netstat.txt' 将活动连接和关联的进程 ID (PID) 写入文件(对我来说,数量太多,无法在命令提示符中查看它们)
找到正在侦听端口 80 (0.0.0.0:80) 的 PID - 对我来说,PID 是 4,这似乎很常见
打开任务管理器 (Ctrl + Shift + Esc),右键单击列标题,然后单击 PID 以显示 PID 列。按 PID 排序以查找您在上面标识的 PID 的进程。
一旦您知道导致问题的进程,谷歌搜索(其他搜索提供程序可用)应该可以帮助您修复它。
I have faced the same problem. However I have solved this way. I got it from here, it was really effective for me when all solutions were unable to provide me absolute solution.
If this doesn’t fix it, you can find out what is using port 80 as follows:
In a Command Prompt, run ‘netstat -ao > netstat.txt’ to write active connections and associated process IDs (PID) to a file (for me, there were too many to just view them in the command prompt)
Find the PID that is listening on port 80 (0.0.0.0:80) – for me, the PID was 4, which seems quite common
Open Task Manager (Ctrl + Shift + Esc), right click on the column headers, and then click PID to show the PID column. Sort by PID to find the process for the PID that you identified above.
Once you know the process that is causing the problem, a bit of Googling (other search providers are available) should help you fix it.
我已经修改了 httpd.conf 文件,如下所示,在 localhost:81 端口上打开 apache 服务器,而不是默认端口 80。
如果
或者
我们不想同时使用两台服务器,您可以简单地停止一台服务器并启动另一台服务器您想从事的工作。
I have modified the httpd.conf file as below to open apache server on localhost:81 port instead default port 80.
and
OR
If we don't want use both the servers at a time, you can simply stop one server and start the another on which you want to work.