Apache alternate between default page and home page

Posted April 7, 2017 13.3k views
ApacheUbuntu 16.04

I have droplet running Ubuntu 16.04 and LAMP stack

I have 3 sites enabled:
one at /var/www/html (default apache config)
two at /var/www/others/SITE/public_html

My sites are showing well, but one of then sometimes shows my site and sometimes shows apache default page

Notice, there is no default page at /var/www/html/index.html because I my first site are installed there. All said, my ‘It Works’ page is the Digital Ocean version, instead the regular apache (that is sometimes shown on my site).

You can check this behaviour at:

When I open a private window the website sometimes shows the apache default page, I close the page, open private window again and my regular website.

My apache conf:

cat /etc/apache2/sites-enabled/ 
<VirtualHost *:80>

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/others/

        <Directory /var/www/others/>
        Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined

        <IfModule mod_dir.c>
            DirectoryIndex index.php index.cgi index.html index.xhtml index.htm


Ls to site folder:

ls /var/www/others/
css  font  images  index.htm  index.html

What I’m missing?

This should be due to high acess to the site?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
2 answers

I’ve sent ~ 50 requests to and it’s never the default page. Clear your browser cache.

  • Hi @Woet , thank you for your answer.

    I have a doubt:
    As far as I know at private window there in no cache, isnt’t?

    If there is, why sometimes it’s opens my regular site and sometimes it shows apache defaul page?


Testing your site on Chrome + Safari on MacOS and Chrome, FireFox (Dev), and IE on Windows 10, I’m not able to reproduce the issue when visiting the site, whether I’m using a normal browser window or a private window.

That being said, for DirectoryIndex, unless you need to allow each type, I’d simply reduce those to what’s needed and I would start with the default for the site.

So if all your files are HTML files:

DirectoryIndex index.html

If you’re mixing HTML and PHP:

DirectoryIndex index.php index.html


For me, at least on the user end, your index.html and index.htm files are showing the same thing, so I’d simply rely on index.html unless there’s a need for the index.htm file.