Thursday 25 December 2014

Microsoft HTTP/API port 80 is actually used


Microsoft HTTP/API 2.0 Using Port 80,
WAMP - Your port 80 is actually used , change port number in wamp


After Installation of Wamp you may suffer from an Error that says that Your Port 80 is actually used , change port number in wamp
I decided to sit and give a search on this error to finally find and share an optimal solution to this error . This error may come if you have already Installed IIS Server on your windows Computer .
you may see one of these Errors :

 "Microsoft HTTP/API 2.0" Using Port 80

 WAMP - Your port 80 is actually used 

Steps For Optimal Solution to this Error -


1.  Updating/configuring httpd.conf file
2.  Updating/configuring wampmanager.tpl file
3.  Updating/configuring testport.php file
4.  Updating/configuring testportForInstall.php file
5.  Checking http.exe Application

 Updating/configuring httpd.conf file

httpd.conf file is http configuration file for apache server . All apache configuration in wamp are stored in this file . This file contains the information regarding which port and server is to connect for making connection to Server .

As this error states the port 80 is already used so follow the steps below to change the port that apache is using currently

Steps For Change Apache Port Number In WAMP

  • Click on Wamp Icon on quick Launch Bar 
  • In popup Menu click on Apache and then in further menu click on httpd.conf
  • It will open httpd.conf file in your editor like you can use Notepad
  • Now Press Ctrl + f and find for lines given below :


#Listen 12.34.56.78:80
Listen 0.0.0.0:80
Listen [::0]:80

ServerName localhost:8080
  • Now Replace these lines with given below :

#Listen 12.34.56.78:8484
Listen 0.0.0.0:84
Listen [::0]:84

ServerName localhost:8484
  • Now it's done . Press Ctrl +s  to save all changes and close the httpd.conf file
  • Now again click on wamp icon in Quick Launch Bar and click On Restart All Services 

Updating/configuring wampmanager.tpl file

1. In order to find wampmanager.tpl file you need to go to following location .Like we have installed wamp in C drive then your wampmanager.tpl file location will be c:\wamp\wampmanager.tpl
2. Now open wampmanager.tpl file and press ctrl + f and find for 'testPort84' without quotes
3. Then replace -
testPort80 with atestPort84
4. Press ctrl + s to save changes and Close the File .

Updating/configuring testport.php file

Now we need to make changes to testport.php file . This file tests for whether the port 80 is available to install the apache service to that port . 

This file checks the socket port 80 for installation of apache service . use the simple steps below to configure testport.php file 

1. I will give you simple way to configure it Just open the file testport.php . File location will be available at C:\wamp\scripts\testport.php . Just open the file and replace all the test with text given below -

<?php
$fp = @fsockopen("127.0.0.1", 84, $errno, $errstr, 1);
   $out = "GET / HTTP/1.1\r\n";
   $out .= "Host: 127.0.0.1\r\n";
   $out .= "Connection: Close\r\n\r\n";
if ($fp)
{
    echo  'Your port 84 is actually used by :';
   fwrite($fp, $out);
   while (!feof($fp)) 
   {
        $line = fgets($fp, 128);
        if (ereg('Server: ',$line))
        {
           
            echo $line;
            $gotInfo = 1;
        }  
        }
    fclose($fp);
    if ($gotInfo != 1)
        echo 'Information not available (might be Skype).';
}
else
{
    echo 'Your port 84 is not actually used.';
}
echo 'Press Enter to exit...';
trim(fgets(STDIN));
?> 

 Updating/configuring testportForInstall.php file

Now we need to make changes to testportForInstall.php file . This file tests for whether the port 80 is available to install the apache service to that port . 

This file checks the socket port 80 for installation of apache service . use the simple steps below to configure testportForInstall.php file 

1. I will give you simple way to configure it Just open the file testport.php . File location will be available at C:\wamp\scripts\testportForInstall.php . Just open the file and replace all the test with text given below -

<?php
$fp = @fsockopen("127.0.0.1", 84, $errno, $errstr, 1);
   $out = "GET / HTTP/1.1\r\n";
   $out .= "Host: 127.0.0.1\r\n";
   $out .= "Connection: Close\r\n\r\n";
if ($fp)
{
           echo  'Your port 84 is actually used by :

';
   fwrite($fp, $out);
   while (!feof($fp)) 
   {
        $line = fgets($fp, 128);
        if (ereg('Server: ',$line))
        {
            echo $line;
            $gotInfo = 1;
        }
    
    }
    fclose($fp);
    if ($gotInfo != 1)
        echo 'Information not available (might be Skype).';
    echo '
Cannot install the Apache service, please stop this application and try again.

Press Enter to exit...';
trim(fgets(STDIN));
}
else
{
    echo 'Your port 84 is available, Install will proceed.';
    echo '

Press Enter to continue...';
    trim(fgets(STDIN));
}
?> 

Checking http.exe Application

you can find httpd.exe file at location - C:\wamp\bin\apache\apache2.4.9\bin\httpd.exe , if C is installed at C drive .

Double click on file it will open for a slight small amout of time and show you any error in first line if exist otherwise everything will be fine . If error exist then try to ensure you have done previous steps completely . As these are the final possible steps that may solve this problem


Share this

0 Comment to "Microsoft HTTP/API port 80 is actually used"

Post a Comment