Apache (xamp) and IIS cannot work together - apache

I have XAMP 1.6.8 and IIS 5.0 installed on my PC(Windows XP SP3).
I'm unable to run them simultaneously. If IIS service is running, Apache throws the following error:
(OS 10048)Only one usage of each socket address (protocol/network address/port) is normally permitted. : make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Note the errors or messages above, and press the key to exit. 24...
Windows could not start the Apache2 on Local Computer. For more information, review the System Event Log. If this is a non-Microsoft service, contact the service vendor, and refer to service-specific error code 1.
Edit:
Apache runs on a different port 3128. And IIS (asp.net) usually runs on a different port.

"could not bind to address 0.0.0.0:80" means that, when it starts up, it tries to bind to port 80 on all available network interfaces. As IIS already has hogged one (or more) IPs to bind to, apache cannot get any and so will fail.
(I'm not sure if it will bind to any available IPs if you've configured it to bind to all, but one is already taken.)
So, configure Apache to bind to a different port (if you only have 1 IP address), or to bind to a different IP or range of IPs.
You do this by changing the binding. First find the Listen directive in the configuration file (httpd.conf) and change it. Currently it will say "Listen 80" (meaning all IPs), change it to say "Listen 192.168.0.2:80" to make it bind to that specified IP address.
You may have to edit the IIS configuration too to tell it to only bind to a single IP address too.

You need to configure either Apache or IIS to listen on a different port.
You can also use tcpview to check which ports are in use by which applications since it sounds like you have a conflict.

If you cant hit the arrow in centre of the circle, hit the arrow and then draw a circle around it. - I tried everything advised, uninstalled skype, no IIS running,added apache program to antivirus, still this did not solve the program
finally i changed apaches port from 80 to 82 look for Listen 80 in the httpd.conf and change this

Related

Can not access web app hosted on apache from local network

