I'm very new to Ubuntu and server administration, so bear with me if it seems like I have no idea what I'm talking about.

I installed Ubuntu Server 16.04 on VirtualBox and after setting up an iptables firewall to allow SSH, HTTP(S), and loopback connections, I installed a LAMP stack by using:

sudo apt-get install lamp-server^

When I went to connect to the server through my web browser to see the default Apache "it works" page, I get a 404. Based on what other people have said, it should work right after a restart of Apache, which I did, but all I get is the 404. I've allowed everything I can think of through the firewall, I've looked everywhere I can on this website and others, and I'm tearing my hair out because I can't seem to find anyone with a similar situation.

Am I glazing over something blindingly obvious? Any help would be greatly appreciated.


Apache is a feature rich product that is non-trivial to setup and administer. The folks at the Apache project have made great strides over the years to get their web server to work "out-of-the-box" with very little work by people who have very little knowledge. However, to truly understand Apache and get the most out of that software, at least looking at the documentation will be extremely helpful:


I'd guess that you either have a problem with port 80/443 requests being blocked or rejected. Or you have a files permission issue with the default index page or it's file system.

There are too many potential problem areas to offer opinions regarding a "blindingly obvious" installation or configuration mistake you might have made, based on the sparse information you provided. At this point we don't even know if the Apache processes are even running properly or how you are typing to access the web page(s).

Have a look at the documentation. It was written in a step-by-step fashion and is geared to new users who know nothing about web servers.

In particular, have a look at the FAQ: https://wiki.apache.org/httpd/FAQ

If you still can't get your problem resolved, post detailed information about what you've done to isolate and troubleshoot this, as well as relevant firewall, .htaccess, file protection masks, error log file information and so on.

Spoiler alert: if DocumentRoot is set to /var/www/html and the default Apache index page is in that directory, and is world readable,

lynx localhost

should bring it up from a terminal session. If this works (or doesn't) it really narrows down the list of possible causes.

You may have to install lynx first.

sudo apt-get install lynx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.