124

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.

vishal_g
  • 3,871
  • 4
  • 21
  • 34

8 Answers8

175

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 .

Shaun
  • 480
  • 7
  • 18
vishal_g
  • 3,871
  • 4
  • 21
  • 34
  • 18
    Shouldn't it be `Listen 8080` rather than `Port 8080`? – DaveRandom Dec 20 '11 at 11:05
  • may be your other application is using that 80 port , so u just need to change the port and it will work for you. – vishal_g Dec 20 '11 at 11:12
  • 3
    Related to this - I also had to change the port to different one, but then the links from the WampServer system tray monitor didn't work. They kept pointing to plain "localhost/". To change it, I tried editing the c:\wamp\wampmanager.ini, but that one seemed to get overwritten with defaults each time the wampserver is restarted. Anyway, after adding the new port number in the c:\wamp\wampmanager.tpl (template, I guess), all started working after next wamp restart. Just thought I should share. :) – userfuser Sep 09 '13 at 11:08
  • 2
    Also change the url links in wamp\wampmanager.tpl to get the shortcuts from the task bar working – Adam Butler Oct 08 '13 at 01:11
  • Wikipedia lists port numbers and common uses. States 80, 8080, and 8008 as common alternative http ports. https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers – Jason D.H. Mar 11 '17 at 22:16
106

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.

scytale
  • 12,346
  • 3
  • 32
  • 46
Aditya P Bhatt
  • 21,431
  • 18
  • 85
  • 104
34

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! :

  1. In the tray, right click green/running WAMP icon
  2. Select menu Tools
  3. In the section Port used by Apache: xx, click Use a port other than 80 (i.e. default port configuration)
  4. 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

philippeko
  • 501
  • 5
  • 16
12

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
Baby Groot
  • 4,637
  • 39
  • 52
  • 71
Rizwan Gill
  • 2,193
  • 1
  • 17
  • 29
  • I changed and it works! But can I hide the port from the url? It should use port 82 but should not display in url. Is that possible? – ARUN Oct 13 '16 at 08:03
8

In lieu of changing the port, I reclaimed port 80 as being used by IIS.

So I went to services, and stopped the following:

  1. World Wide Web Publishing Services.
  2. Web Management Service
  3. Web Deployment Agent Service.

set them to manual so that it will not start on dev environment restart.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
bherto39
  • 1,516
  • 3
  • 14
  • 29
  • 2
    I like this approach rather than changing the port. On Windows 10, all I had to disable was World Wide Web Publishing Services – Paul Sandel Aug 02 '15 at 16:54
6

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.

Nicolas
  • 6,289
  • 4
  • 36
  • 51
4

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

Gurunath
  • 61
  • 2
2

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.

Gurunath
  • 61
  • 2