How to change port number for apache in WAMP - apache

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.

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 .

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.

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

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

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.

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.

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

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.

Related

Xampp port 80 already use

I have installed XAMPP on my pc and I change all port from '443' to '4433' and '80' to '8080' but when I start Apache it say me that port '80' is already use but Apache must use '8080' and when I go to 'http://localhost/' it display me a 404 error then I don't know what to do.
With netstat -ao on 'cmd' I see that port '80' is using by a program whit 'PID=4' and I see in the task manager that this PID is for "NT Kernel & System" so I can not kill it.
Please try with the port number http://localhost:8080
it seems like you have changed the port from here C:\xampp\apache\conf\httpd.conf
Listen 12.34.56.78:80 to 8080
Listen 80 to 8080
Alternative if want to use port 80 then
If the skype is open try to change the port from the select options(80/443).Sometimes this is the problem.IIS server if running it might use the same port
You can use some tools to kill the process for example, currports, TCPview etc.Hope it helps to solve your problem.
I had the same problem after upgrading to Windows 10. I had to stop the IIS service: "World Wide Web Publishing Service". After stopping/disabling it, it freed up port 80.
Press Ctrl+Shift+Esc (opens taskmanager), Services and stop W3SVC service - World Wide Web Publishing Service;
I had same problem.
You change your port 80 to 8080.
Therefore to log localhost, you have to use http://localhost:8080/xampp/ and not http://localhost/xampp/
Then when you use xampp control panel, sometime you have to face same problem as I was.
Can't go to admin page using admin button in mysql. To get rid of this problem you can do following changes.
Go to xampp control panel.
Using config button open configuration of control pannel. Then click service and port setting and under appache setting you can change your main port 80 to 8080.

Remove :8080 from the URL of WAMP Server

My WAMP Server is working on port 8080 and whenever I want to open the page I have to put :8080 in the url. Is there anyone to ignore :8080 from the URL
on the httpd.conf file
Listen 8080
ServerName localhost:8080
on the wampmanager.tpl file
...
[Menu.Left]
;WAMPMENULEFTSTART
...
Type: item; Caption: "${w_localhost}"; Action: run; FileName: "${c_navigator}"; Parameters: "http://localhost:8080/"; Glyph: 5
Type: item; Caption: "${w_phpmyadmin}"; Action: run; FileName: "${c_navigator}"; Parameters: "http://localhost:8080/phpmyadmin/"; Glyph: 5
...
Type: item; Caption: "${c_webgrind}"; Action: run; FileName: "${c_navigator}"; Parameters: "http://localhost:8080/webgrind/"; Glyph: 5
...
Still now I have to put :8080 in my URL
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 8080 and change this to read Port 80, Save the file and close notepad. Once again click on the wamp server icon and select restart all services.
Also on a newer version of WAMP, click the WAMP server icon > Apache > httpd.conf, then change the line Listen 8080 to Listen 80 or any port you want.
EDIT: IF this doesn't work (which is a definite possibility) Then your best bet is to either bookmark "Localhost:8080" or make a desktop shortcut for ease of access, or to simply figure out why you can't run it on port 80 - and fix that.
If you are using IIS try out the following:
To uninstall IIS using Add or Remove a Windows Component in Control Panel
From the Start menu, click Control Panel.
Double-click Add or Remove Programs.
Click Add/Remove Windows Components.
In the Components list click the Application Server check box.
Click Next.
Click Close when uninstallation of IIS is complete.
Restart your PC
After restarting, type http://localhost/ or http://localhost/index.php
Hope this helps! If this doesn't work, check the application or service using port 80.
Apache > Service > Test Port 80
After checking the port, disable or close that application. You may probably have Skype using Port 80, sign out from Skype.
Change all instances of 8080 in the config settings to 80, and restart apache.

How to solve "Error: Apache shutdown unexpectedly"?

