Question

How to view my various websites with domain in a cPanel using server IP

I have a few domains in my cPanel and would like to know how to view them using the server IP address or host name. This is useful when I am setting up website and not ready to go live.

thank you


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.

Hello @aliasbling

You can use your local hosts file, use any site that offers to preview the site from a different IP address or use the cPanel preview link.

For more information on the preview link, you can check cPanel’s forum

https://forums.cpanel.net/threads/how-to-preview-website.160010/

The preview link will grant you the option to access the site using the server’s IP:

http://serverip/~user

Regards

Hi @aliasbling

There are a couple of ways to do this, one will not require you to change any settings on cPanel but rather on your computer/laptop and is the one I would recommend and the other will need you to change cPanel settings to fit your need.

The first one I mentioned is updating your hosts file. What you do in this situation is, you tell your computer/laptop to load a certain domain from a specific IP only for you. It’s quite easy as well.

  • Run your Notepad as an Administrator
  • Click to open a file
  • The Directory is <^>Program Files\Windows\System32\drivers\etc
  • In there select to view all files
  • Open the hosts file

Once you’ve opened it, you need to add the line which tells your machine to use that IP to load a certain domain. The line needs to be added on the last line. It should like this

YourDropletIpAdress www.yourDomain.com yourDomain.com

or to be more precise

245.45.43.23 example.com www.example.com

The above is just an example.

  • Save the file and you are good to go.

Now when you open your Domain it will load from your Droplet.

As for the cPanel option, you’ll need to stop mod_userdir protection . As mentioned I do not recommend this method however here is how to do it.

https://documentation.cpanel.net/display/84Docs/Apache+mod_userdir+Tweak?_ga=2.122346443.1371484908.1660199348-1602586321.1660199348

Hope that helps!