Apache is running on Port 80 but can't connect remotely - apache

I have Apache installed on Windows 7. It's running successfully - I can connect to it from the local host. The problem is that none of the other computers on the local wireless network don't connect.
I have configured the \apache\conf\httpd.conf to "Allow from all" and to "Listen 80"
I disabled the Firewall for Port 80
Also, the command netstat -abn shows:
TCP 0.0.0.0:80 0.0.0.0: LISTENING
Can anyone think of a reason that prevents me to connect from another machine?

Try using the repair option on the firewall - sometimes the wizard there will add additional rules which resolve the issue.

Related

Metasploit handler failed to bind to port 4444

I am running Kali Linux on VMware. The host operating system is windows 7, and I'm using NAT for connectivity.
In my metasploit console, when I typed 'exploit' at the msf prompt,(where I am using windows/meterpreter/reverse_tcp as the payload) it showed me the error
Handler failed to bind to My IP:4444
(My IP is my external IP address.)
So in the VMware virtual network editor, I have port forwarded port 4444 of host PC to port 4444 of the virtual PC. Then I allowed inbound packets in the firewall of the host PC, for port 4444 of the host PC.
To ensure that everything is alright, I set up an apache server on the virtual PC, that serves a webpage when accessed via port 4444. The server served flawlessly when I accessed it with an external browser. Satisfied, I shut down the server.
But guess what? Metasploit console has thrown up the same error when I typed 'exploit' again in the msf prompt.
What to do now?
What did it say the reason for failing was.
I'm assuming the full error was failed to bind to port 4444 port is already in use.
You can not run a server on the same port you are trying to bind to.
The correct way to do this is to port forward through your router. Open your router settings and port forward port 4444 to your machines local ip.

Why is connection refused by Vagrant box in Windows 10?

I've been having problems with Vagrant since upgrading to Windows 10. At first I had the "host-only adapter" problem that many people seem to be experiencing. This was fixed by updating VirtualBox to the latest version, and my Vagrant box now seems to provision and start ok, and I can SSH into it, but can't connect via HTTP. If I try to access it from a browser, I get "Unable to connect". If I try curling it, I get the message:
Failed to connect to test.dev port 80: Connection refused
I've checked and Apache seems to be running on the VM (and in fact if I SSH into the VM and then run curl 127.0.0.1 the expected homepage is returned). At this point I've drawn a blank: I don't know whether the problem is in Windows or the VM's settings. Any help would be greatly appreciated!
(For what it's worth, I'm using VirtualBox 5.0.15r105158 + Vagrant 1.8.1)
Update: it turns out that the VM is accessible from test.dev:8888 in the browser, so I'm guessing the problem is to do with port-forwarding? I don't know much about this though, so have no idea why this wouldn't be working in Windows 10. (In case it helps, my Vagrantfile contains the line config.vm.network :forwarded_port, guest: 80, host: 8888)
I think you have answered all by yourself - you might read the vagrant doc on port forwarding
Vagrant forwarded ports allow you to access a port on your host
machine and have all data forwarded to a port on the guest machine,
over either TCP or UDP.
For example: If the guest machine is running a web server listening on
port 80, you can make a forwarded port mapping to port 8888 (or
anything) on your host machine. You can then open your browser to
localhost:8888 and browse the website, while all actual network data
is being sent to the guest.
when you add the line config.vm.network :forwarded_port, guest: 80, host: 8888 to your vagrant file, the VM (i.e. call also guest or guest VM) )will forward all the stream going on its port 80 to the host (in you case the windows machine) on port 8888, so in this case when you point your browser to listen on port 8888 you can see the website running from the VM
When you are within the VM though, you point to the expected 80 port.
one additional point (hope not to confuse you): in your Vagrantfile, did you define something for networking ? (param config.vm.network) you probably define a fixed IP (since you point to test.dev) in such case you dont need to do port forwarding, you can correctly access http://test.dev (on default port 80) as nothing else is bounding to this port. Port forwarding is really useful when you use public network and you do not define a fix IP to the guest VM, so in this case you access the site running on the VM from localhost/127.0.0.1, and as such you cannot just point to port 80, as something on your host can already be running.

I cannot access the default Apache webserver page, which is hosted in a VirtualBox VM, from my machine

My machine is a regular laptop with Windows 7. I have a Virtualbox VM running Ubuntu Server 14.04.1 and I have apache2 installed. When I try to access the default webserver page (10.0.2.15) from my machine, it cannot find the page. I have disabled my machine's firewall so that isn't causing the issue. The network for my VM is NAT, but I also tried the bridged adapter setting to no avail. Any suggestions would help.
Can you ping the server? If so, try the netstat command in server terminal to determine if it listens to port 80. If you cannot ping it, check the network address, f.x with ifconfig
If you can ping apache from the server, you probably have a problem with the network.
Try to add an host only interface. Then, in your VM, sudo ifconfig. Use the eth1's ip.

WAMP - Your port 80 is actually used - Error