I've just re-installed XAMPP, and when I try to start my Apache server in the XAMPP Control Panel, I now get the following errors:
16:50:25 [Apache] Status change detected: running
16:50:26 [Apache] Status change detected: stopped
16:50:26 [Apache] Error: Apache shutdown unexpectedly.
16:50:26 [Apache] This may be due to a blocked port, missing dependencies,
16:50:26 [Apache] improper privileges, a crash, or a shutdown by another method.
16:50:26 [Apache] Press the Logs button to view error logs and check
16:50:26 [Apache] the Windows Event Viewer for more clues
16:50:26 [Apache] If you need more help, copy and post this
16:50:26 [Apache] entire log window on the forums
How do I solve this?
As I am working in a corporate environment where developers faces firewall issues, none of the other answers resolved my issue.
As the port is not used by Skype, but by some other internal applications,
I followed the below steps to resolve the issue:
Step 1 - From the XAMPP Control Panel, under Apache, click the Config button, and select the Apache (httpd.conf).
Inside the httpd.conf file, somehow I found a line that says:
Listen 80
And change the 80 into any number / port you want. In my scenario I’m using port 8080.
Listen 8080
Still from the httpd.conf file, I found another line that says:
ServerName localhost:80
Change 80 to 8080.
ServerName localhost:8080
Step 2 - From the XAMPP Control Panel, under Apache, click the Config button again, but this time select the Apache (httpd-ssl.conf). Inside the httpd-ssl.conf file, find line that says
Listen 443
And change the 443 into any number / port you want. I’ll using 4433 as the new port number.
Listen 4433
Still from the httpd-ssl.conf file, find another line that says
<VirtualHost _default_:443>
ServerName localhost:443
And change 443 to 4433.
<VirtualHost _default_:4433>
ServerName localhost:4433
Remember to save the httpd.conf and httpd-ssl.conf files after performing some changes. Then restart the Apache service.
Open Skype.
Tools -> Options -> Advanced -> Connection.
Uncheck the "Use port 80 and 443 for alternatives for incoming connections" checkbox
Sign Out and Close all Skype windows. Try restarting your Apache.
In XAMPP Control Panel V3.2.1, click on "NetStat" button on top right. Make sure port 80 is not used by any other program. Then click on "Shell" Right below it. Issue this command in the shell prompt;
Apache_Start.bat
or type "ap" then tab the TAB key two times which will similarly generate the above command.
You will actually see the exact error why Apache failed. It will be mostly likely virtual host configuration issue or may be something else. It will display the line number on which the error is occurring. Just fix that error. Note that in RootDocument a trailing \ can be a source of error as well. Remove any trailing "".
One thing you can do is to stop the services on port 80 by issuing
net stop http
in a cmd. You'll be asked if you're sure you want to stop those services. I found out that I had a few services I wasn't using and disabled them.
To see who else is using port 80 type in a cmd
netstat -abno
I'm assuming you want to run Apache on port 80. If this is the case and you want to keep the conflicting services you will need to associate them to a new port.
If the problem is not a busy port you can also try the following: select "show debug information" in the XAMPP config panel. When starting Apache you'll be shown something like "Executing "c:\xampp\apache\bin\httpd.exe". If you run that
c:\xampp\apache\bin\httpd.exe
in a cmd you will get some more information (I once for instance had some issue with my httpd.conf file).
Related: How do I free my port 80 on localhost Windows? and Apache won't run in xampp
Follow these steps:
Open your XAMPP control panel then click its "Config"
Choose the "Apache (httpd.conf)" and find this code below and change it into this one:
#Change this to Listen on specific IP addresses as shown below
#to prevent Apache from glomming onto all bound IP addresses.
#Listen 0.0.0.0:80
#Listen [::]:80
Listen 80
# Dynamic Shared Object (DSO) Support
Save it (Ctrl + S)
After that, go back to the XAMPP control panel and click its config again.
Choose "Apache (httpd-ssl.conf)", find this code below, and change it again:
# Note: Configurations that use IPv6 but not IPv4-mapped addresses need two
# Listen directives: "Listen [::]:443" and "Listen 0.0.0.0:443"
#
#Listen 0.0.0.0:443
#Listen [::]:443
Listen 443
Save it (Ctrl + S)
Then, click the "config" (note: above the netstat) and click the "service and port settings".
Change "Main Port" to 8080 and "SSL Port" to 4433, then save it.
Finally, go to the "control panel" -> "Programs & Features" -> "Turn Windows On or Off".
Uncheck your "Internet Information Services", and then click OK.
Just wait for it and your computer/laptop will be automatically restart and try to open your XAMPP control panel again, and then start your Apache.
My problem was that in httpd.conf the DocumentRoot and <Directory> entries were pointing to non-existing folders.
For example, the 'original' httpd.conf had the following entries:
DocumentRoot "c:/Apache24/htdocs"
<Directory "c:/Apache24/htdocs">
If you've installed in C:\xampp then you need to change those entries to match, i.e.
DocumentRoot "c:/xampp/htdocs"
<Directory "c:/xampp/htdocs">
This worked for me...
If you are using windows...
Search 'cmd' in the windows search bar.
Enter this:C:\xampp\apache\bin\httpd.exe
Find which file and which line the error occurred.
For example, mine was in the file below
on line 37.
httpd-multilang-errordoc.conf
Open the code and fix the error by either removing the line or fixing it.
Done! I should work now.
:)
If you're using Windows 7 . Search for IIS in Windows search (Click the Window icon in left bottom and type in where it says 'Search program and files') .
Open IIS (Internet Information Service) .
In the right side in actions panel. Click Stop.
Note: The stop link is faded in screen shot. As I've stopped it.
Problem Solved!
I had the same issue, and it turns out I forgot to run setup_xampp.bat (portable version).
It seems that no one has answered about executing xampp_start.exe.
I did all the previous answers but it did not fixed my issue. I found out that running xampp_start.exe will give you a detailed info about the issue.
This is what I see on my end:
As you can see I was having a path issue or xampp is pointing to non-existing folder.
When I found that there was no process using port 80 by using commands
netstat -abno | find ":80"
there was not a problem of any process using port 80.
Then I ran command (in cmd)
C:\xampp\apache\bin\httpd.exe
it showed some error in the virtual hosts configuration in httpd-vhosts.conf file which was recently edited by me for installation in a WordPress PHP environment in the Eclipse IDE. So I deleted those lines and Apache started perfectly.
The simple thing that you can do is to check if Skype or VMware is installed in your machine or not.
Skype uses port 80 and 443 as an additional port for incoming connections. To change the port number in Skype, go to
Tools > Connection Options > Connection
in the Skype window. Now change the default 80 port number to something other.
VMware Workstation uses port 443 for sharing. To change this, open VMware Workstation and goto
Edit > Preferences > Shared Vms
Click "Change Settings" buton
Then Click "Disable Sharing"
Then change the https port number being used (443)
Then you can click "Enable Sharing" button
That's all you have to do. Restart XAMPP and run the Apache server.
I had the same problem sometime back. I had a old laptop, on which almost all the ports were either blocked or were malfunctioning. This is how I did it.
Open the XAMPP control panel.
Click on Config
Then, go into Apache httpd.conf file. Open it with a text editor.
Search for "80" (Do Ctrl + F and find all of them. Replace it with 8080 or 4040 or 4000).
Save the file. And restart XAMPP.
It worked well for me, and I hope it helps you too.
For me, world wide web publishing-service was using port 80. I killed this by running the following command on cmd:
net stop http
After that, XAMPP ran Apache without any problems.
One of the causes could be that you are not running the XAMPP Control Panel as an administrator.
This error occurs because the port, which is allocated for Apache, is used by another program. To check the application which uses the port, which we allocated for Apache, it can be had by clicking,
Netstat button.
This is the Netstat file,
At first, I have allocated port 8080 for Apache, and I recently installed Oracle DB.TNSLSNR.exe has used 8080 port now.
So, by looking at this file we can choose a port which is not clashing with other applications. In my case, port 8060 is not clashing with any application. By selecting that we can change the httpd.conf file (XAMPP control panel -> Config) as mentioned above.
download new xampp apachefriends
install it
remove all VPN app
open folder XAMPP run setup_xampp.bat
run xampp-control.exe
Sometimes the issue is not a port issue but may be due to a misconfiguration that you did and Apache is not logging the error on the Event Viewer in Windows. To go around this, simply
cd C:\xampp\apache\bin
and then run
httpd.exe
Apache will then spit out the error for you e.g. as below
AH00526: Syntax error on line 2 of C:/xampp/apache/conf/httpd.conf: Invalid command 'This', perhaps misspelled or defined by a module not included in the server configuration
I hope that helps some poor soul :)
In my case, this issue was caused by an attempt to download other product of bitnami, like WordPress. That's common when we install WordPress via XAMPP. It is placed in the xampp/app directory that can be accessed from the XAMPP application homepage.
As a solution, I removed the default installed WordPress from the xampp directory and manually installed WordPress in the htdocs folder of WordPress by downloading it and extracting zip files into the htdoc folder. You also need to restart XAMPP or may system after uninstalling/removing the default WordPress. All is OK for me now.
Make at first sure your \xampp folder is in the root! This is important as the path is relative.
Then make sure you run the xampp_control.exe with admin rights.
Then change the files below to avoid issues with blocked port 80.
In \xampp\xampp-control.ini it should be set:
[ServicePorts]
Apache=8080
ApacheSSL=4433
Find \xampp\apache\conf\httpd.conf and set:
Listen 8080
ServerName localhost:8080
Find \xampp\apache\conf\extra\httpd-ssl.conf and set:
Listen 4433
<VirtualHost _default_:4433>
ServerName www.example.com:4433
Then end all services and restart xampp-control.exe with admin rights. It should run!
I have just encountered this error on my xampp v3.2.2 [win 10 pro x64],
I first tried to run the "net stop http" command in an admin cmd, but it didnt solve the issue, so I went ahead to try the "netstat -abno" command and i found out that the ssl port(443) was in use by vmware.
so my advice, don't just look for what's blocking port 80, also look for potential programs using port 443. because I really don't like changing my default port numbers to 8081 and 4433.
So this is how you can solve this issue...
firstly type the following command
net stop http
then try to start apache, if it still doesn't work. type out the following command
netstat -abno
and you'll definitely get that troublesome app that's using up your precious port.
copy the pid and then use the following command
taskkill /f /pid PID
where PID is the pid you copied.
Hopefully this helps someone.
In my case port was already used by windows IIS service.
You can check if port is being already used from cmd. Open cmd and run this command:
netstat -ano
If it is being used by IIS you can stop it by following command. Open cmd as administrator, then:
iisreset /stop
Now try running XAMPP, it should work.
You can run apache_start.bat file from XAMPP directory for see details about your error details.
Try the following, none of the above solved it for me
Select "Run as administrator"
Then click on the big left box next to Apache
And Choose to uninstall Apache
I have no idea why this worked but it solved my problem directly!
Step 1: In Apache go to Config then select Apache(httpd.conf)
In the notepad, find Listen 80 and add another 80 to change the port to become Listen 8080
Make sure to save before closing the notepad.
Step 2: In Apache go to Config the select Apache(httpd-ssl.conf)
In the notepad, find Listen 443 and add another 3 after 443 to change the port to become Listen 4433
Then search for VirtualHost default:443 and add another 3 to change the port to become VirtualHost default:4433
Make sure to save before closing the notepad.
(Note: There is a similar answer here but it did not work for me until I fond a video on YT)
I solved the problem with stopping the service "Web Deployment Agent Service". Open: System -> Computer Management -> Services -> Web Deployment Agent Service. Stop this service and starting XAMPP works.
I think this is a service by MS Webmatrix.
(German: Systemsteuerung -> System und Sicherheit -> Verwaltung -> Dienste -> Webbereitstellungs-Agent-Dienst)
Best solution
open XAMPP control panel,click on config for Apache, then click on Apache(httpd.config).now in the text editor . ctrl+f --> find "Listen 80" and replace it with "Listen 8079" wtihout the quotations :)
but now you have to use it like this http://localhost:8079/
P.S, I tried to change port settings for skype , stopping the Web Deployment Agent Service which I could not find in windows 10,cmd--> net stop http, and other methods but nothing worked except this .
I had the exact same error message as the OP, but my problem was not addressed by any of the existing answers. Many of the answers deal with conflicts on port 80, which I knew I did not have, since I had had localhost responding on port 80 very recently.
Turns out I had inadvertently changed ServerRoot when I intended to change DocumentRoot (stupid, I know), and though the new ServerRoot directory existed, it did not contain the configuration files and other stuff apache needed, which caused it to fail on startup. The error message probably addresses this scenario by the wording 'missing dependencies'.
On my Windows system, setting ServerRoot back to C:/XAMPP/apache solved the problem.
The Apache server by default runs on ports 80, 443. Your problem is one or both of the two ports are busy. Usually Skype or VMware Workstation use these two ports. So, make sure that they're not running. The best way to make sure the ports are free on windows is :
Click windows button.
In the search bar type resmon, to open the resource monitor resmon.exe.
Open Listening Ports, this will show you the opened used ports.
Now you can see which process is using ports 80 and 443.
Then you can kill the process either from CMD using its PID (which is shown in the resource monitor), or directly from Task Manager.
To kill a process from CMD using PID type Taskkill /PID 26356 /F, where 26356 is the PID.
Best Solution for windows user is :
Open netstat (from XAMPP CONTROL PANEL)
Find PID of process which uses port 80.
Open CMD with Administrative.
Run taskkill /pid PID (instead PID use pid u found from netstat)
Heyy enjoy u Done.....

