How to access my site without a domain?

January 24, 2019 1k views
DNS Apache Initial Server Setup Automated Setups

I used Wordpress One-click application. Then, I opened my site in my web browser via its IP address. I configured it without a problem. But when I connected to my droplet via console, it prompted me to introduce a domain. Since I own a domain, I didn't think about it and I just wrote it. However, then I realized I didn't want my site to be available on said domain until I finished the webpage. Now I want to turn back, because I can't access my site from the droplet's IP address and neither from the domain (which is expected since I haven't and don't want to associate it with my website in my registrar yet).

How can I configure my droplet so I can access my website using only its IP address? I tried changing ServerName and ServerAlias on sites-enabled and sites-available to the droplet's IP, but it didn't work.

1 Answer

Hey friend,

I do not recommend building the site and then switching to the domain afterward, this is a good way to run into problems after the switch and have to troubleshoot a live site that you thought was complete. Instead, I recommend changing your host file on your system to simulate the DNS change, allowing you to work on the site under your domain while everyone else continues to see the domain hosted elsewhere until you're ready. Here is a guide on editing your host file:

https://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/

Jarland

  • Thanks for your answer! I finally managed to access my site using only the IP address. However, Why would you say it is a bad idea to switch to the domain after building the site? I don't see why it would cause any problem.

Have another answer? Share your knowledge.