I installed Wamp server and when I open it, it never gets online. It always stays orange (offline). I read something about Skype, but I don't even have Skype installed and when I go to Apache > Service > Test port 80 it says: Your port 80 is actually used
Any ideas how to make this work?
I've solved this today!! If you are on Windows, You go to
"Control Panel" >> "System And Security" >> "Administrative Tools" >> "Component Services" >> "Services (LOCAL)"
Now, since you are using WAMP and not IIS you should disable the "World Wide Web Publishing Service" and the "Web Deployment Agent Service". You are good to go.
If this doesn't work you probably have Skype using Port 80 (if you actually have Skype). (If you have IIS installed you should also disable it. But if you don't have it installed you shouldn't worry!)
If you are using windows machine the port 80 is used by the IIS Server and Skype also used the port 80. that why it says that port 80 is already used.
To avoid the conflict,change the port number of the wamp server to some other number,for example 5050.
for changing the port number of the wamp server go to:
C:\wamp\bin\apache\apache2.4.9\conf\httpd.conf
In that file change the listen port to 5050.
#Listen 12.34.56.78:5050
Listen 0.0.0.0:5050
Listen [::0]:5050
and you access the wamp server at localhost:5050
It works for me and I hope it works.
If you are in windows, try:
netstat -b
on Commandline, this will give you an information what file is using port 80, it should look like this:
[httpd.exe]
TCP 0.0.0.0:80 YOUR_PC:0 ABHÖREN
[httpd.exe]
TCP [::1]:80 YOUR_PC:53342 HERGESTELLT
[httpd.exe]
TCP [::1]:80 YOUR_PC:53343 HERGESTELLT
[httpd.exe]
TCP [::1]:80 YOUR_PC:53344 HERGESTELLT

Apache installation on Windows 7

I am a newbie with Apache. I am learning .. after the installation when I tried to start the service I got the following errors.
The Apache service named reported the following error:
Unable to open logs .
The Apache service named reported the following error:
no listening sockets available, shutting down .
The Apache service named reported 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 .
The Apache service named reported the following error:
httpd.exe: Could not reliably determine the server's fully qualified domain name, using 192.168.1.6 for ServerName .
The following error usually means that some other program is listening on the HTTP port (80).
(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 .
In my experience, IM (chat) clients like to connect to port 80.
From a command prompt, (cmd.exe) run the command:
netstat -an
See if there is a listener on port 80 (Look for a line that says:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
=== ====
the important thing being TCP and 80. If you find something, you'll need to track it down using something like TcpView
If Skype is your problem and it seems it usually is, alter Skype's port usage.
Click on Tools in Skype,
click on Options,
click Advanced,
click Connections.
In Connection is the option to use another port, I use a high numbered port such as 65432, then un-click the alternative use of port 80 and 443.
Close and restart Skype.
modifying C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd sloved the problem.
If you had installation problems, note that you might experience some errors such “ no services installed ”
if Apache is trying to share port 80 with another web server or application, such as a locally installed
firewall application. To fix this, you can tell Apache to use a different port. Open your httpd.conf file
in the conf subdirectory ( C:\Program Files\Apache Software Foundation\Apache2.2\conf by
default) and locate the following lines:
# Listen: Allows you to bind Apache to specific IP addresses and/or
# ports, instead of the default. See also the < VirtualHost >
# directive.
#
# Change this to Listen on specific IP addresses as shown below to
# prevent Apache from glomming onto all bound IP addresses (0.0.0.0)
#
#Listen 12.34.56.78:80
Listen 80
Change the last line of this block to read:
Listen 8080
skype uses port 80, try logout and shut down the program...
now run apache
if you are using windows os and believe that skype is not the suspect, then you might want to check the task manager and check the "Show processes from all users" and make sure that there is NO entry for httpd.exe. Otherwise, end its process. That solves my problem.
Changing in the config file every occurrence of the path to apache (eg: "C:/Users/xxxx/Desktop/Apache Software Foundation/") to the new location (in case you shifted directory of apache installation by copy paste) solved my problem. Hope it helps you too..
Please note that, not only http port 80, may your ssl port 443 is being used by any other service or software.
I have installed vmware workstation on my PC, so a process which was initiated by Vmware Workstation was using ssl port 443.
In my case, it was vmware-hostd.exe which was utilizing ssl port 443.
Try shutting down vmware-hostd.exe or simply change your ssl-httpd.conf and modify Listen from 443 to 8080 or something else.
While choosing the port number please be sure that you don't enter any port which can be used by any other software on your PC.
just provide the listen address and port in httpd.conf file. that will not show IP related error as
Listen IP_ADDRESS:PORT
If you change port ( not port 80) then port conflict will not occur and server comes up.
Below blog may help you :-
http://apache2-4-9-webserver-installation.blogspot.com/2014/06/how-to-install-apache-http-server.html
Port 80 conflict. There are a number of well-known Windows programs which use
port 80:
IIS
The most likely culprit is Microsoft Internet Information Server. Stop the
service with the command from the command line on Windows 7/Vista:
net stop was /y
If needed start the services again with the command from the command line on
windows /Vista:
net start was /y