Question

Apache alternate between default page and home page

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: drg.adv.br

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/drg.adv.br.conf 
<VirtualHost *:80>
	ServerName drg.adv.br
	ServerAlias www.drg.adv.br

        ServerAdmin webmaster@localhost
        DocumentRoot /var/www/others/drg.adv.br/public_html

        <Directory /var/www/others/drg.adv.br/public_html/>
	    Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

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

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

</VirtualHost>

Ls to site folder:

ls /var/www/others/drg.adv.br/public_html/
css  font  images  index.htm  index.html

What I’m missing?

This should be due to high acess to the site?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@JonathanBatista

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

etc.

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.

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