How to open port 80 for Apache, previously occupied by Visual Studio's servers?

筅森魡賤 提交于 2020-01-01 10:57:30

问题


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.


回答1:


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/




回答2:


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.




回答3:


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.




回答4:


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




回答5:


  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



来源:https://stackoverflow.com/questions/6872576/how-to-open-port-80-for-apache-previously-occupied-by-visual-studios-servers

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!