NOTE: This is being asked, not because it is a good question (in my personal opinion, it's not), but because I've noticed a lot of questions on here boil down to this question, and since I'm sick of downvoting and giving a form response in a comment explaining basic (server-agnostic) troubleshooting.
In other words, if someone linked you to this question, you are either new to systems administration and making a rookie mistake (which is okay; we've all been new to things and asked questions that seemed stupid to people who have forgotten what it's like to be new to something), or you've been doing this a while and you are simply incompetent (harsh, but sometimes the truth hurts).
The answer to this question should not mention specific webserver instructions. At most, give some information on how you'd do things under different common classes of operating system (Windows, Linux, OS X, and BSD). That's it. So, nothing specific to apache or mojolicious or whatever webserver is in use.
…Anyway, without further ado…
I set up webserver X on platform Y, and I tried accessing the homepage, but it's not loading. What gives? What's going wrong / how can I figure out what's going wrong?
Best Answer
The most important things to keep in mind are:
Now...
Operating-System-agnostic Troubleshooting
There are multiple things that can go wrong when trying to connect to a website.
If you're using a domain name (so, a human-readable name; something like
example.com
ormalware.info
), the problem may be in DNS. So check that your domain resolves to the IP address of your server under DNS using something likedig
.Once you've determined DNS isn't the problem, make sure that pinging the IP address provided is successful, or at least that the IP address actually is associated with the machine you're trying to access (by logging into that server's console and checking NIC addresses).
Make sure the webserver's service is actually running. A lot of webservers will not run by-default; you have to actually start them. This is a good thing, because it ensures the server doesn't start until you're sure the configuration is right.
Make sure the webserver is listening on TCP port 80 the way you expect it should be (most operating systems provide an easy way to check which ports are being listened on, and which services are listening on those ports). Worth noting that, by default, a lot of webserver installations will run on some other port for testing purposes (e.g. 8080, 80801, etc.). If the webserver is running but not listening on port 80, you'll want to check the documentation for the server. Specifically you'll probably want to check the "Getting Started" guide for the server and see whether it says anything about port assignments. Most servers have a part of the documentation called "Getting Started" or "Quickstart" or something along those lines (if the authors are adventurous it might be called "Diving into <NAME OF SERVER>"), and it's usually near the beginning of the docs.
Check the firewall rules, and ensure they aren't preventing access to the webserver (webservers usually run on TCP port 80, so you'll want to make sure that's explicitly allowed, and is the first rule in the firewall). It's worthwhile to temporarily disable the firewall and try to connect with the firewall disabled, if you're not sure whether it might be the firewall. Once you've established it is the firewall, you should bring the firewall online again and tweak the ruleset until things work. Simply leaving the firewall disabled is easier, but it's also a very, very bad idea.
O/S-specific Troubleshooting
Linux
// TODO
Windows
// TODO
OS X
// TODO
BSD
// TODO