I have installed Apache server on my Windows 7 computer. I was able to display the default index.php by typing http://localhost/ in the address line of my browser.
However, I am still unable to see this page by typing IP address of my computer (neither locally (from the same computer) no globally (from another computer connected to the Internet)).
I was told that I need to open port 80. I did it (in a way described here) but it did not solve the problem.
First of all I would like to check which ports are opened and which are not. For example I am not sure that my port 80 was closed before I tried to open. I am also not sure that it is opened after I tried to open it.
I tried to run a very simple web server written in Python. For that I used port 81 and it worked! And I did not try to open the port 81. So, it was opened by default. So, if 81 is opened by default, why 80 is not? Or it is?
ADDITIONAL INFORMATION:
1. In my httpd.conf file I have "Listen 80".
2. This site tells me that port 80 on my computer is opened.
3. I get different responses if I try http://myip:80 and http://myip:81. In the last case browser (Chrome) writes me that link is broken. In the first case I get: Forbidden You don't have permission to access / on this server.
4. IE writes that "The website declined to show this webpage".
If you are just spot checking your ports from the outside. Use this tool:
http://www.yougetsignal.com/tools/open-ports/
It will attempt to connect to your IP address, on the specific port, and let you know if it is open or closed to the outside world.
Local issues too? Sounds like the Windows 7 firewall is cutting you off. Add an exception with this tutorial...
http://www.sevenforums.com/tutorials/542-windows-firewall-add-remove-exception.html
Running
netstat -a -n
orss -a -n
from a command prompt will show all of the network connections open and the listening ports on your machine.0.0.0.0:80
would mean that it is listening on port80
of all ip addresses (localhost and your public/private IP addresses) where as127.0.0.1:80
would mean it is only listening on localhost. You can add-b
to the command and it will show which executable is using that port. You can get the same information using the Resource Monitor in Windows 7 under the Listening Ports section of the Network tab.If you want to see if it is open from another server you can just
telnet serverName 80
and see if the session opens. If it doesn't, than the either the server is not listening, or the port is blocked by a firewall.If it opens and then closes right away, at least windows 2003, then the software (such as Exchange) might not be configured to listen on that particular interface or IP, but it is listening on other ports. I have seen IIS behave this way because it is stupid, Apache might not.
You wrote:
Although this may sound strange, you actually don't have a problem with open ports (but with Apache config).
That "Forbidden" message comes from your Apache server; it means that your webserver is accessible from the Internet.
You need to configure Apache to allow serving to all hosts - otherwise they'll get the "Forbidden" page. IIRC, Apache is initially set up to only allow requests from the local computer.
Somewhere in your Apache config, there's probably a section like this (the actual directory may be different):
If you want to allow any computer to see your pages, you need to change the
Deny from all
toAllow from all
. See the access module documentation for more info.To see open ports, you should probably use nmap They have a Windows version: http://nmap.org/dist/nmap-5.21-setup.exe
It's not enough if you see your port 80 open from localhost - maybe something standing in the way if you try it from elsewhere, that's why I recommend nmap
From the client you type: nmap ip-of-your-server
If you want to test this on your local network go download nmap If you want to see weather the port is accessible to the outside world go run a scan at https://www.grc.com/x/ne.dll?bh0bkyd2
If you're on Windows, use SysInternals TCPView. It can tell you which program is using what port.
Server ports can either be bound to a single IP address or to every available IP address. It sounds like your Apache install is set up to bind only to 127.0.0.1, and you need to set it up to bind to *. In your httpd.conf (in Apache's conf directory), look for a line like
Listen localhost:80
and change it toListen 80
.telnet <host> <port>
is your friend. It has the virtue of being installed on pretty much every computer in the world.Edits after re-reading the question:
Here are some useful diagnostic tips
if you can access the site via localhost, but not via your site-local IP (192.168.*) from other hosts on your network, it's probably a windows firewall issue.
if you can access the site from other site-local machines, but not from the internet to your public IP, it's a router/port-forwarding configuration issue.
From a command prompt type:
... or your IP:80. This will tell you if port 80 is open on your machine. Now if you want to check and see if you can access it from outside of your network will determine if you have sort of firewall in place. If you do you will need to forward port 80 to your web server.