Question

website doesn't load unless I restart apache server

Posted August 7, 2020 202 views
ApacheUbuntu 18.04

I have deployed django website on digital ocean’s droplet and attached it to the bluehost domain. I’ve already added all the nameservers as you can see here: https://www.whatsmydns.net/#NS/pakistanrozgaar.com
I’m using certbot SSL certificate on my server. The problem is that my website doesn’t load. It’s giving this error:

Example link

But sometimes when I restart the apache server from console, it starts working again but after a few minutes, it goes down.
I’ve rechecked apache configuration, SSL configuration, Django code, and also allowed ports from ufw but haven’t got any luck.

Some reference images:
Example link
Example link
Example link
Example link
Example link
Example link
Example link

Kindly guide me.

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.

×
2 answers

Hi @infopakistanrozgaar,

From the provided screenshots I can see the error - The site can't be reached. This is usually due to an issue with your A records for the root and www domain. Having said that, from the provided screenshots, I can confirm everything looks in order and pretty good. As such can you let me know if you recently changed your DNS?

If you did, please note you’ll need to wait up to 24 hours for the DNS changes to fully propagate.

Anyway, let’s assume it’s not that. When you restart apache, do you check if the service is online prior to the restart or not?

Regards,
KFSys

@KFSys is spot on with this, I checked the domain and it seems to be loading for me. If it still isn’t loading for you I would suggest clearing your dns cache.

for windows:

ipconfig /flushdns

Linux:

sudo /etc/init.d/nscd restart

and os x changes things too much, here is a list of how to do it for each one.

https://help.dreamhost.com/hc/en-us/articles/214981288-Flushing-your-DNS-cache-in-Mac-OS-X-and-Linux

Also, I would suggest using googles DNS (8.8.8.8 and 8.8.4.4 ) or they may have a different address for your country depending on where you are. It is possible that your isp DNS servers only update every 72 hours or more!

Mine told me they only sync DNS once a week so I changed to google DNS!

Hope this helps!

Submit an Answer