How to change port number for apache in WAMP
ApacheWampApache Problem Overview
I am new to WAMP server and installed it on my system but after installing it when I check it by going to localhost url like this http://localhost/
in the browser it is not working. I am getting a 404 error and blank page.
This is because my 80 port which default in Wamp server
is being used by IIS server. So please let me know how to change port number in Wamp server and solved this problem.
Apache Solutions
Solution 1 - Apache
Click on the WAMP server icon and from the menu under Config Files select
httpd.conf
. A long text file will open up in notepad. In this file scroll
down to the line that reads Port 80
and change this to read Port 8080
,
Save the file and close notepad. Once again click on the wamp server icon and
select restart all services. One more change needs to be made before we are
done. In Windows Explorer find the location where WAMP server was installed
which is by Default C:\Wamp
.
Update : On a newer version of WAMP, click the WAMP server icon > Apache > httpd.conf
, then change the line Listen 80
to Listen 8080
or any port you want.
Update: On 3.1.6 version of WAMP , right click on the wamp server icon in the taskbar ,select "tools"-> "Port used by Apache:80" -> "use a port other than 80", an input box will pop up , input a new port in it,click confirm button , then restart wamp .
Solution 2 - Apache
Just go to httpd.conf file, for ex. under WAMP environment its situated at:
C:\wamp\bin\apache\apache2.2.22\conf\httpd.conf
go to line no. 46 and edit Listen 80
to your requirement for ex.
Listen 8383
newer versions of WAMP uses these 2 lines:
Listen 0.0.0.0:8383
Listen [::0]:8383
Next go to line no. 171 and edit ServerName localhost:80
to your requirement for ex.
ServerName localhost:8383
Restart Apache
and its done !!
Now, you can access with your URL:
http://localhost:8383 or http://192.168.1.1:8383
Hope it helps to people looking for solution here.
Solution 3 - Apache
From the wampserver 3.x onwards, changing the listening port number of Apache does not require any particular Apache skills (http.conf, virtualhost,...), you just have to click button - assuming you're running Windows OS! :
- In the tray, right click green/running WAMP icon
- Select menu Tools
- In the section Port used by Apache: xx, click Use a port other than 80 (i.e. default port configuration)
- Enter the desired port number in the popup window - usually 8080 as alternative Web port
NB: For alternative port: check official IANA Service Name and Transport Protocol Port Number Registry
Solution 4 - Apache
Change port number for Xampp Go to the file C:\xampp\apache\conf\httpd.conf
#Listen 12.34.56.78:80
Listen 80
Change 80 to 82
as
#Listen 12.34.56.78:82
Listen 82
now your url will be
http://localhost:82
Solution 5 - Apache
In lieu of changing the port, I reclaimed port 80 as being used by IIS.
So I went to services, and stopped the following:
- World Wide Web Publishing Services.
- Web Management Service
- Web Deployment Agent Service.
set them to manual so that it will not start on dev environment restart.
Solution 6 - Apache
In addition of the modification of the file C:\wamp64\bin\apache\apache2.4.27\conf\httpd.conf
.
To get the url shortcuts working, edit the file C:\wamp64\wampmanager.conf
and change the port:
[apache]
apachePortUsed = "8080"
Then exit and relaunch wamp.
Solution 7 - Apache
You could try changing Apache server to listen to some other port other than port 80.
Click on yellow WAMP icon in your taskbar Choose Apache -> httpd.conf Inside find these two lines of code:
Listen 80 ServerName localhost:80 and change them to something like this (they are not one next to the other):
Listen 8080 ServerName localhost:8080
Solution 8 - Apache
Click on the WAMP server icon and from the menu under Config Files select httpd.conf. A long text file will open up in notepad. In this file scroll down to the line that reads Port 80 and change this to read Port 8080, Save the file and close notepad. Once again click on the wamp server icon and select restart all services. One more change needs to be made before we are done. In Windows Explorer find the location where WAMP server was installed which is by Default C:\Wamp.