How to change XAMPP apache server port?

This is my Apache httpd.conf settings :
Listen 8012
ServerName localhost:8012
Every time I start Apache via XAMPP I see this message:
Status Check OK
Busy…
Apache Started [Port 80]
Anybody, please help me can I change any other settings ?
To answer the original question:
To change the XAMPP Apache server port here the procedure :
1. Choose a free port number
The default port used by Apache is 80.
Take a look to all your used ports with Netstat (integrated to XAMPP Control Panel).
Then you can see all used ports and here we see that the 80port is already used by System.
Choose a free port number (8012, for this exemple).
2. Edit the file "httpd.conf"
This file should be found in C:\xampp\apache\conf on Windows or in bin/apache for Linux.:
Listen 80
ServerName localhost:80
Replace them by:
Listen 8012
ServerName localhost:8012
Save the file.
Access to : http://localhost:8012 for check if it's work.
If not, you must to edit the http-ssl.conf file as explain in step 3 below. ↓
3. Edit the file "http-ssl.conf"
This file should be found in C:\xampp\apache\conf\extra on Windows or see this link for Linux.
Locate the following lines:
Listen 443
<VirtualHost _default_:443>
ServerName localhost:443
Replace them by with a other port number (8013 for this example) :
Listen 8013
<VirtualHost _default_:8013>
ServerName localhost:8013
Save the file.
Restart the Apache Server.
Access to : http://localhost:8012 for check if it's work.
4. Configure XAMPP Apache server settings
If your want to access localhost without specify the port number in the URL http://localhost instead of http://localhost:8012.
Open Xampp Control Panel
Go to Config ► Service and Port Settings ► Apache
Replace the Main Port and SSL Port values ​​with those chosen (e.g. 8012 and 8013).
Save Service settings
Save Configuration of Control Panel
Restart the Apache Server
It should work now.
4.1. Web browser configuration
If this configuration isn't hiding port number in URL it's because your web browser is not configured for. See : Tools ► Options ► General ► Connection Settings... will allow you to choose different ports or change proxy settings.
4.2. For the rare cases of ultimate bad luck
If step 4 and Web browser configuration are not working for you the only way to do this is to change back to 80, or to install a listener on port 80 (like a proxy) that redirects all your traffic to port 8012.
To answer your problem :
If you still have this message in Control Panel Console :
Apache Started [Port 80]
Find location of xampp-control.exe file (probably in C:\xampp)
Create a file XAMPP.INI in that directory (so XAMPP.ini and xampp-control.exe are in the same directory)
Put following lines in the XAMPP.INI file:
[PORTS]
apache = 8012
Now , you will always get:
Apache started [Port 8012]
Please note that, this is for display purpose only.
It has no relation with your httpd.conf.
The best solution is to reconfigure the XAMPP Apache server to listen and use different port numbers. Here is how you do it:
1) First, you need to open the Apache “httpd.conf” file and configure it to use/listen on a new port no. To open httpd.conf file, click the “Config” button next to Apache “Start” and “Admin” buttons. In the popup menu that opens, click and open httpd.conf
2) Within the httpd.conf file search for “listen”. You’ll find two rows with something like:
#Listen 12.34.56.78:80
Listen 80
Change the port no to a port no. of your choice (e.g. port 1234) like below
#Listen 12.34.56.78:1234
Listen 1234
3) Next, in the same httpd.conf file look for “ServerName localhost:” Set it to the new port no.
ServerName localhost:1234
4) Save and close the httpd.conf file.
5) Now click the Apache config button again and open the “httpd-ssl.conf” file.
6) In the httpd-ssl.conf file, look for “Listen” again. You may find:
Listen 443
Change it to listen on a new port no of your choice. Say like:
Listen 1443
7) In the same httpd-ssl.conf file find another line that says <VirtualHost _default_:443>. Change this to your new port no. (like 1443)
8) Also in the same httpd-ssl.conf you can find another line defining the port no. For that look for “ServerName”. you might find something like:
ServerName www.example.com:443 or ServerName localhost:433
Change this ServerName to your new port no.
8) Save and close the httpd-ssl.conf file.
9) Finally, there’s just one more place you should change the port no. For that, click and open the “Config” button of your XAMPP Control Panel. Then click the, “Service and Port Settings” button. Within it, click the “Apache” tab and enter and save the new port nos in the “main port” and “SSL port” boxes. Click save and close the config boxes.
That should do the trick. Now “Start” Apache and if everything goes well, your Apache server should start up.
You will also see the Apache Port/s no in the XAMPP control panel has change to the new port IDs you set.
If the XAMPP server is running for the moment, stop XAMPP server.
Follow these steps to change the port number.
Open the file in following location.
[XAMPP Installation Folder]/apache/conf/httpd.conf
Open the httpd.conf file and search for the String:
Listen 80
This is the port number used by XAMMP.
Then search for the string ServerName and update the Port Number which you entered earlier for Listen
Now save and re-start XAMPP server.
Have you tried to access your page by typing "http://localhost:8012" (after restarting the apache)?
I had problem too.
I switced Port but couldn't start on 8012.
Skype was involved becouse it had the same port - 80. And it couldn't let apache change it's port.
So just restart computer and Before turning on any other programs Open xampp first change port let's say from 80 to 8000 or 8012 on these lines in httpd.conf
Listen 80
ServerName localhost:80
Restart xampp, Start apache, check localhost.
if don't work above port id then change it.like 8082,8080
Restart xammp,Start apache server,Check it.It's now working.
If its Ubuntu SYSTEM:
Go to
cd /opt/lampp/etc/
vim httpd.conf
Here you can change the Listen Port Number
If you want to change the SSL Port:
`vim /opt/lampp/etc/extra/httpd-ssl.conf` -> Change the SSL Listen port
and vim /opt/lampp/properties.ini -> Do the changes here as well

