问题
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:
- Press "Windows + R".
- Type:
services.msc
. - Look for
Sql Server Reporting Services
in the list. - If the
Status
readsStarted
, right-click on the line and click onStop
. - Then, right-click on the line again and choose
Properties
. - In the window that pops, change
Startup type
toManual
.
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:
- Click on the WAMP icon (orange) and click on
Stop All Services
. - Click again on the WAMP icon (red) and go to
Apache > Service > Install Service
. - 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:
in cmd, see which program is occupying the port
NETSTAT -p tcp -ano
find the PID of the program
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)
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