如何为 Apache 打开以前被 Visual Studio 服务器占用的 80 端口?

发布于 2024-11-26 23:42:35 字数 268 浏览 2 评论 0原文

我在 WAMP 之后安装了 Visual Studio 2010,并且必须打开 IIS。现在我想使用 WAMP,但即使我禁用了 IIS,甚至卸载了 Visual Studio 2010,我的 Apache 也无法打开。

I installed Visual Studio 2010 after WAMP and had to turn on IIS. Now I want to use my WAMP but my Apache is not turning on even after I have disabled IIS and even uninstalled my Visual Studio 2010.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

野稚 2024-12-03 23:42:35

您可以在Apache服务器的httpd.conf配置文件中设置端口号。

通常位于 Apache 安装文件夹的“conf”文件夹内。 (例如,c:\wamp\Apache2\conf\httpd.conf

然后将行 Listen 80 更改为 Listen 8081。重新启动您的 Apache 服务器。

提示:您可以同时安装 IIS 和 Apache,并且可以同时使用两者。您所需要的只是为 Apache 和 IIS 设置不同的端口号。

默认情况下,它们都使用端口 80,但您可以按照上面的说明进行更改。

我忘了提及,当您使用 80 以外的端口号时,您必须将浏览器地址栏更改为 http://localhost:8081/http://127.0.0.1:8081/

You can set the port number in httpd.conf configuration file of Apache server.

Usually inside the "conf" folder of Apache installation folder. (Say, c:\wamp\Apache2\conf\httpd.conf)

Then change the line Listen 80 to Listen 8081. Restart your Apache server.

Tip: You can install IIS and Apache together, and you can work on both at the same time. All what you need is, set different port numbers for Apache and IIS.

By default, both of them use Port 80, but you can change it as said above.

I forgot to mention, when you're using a port number other than 80, you MUST change the browser addressbar as http://localhost:8081/ or http://127.0.0.1:8081/

绝不服输 2024-12-03 23:42:35

我从一位用户发布的 superuser.com 上发现了这一点,所以希望它也能有所帮助。 :)
要在 Windows 防火墙中添加端口 80 的规则,请执行以下操作:

转至控制面板并启动“Windows 防火墙”
前往“高级设置”
在左侧窗格中选择“入站规则”
在右侧窗格中选择“新建规则”
在新建入站规则向导中,选择“端口”作为规则类型,然后单击“下一步”
选择“TCP”并在“特定本地端口”中输入“80”(以及您要打开的任何其他端口),然后单击“下一步”
选择“允许连接”,然后单击“下一步”
选择应应用规则的网络位置(如果不确定,请选择全部),然后单击“下一步”
提供名称和可选描述
应该可以做到这一点。

I found this from superuser.com which one of users posted up , so hope it helps as well. :)
To add a rule in the Windows Firewall for port 80, do the following:

Go to the Control Panel and launch "Windows Firewall"
Go to "Advanced Settings"
Select "Inbound Rules" in the left pane
Select "New Rule" in the right pane
In the New Inbound Rule Wizard, select "Port" as Rule Type, then click on "Next"
Select "TCP and put "80" (and any other ports you want to open) in "Specific local ports", then click on "Next"
Select "Allow the connection", then click on "Next"
Select the network location where the rule should apply (select them all if you're not sure), then click on "Next"
Give a name and an optional description
That should do it.

神仙妹妹 2024-12-03 23:42:35

如果您安装了 Visual Studio,则可能还安装了SQL Server。我发现如果安装并启动了SQL Server Reporting Services,它也会使用端口 80,这导致了我的问题。

以下是我解决该问题的方法:

  1. 按“Windows + R”。
  2. 类型:services.msc
  3. 在列表中查找Sql Server Reporting Services
  4. 如果状态显示为已开始,请右键单击该行,然后单击停止
  5. 然后,再次右键单击该行并选择属性
  6. 在弹出的窗口中,将启动类型更改为手动

现在,您已停止 SQL Server Reporting Services,并阻止该服务在下次计算机重新启动时再次启动。请注意,如果您需要该服务正常工作,则需要手动启动它。

现在,SQL Server Reporting Services 不会对 WAMP 造成任何问题。您应该重新安装 Apache 服务。步骤如下:

  1. 单击 WAMP 图标(橙色),然后单击停止所有服务
  2. 再次单击 WAMP 图标(红色)并转到 Apache >服务>安装服务
  3. 再次单击 WAMP 图标(红色),然后单击重新启动所有服务

WAMP 图标应变为绿色,一切都会正常工作。

If you installed Visual Studio, you may also have installed SQL Server. I found out that if SQL Server Reporting Services was installed and started, it uses port 80 too which was causing my problem.

Here is what I did to solve the issue:

  1. Press "Windows + R".
  2. Type: services.msc.
  3. Look for Sql Server Reporting Services in the list.
  4. If the Status reads Started, right-click on the line and click on Stop.
  5. Then, right-click on the line again and choose Properties.
  6. In the window that pops, change Startup type to Manual.

You now have stopped SQL Server Reporting Services and prevent the service from starting again on your next computer restart. Note that if you need that service to work, you will need to start it manually.

Now, SQL Server Reporting Services won't cause any problem with WAMP. You should reinstall the Apache service. Here are the steps:

  1. Click on the WAMP icon (orange) and click on Stop All Services.
  2. Click again on the WAMP icon (red) and go to Apache > Service > Install Service.
  3. Click again on the WAMP icon (red) and click on Restart All Services.

The WAMP icon should turn to green and everything will work fine.

晨敛清荷 2024-12-03 23:42:35

添加或删除程序、添加或删除 Windows 组件、取消选中 IIS

Add or Remove programs, Add or remove windows components, uncheck IIS

她说她爱他 2024-12-03 23:42:35
  1. 在cmd中查看哪个程序占用了端口

    NETSTAT -p tcp -ano

  2. 查找程序的PID

  3. 在任务管理器中->流程->查看->选择列并启用 PID。找出占用端口的进程(如果没有找到,请检查服务选项卡)

  4. 结束该进程并尝试启动 WAMP。对于长期运行,请卸载该程序或将其配置为使用另一个端口

  1. in cmd, see which program is occupying the port

    NETSTAT -p tcp -ano

  2. find the PID of the program

  3. in task manager -> process -> view -> select column and enable PID. Find out the process that is occupying the port (if not found check the service tab as well)

  4. end the process and try to start WAMP. For long run, uninstall that program or configure it to use another port

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文