As a newbie set up mediawiki in apache httpd on my linux pc. In the corresponding .conf file "require all granted'" is set. The pc was assigned static IP 192.168.0.2 by the router. The port 80 of the pc is opened for any device. I visited http://192.168.0.2/mediawiki/index.php from the host. It worked as expected. Now I tried to visit the same address from my android phone connected to the same network and I was presented with the message "127.0.0.1 refused to connect" by chrome. I noticed that the part http://192.168.0.2 had been replaced by https://127.0.0.1 in the address bar. The same thing also occurred on Firefox on my phone. I can still visit http://192.168.0.2 from my phone and it works just fine. So what is happening here and how to solve this problem?
EDIT: The problem is solved. Mediawiki has this LocalSettings.php file which gets automatically created during installation. It contains a field "$wgServer" which is the "The protocol and server name to use in fully-qualified URLs" as shown in the documentation. This value was automatically set to "http://127.0.0.1" during the installation. Thereby whenever I was trying to connect to mediawiki from my phone I was actually getting redirected to that same phone. I changed the value to "http://192.168.0.2" and now everything is working fine!
Looks like something happened at the connection from your mobile phone to the pc hosting the web server.
Your configuration looks fine even tho you provided almost no details at all: according to your description, I suspect the problem is on your phone or on your router because the domain and url switched from 192.168.0.2 to 127.0.0.1 and the protocol switched from http to https.
You should try the same test from another pc connected to the same network.
You can have a better understanding of what's happening, testing the connection from command line using curl:
$ curl -v http://192.168.0.2/mediawiki/index.php
The output will give you some details of what's going on if the redirect was requested by the webserver or not.
My guess is that your apache is configured to listen to 127.0.0.1 or localhost (it's the default). Open httpd.conf or your virtual host configuration file and look for Listen. Here's some snippets from the official documentation:
The Listen directive tells the server to accept incoming requests only on the specified port(s) or address-and-port combinations. If only a port number is specified in the Listen directive, the server listens to the given port on all interfaces. If an IP address is given as well as a port, the server will listen on the given port and interface. Multiple Listen directives may be used to specify a number of addresses and ports to listen on. The server will respond to requests from any of the listed addresses and ports.
For example, to make the server accept connections on both port 80 and port 8000, on all interfaces, use:
Listen 80
Listen 8000
To make the server accept connections on port 80 for one interface, and port 8000 on another, use
Listen 192.0.2.1:80
Listen 192.0.2.5:8000
More information at
https://httpd.apache.org/docs/2.4/bind.html

Unable to change Apache port number in Xampp

I just downloaded Xampp server xampp-win32-1.8.2-0-VC9.zip file for windows and tried to start the apache server. But the server failed to start with the following message:
XAMPP now starts as a console application.
Instead of pressing Control-C in this console window, please use xampp_stop.exe
to stop XAMPP, because it lets XAMPP end any current transactions and cleanup
gracefully.
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:
80
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
So clearly the port number 80 is already occupied.
So I went to the apache/conf/httpd.conf file and found the line:
#Listen 12.34.56.78:80
Listen 80
And changed the second line above to
Listen 8010
So the server must now start at port number 8010.But its instead starting on https default port number 443 and again giving the same error:
XAMPP now starts as a console application.
Instead of pressing Control-C in this console window, please use xampp_stop.exe
to stop XAMPP, because it lets XAMPP end any current transactions and cleanup
gracefully.
(OS 10048)Only one usage of each socket address (protocol/network address/port)
is normally permitted. : AH00072: make_sock: could not bind to address 0.0.0.0:
443
AH00451: no listening sockets available, shutting down
AH00015: Unable to open logs
So how should I make the server run at the port number of my choice and why is my approach not working. As far as I can remember, the approach used to work on earlier versions of xampp but is not working now.
This is the link which helped me to change my port.
And this video too.
Turns out that Skype blocks XAMPP from running apache. Just close skype, open the server, and reopen skype. That fixed the issue for me.
If you are using Xampp, open this file httpd-ssl.conf and search for this entry Listen 443, change it to ,say, Listen 444
Then restart apache.
You need to change the port from the https-ssl.conf. From control panel of xamp config and apache (Httpd-ssl.conf) change the port.
I ran setup_xampp.bat and edited the port number from the control panes using the config button of apache. Then I found this line Listen 80 and change the port number to 81 by editing this line. This solved the problem for me.

I want apache give no response

I am running apache2.2 on my WinXP PC.
I want no body but a specified IP access the site.
I already use httpd.conf to deny other request.
But that's not enough, I now want to set apache to send no response, not 403.
To be simple, I want to hide my server, I don't want others know I am running a webserver.
You could bind the Apache server to localhost only. I've not tested it, but in ports.conf, you could change:
Listen 80
to
Listen 127.0.0.1:80
That would make apache bind to the IP address 127.0.0.1, which is only available from the machine itself.
This is clearly something very easy to do with a firewall, so you should try to install and configure a firewall.
On the apache side the only thing you could try is using mod_security with the "drop" action. Check this servfault answer for example. But if the connection is closed by apache an attacker could still see the connection was first accepted, so your web server is not really hidden.

XAMPP PORT 80 is Busy / EasyPHP error in Apache configuration file:

This problem has completely shot my entire day. I reformatted my old windows XP comp and tried installing XAMPP only to find that when i try to start Apache xampp claims port 80 is busy....WHAT DOES THAT EVEN MEAN?
So I tried just uninstalling and moving to EasyPHP instead and when I installed that I get the error "error in Apache configuration file: the system cannot execute the specified program"
No, I do not have Skype or any other programs really for that matter at this point, like I said I JUST REFORMATTED so idk whats going on.
I would love to get this fixed, but if you leave me a answer please be specific on directions bc I'm only programming, never been to big on IT and playing with command lines and what not for me isn't to much fun.
Things to be done to free port 80:
check if skype is running, exit from skype
check services.msc if web deployment agent service is running
check if IIS is running, stop it.
Once you start apache, you can sign into skype.
Only one process can use port 80 at a time. Port 80 is the default port for web servers, so when you navigate to websites over HTTP, you are actually navigating to that server's port 80 by default (when you use HTTPS, the port is 443).
You can try to hunt down all the programs that are running on port 80, but there's an easier way that will work for development. When running XAMPP, click "Config" under "Apache". Replace Listen 80 with Listen 8080 and ServerName localhost:80 to ServerName localhost:8080.
Then, when you want to look at your masterpiece, navigate to http://localhost:8080 in your browser.
SQL Server Reporting Services (SSRS) SSRS can remain active even if you uninstall SQL Server.
To stop the service:
Open SQL Server Configuration Manager.
Select “SQL Server Services” in the left-hand pane.
Double-click “SQL Server Reporting Services”.
Hit Stop.
Switch to the Service tab and set the Start Mode to “Manual”.
Skype
Irritatingly, Skype can switch to port 80. To disable it, select Tools > Options > Advanced > Connection then uncheck “Use port 80 and 443 as alternatives for incoming connections”.
IIS (Microsoft Internet Information Server)
For Windows 7 (or vista) its the most likely culprit. You can stop the service from the command line.
Open command line cmd.exe and type:
net stop was /y
For older versions of Windows type:
net stop iisadmin /y
Other
If this does not solve the problem further detective work is necessary if IIS, SSRS and Skype are not to blame. Enter the following on the command line:
netstat -ao
The active TCP addresses and ports will be listed. Locate the line with local address “0.0.0.0:80″ and note the PID value. Start Task Manager. Navigate to the Processes tab and, if necessary, click View > Select Columns to ensure “PID (Process Identifier)” is checked. You can now locate the PID you noted above. The description and properties should help you determine which application is using the port.
Run this in command prompt:
netstat -ano | find ":80"
It will show you what process (PID) is listening on port 80.
From there you can open task manager, make sure you have PID selected in columns view option, and find the matching PID to find what process it is.
If its svchost.exe you'll have to dig more (see tasklist /svc).
I had this happen to me recently and it wasn't any of the popular answers like Skype either, could be Adobe, Java, anything really.
Port 80 might be busy with other application like IIS. If you don't want to stop it, you can change the apache port. Here is the way..
go to the C:\xampp\apache\conf (directory where you installed xampp). Now, locate the httpd.conf.
Open it with any text editor (like notepad) and go the line that says Listen 80
Change this with any other port (like Listen 1234)
Save the file. Restart the server and go ahead.
xampp port 80 is busy when some other application is using the same port at that time. This can be solved by using one of the following methods:
Detect the application which is using the port 80 and close it.
This one is more efficient. xampp installs apache server with default port 80. So, you can change this port manually to any number.
Just find the httpd.conf file in xampp installation and replace the following line of code.
#Listen 12.34.56.78:1234
Listen 80
to any port number of your choice. Here, i have taken 8000.
#Listen 12.34.56.78:1234
Listen 8000
Find the following code in the same file httpd.conf
ServerName localhost
Replace with the following, take the same number you have used in upper code.
ServerName localhost:8000
For detailed answer, check http://webolute.com/blog/programming/this-may-be-due-to-a-blocked-port-missing-dependencies
Just do one thing
open skype > tools > advance or advance settings Change port 80 to something else 7395
Restart your system then start Apache
I've found that the biggest culprit for taking up port 80 on newer Windows installs is the BranchCache Service (#3) in this list...
SQL Server Reporting Services
Web Deployment Agent Service
BranchCache
World Wide Web Publishing Service
These 4 service probably cover 90% of the native Windows Services that take up port 80.
The other 10% is the hidden HTTP.sys service/driver which takes port 80 when another service requests it. Run this to disable it, and reboot.
sc config http start= disabled
Aside from Skype, TeamViewer is also very commonly installed software, and will take port 80 if not configured otherwise.
List taken from: Opening Up Port 80 For Apache to Use On Windows
If you are running VMWare Workstation , you need to stop the VmWare Workstation server - port 443 as well
So I have faced the same problem when trying to start apache service and I would like to share my solutions with you.
Here is some notes about services or programs that may use port 80:
Skype: skype uses port 80/443 by default. You can change this from tools->options->
advanced->connections and uncheck the checkbox "use port 80 and 443 for addtional incoming connections".
IIS: IIS uses port 80 be default so you need to shut down it. You can use the following two commands
net stop w3svc
net stop iisadmin
SQL Server Reporting Service: You need to stop this service because it may take port 80 if IIS is not running. Go to local services and stop it.
These options work great with me and I can start apache service without errors.
The other option is to change apache listen port from httpd.conf and set another port number.
Hope this solution helps anyone who face the same problem again.
This happens because some other programs running in your system is using the default port 80 used for http service by apache server in xampp/easy php.
Some programs like skype usually use port 80.
so find such program and remove it ...
For finding programs listening port 80 refer Port 80 listening programs
Try finding the Service running on the PID that is blocking the service from Task manager->Services
In case this isn't of help go to Task Manager->Services
Go to the Services button on bottom right of window and stop the Web Deployment Agent Service. Retry starting Apache . That might solve the problem.
This problem is because port 80 is used by some other application. Try to reconfigure port.

Apache and IIS side by side (both listening to port 80) on windows2003

What are some good ways to do this? Is it even possible to do cleanly?
Ideally I'd like to use packet headers to decide which server should handle requests. However, if there is an easier/better way let me know.
It's impossible for both servers to listen on the same port at the same IP address: since a single socket can only be opened by a single process, only the first server configured for a certain IP/port combination will successfully bind, and the second one will fail.
You will thus need a workaround to achieve what you want. Easiest is probably to run Apache on your primary IP/port combination, and have it route requests for IIS (which should be configured for a different IP and/or port) to it using mod_rewrite.
Keep in mind that the alternative IP and port IIS runs on should be reachable to the clients connecting to your server: if you only have a single IP address available, you should take care to pick an IIS port that isn't generally blocked by firewalls (8080 might be a good option, or 443, even though you're running regular HTTP and not SSL)
P.S. Also, please note that you do need to modify the IIS default configuration using httpcfg before it will allow other servers to run on port 80 on any IP address on the same server: see Micky McQuade's answer for the procedure to do that...
I found this post which suggested to have two separate IP addresses so that both could listen on port 80.
There was a caveat that you had to make a change in IIS because of socket pooling. Here are the instructions based on the link above:
Extract the httpcfg.exe utility from the support tools area on the Win2003 CD.
Stop all IIS services: net stop http /y
Have IIS listen only on the IP address I'd designated for IIS: httpcfg set iplisten -i 192.168.1.253
Make sure: httpcfg query iplisten (The IPs listed are the only IP addresses that IIS will be listening on and no other.)
Restart IIS Services: net start w3svc
Start the Apache service
For people with only one IP address and multiple sites on one server, you can configure IIS to listen on a port other than 80, e.g 8080 by setting the TCP port in the properties of each of its sites (including the default one).
In Apache, enable mod_proxy and mod_proxy_http, then add a catch-all VirtualHost (after all others) so that requests Apache isn't explicitly handling get "forwarded" on to IIS.
<VirtualHost *:80>
ServerName foo.bar
ServerAlias *
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
</VirtualHost>
Now you can have Apache serve some sites and IIS serve others, with no visible difference to the user.
Edit: your IIS sites must not include their port number in any URLs within their responses, including headers.
You need at least mod_proxy and mod_proxy_http which both are part of the distribution (yet not everytime built automatically). Then you can look here: http://httpd.apache.org/docs/2.2/mod/mod_proxy.html
Simplest config in a virtualhost context is:
ProxyPass /winapp http://127.0.0.1:8080/somedir/
ProxyPassReverse /winapp http://127.0.0.1:8080/somedir/
(Depending on your webapp, the actual config might become more sophisticated. )
That transparently redirects every request on the path winapp/ to the windows server and transfers the resulting output back to the client.
Attention: Take care of the links in the delivered pages: they aren't rewritten, so you can save yourself lotsa hassle if you generally use relative links in your app, like
<a href=../pics/mypic.jpg">
instead of the usual integration nightmare of every link being absolute:
<a href="http://myinternalhostname/somedir/crappydesign.jpg">
THE LATTER IS BAD ALMOST EVERY SINGLE TIME!
For rewriting links in pages there's mod_proxy_html (not to confuse with mod_proxy_http!) but that's another story and a cruel one as well.
Either two different IP addresses (like recommended) or one web server is reverse-proxying the other (which is listening on a port <>80).
For instance: Apache listens on port 80, IIS on port 8080. Every http request goes to Apache first (of course). You can then decide to forward every request to a particular (named virtual) domain or every request that contains a particular directory (e.g. http://www.example.com/winapp/) to the IIS.
Advantage of this concept is that you have only one server listening to the public instead of two, you are more flexible as with two distinct servers.
Drawbacks: some webapps are crappily designed and a real pain in the ass to integrate into a reverse-proxy infrastructure. A working IIS webapp is dependent on a working Apache, so we have some inter-dependencies.
I see this is quite an old post, but came across this looking for an answer for this problem. After reading some of the answers they seem very long winded, so after about 5 mins I managed to solve the problem very simply as follows:
httpd.conf for Apache leave the listen port as 80 and 'Server Name' as FQDN/IP :80.
Now for IIS go to Administrative Services > IIS Manager > 'Sites' in the Left hand nav drop down > in the right window select the top line (default web site) then bindings on the right.
Now select http > edit and change to 81 and enter your local IP for the server/pc and in domain enter either your FQDN (www.domain.com) or external IP close.
Restart both servers ensure your ports are open on both router and firewall, done.
This sounds long winded but literally took 5 mins of playing about. works perfectly.
System:
Windows 8, IIS 8, Apache 2.2
Installing Windows 10 I had this problem: apache(ipv4) and spooler service(ipv6) listening the same 80 port.
I resolved editing apache httpd.conf file changing the line
Listen 80
to
Listen 127.0.0.1:80
That's not quite true. E.g. for HTTP Windows supports URL based port sharing, allowing multiple processes to use the same IP address and Port.
You will need to use different IP addresses. The server, whether Apache or IIS, grabs the traffic based on the IP and Port, which ever they are bound to listen to. Once it starts listening, then it uses the headers, such as the server name to filter and determine what site is being accessed. You can't do it will simply changing the server name in the request