IIS and Apache (WAMP) running

How can we run IIS 6 and Apache (wamp) in same machine at same time?
IIS and Apache should have different port.
To change the port of Apache(WAMP)
Click on WAMP icon that you can see on your tray or other shortcut icons for wamp.
Look for the Apache and open the httpd.conf or if you know where it is stored.
Find the "80" then change
Listen 80 to Listen 8080
ServerName localhost:80 to ServerName localhost:8080
Note: You can change the port which you desired as long as it will not conflict with your other port. It is more safe and common if the port is at this range.
Then click on Restart All Services.
See here for more info.
If you prefer to change your IIS rather Apache, check on this IIS
Another thing to watch out for is the port used for VirtualHosts (443). In your Apache folder, in conf/extra there should be a file called http-vhosts.conf
You should change all instances of 443 to a different port.
Change:
Listen 443
NameVirtualHost 127.0.0.1:443
<VirtualHost 127.0.0.1:443>
Then you should be good to run both services.
In the WAMPSERVER 3.0.6 and above right Click WAMPSERVER icon and navigate to tools option.(only if its green color- i.e all services are running). It will list all the options for Apache and MySQL. Test the available port or if not click on 'Use a port other than 8080, it will give you a pop up box and you can enter the value and text the port.Image attached
Or like in my case, I wanted wamp to run on port :80 on a secondary ip on the same network card.
This allows me to use my main ip to run IIS on :80 and the secondary ip :80 apache.
How to get multiple IP's on same networkcard? stackoverflow alias IP
Browse to 'C:\wamp64\bin\apache\apache2.4.23\conf'
open httpd.conf
Look for Line ~72 Listen 0.0.0.0:80 and change this to the secondary ip (in my case 192.168.210.41:80).
I had to restart pc because IIS did not want to restart. Start IIS first, then Wamp.
Works!
You can run both server simultenously by changing port number of Apache or IIS.
A) How you can change Apache port number:
1) Open “httpd.conf” file located in folder “C:\wamp64\bin\apache\apache2.4.23\conf”. You can also open file directly from system try if your wamp is running.
2) Search for “listen” text in file and update the default port 80 to 8080.
3) Now Restart the WAMP server to make new port number effective.
4) Open the browser with url “http://localhost:8080/” wamp will show home page.
Reff: http://sforsuresh.in/iis-and-wamp-servers-on-the-same-system/
B) How you can change IIS port:
1) Go start and type IIS.
2) IIS Manager will open. click on “Default Web Site” on left hand side.
3) click on “bindings…” from the right side action section.
4) Popup will open with 80 port listed. select it and click the edit button.
5) Update the port and restart the server.Now try to access using browser.
Reff: http://sforsuresh.in/change-iis-port-windows/