How can I temporarily hide website for a couple of days while I still work on my website?

December 9, 2016 460 views
DigitalOcean

I just want to disable my website for a couple of days.

3 Answers

You could use service nginx stop or service apache2 stop to turn off your web server.

As @gparent said, the easiest way is to just shut down your web server. Now if you need to access your site while working on it but don't want anyone else to I sometimes find it handy to point your DNS record elsewhere and set up an entry in the hosts file on my local computer so the domain works for me but nobody else. The hosts file can be found in /etc/hosts on Linux and Mac and in C:\Windows\system32\drivers\etc on Windows. The format is just the domain name and an IP address in the order shown in the file. Just make sure to delete the entry when you're ready to go live or you may end up running into confusing results trying to troubleshoot a problem in the future.

You can set a firewall rule to allow only from your IP address

Have another answer? Share your knowledge.