How can I view a virtual host (apache ubuntu) without a domain name in place?

I have a droplet with Ubuntu, Apache, MySql (basically a WordPress setup). I then have 10 or so virtual hosts setup within that droplet for various websites and apps. I set up the virtual host as described HERE

Everything works great and I love the setup – but sometimes, I don’t have access to the domain name until the site is complete (for example, a client has a squareSpace site and doesn’t want it to come down until we’re ready to switch).

I need access to a WordPress back-end so the client and I can fill it with data to feed an Ember app at the root.


Normally the IP address would just work, but with virtual hosts, I’m not sure how to get the to folder described above.

How can I reach this folder BEFORE I have a domain setup? Can I forward it in the .conf or the hosts file??? HELP! : )

104.236.45.XXXX/example-site/target-folder or a subdomain would be great too. example-site.104.236.45.XXXX/target-folder


Are you trying to get to the front end or the back end? Can you get to or are you getting an database error?

Wordpress keeps some of it settings in wp-config.php in the site root as well as some setting in the site’s database. If you are migrating the site from another host it is easy for some things to get messed up and need manually correct.

If you still have access to both sites, I recommend with the domain pointing at the old one to install a plugin called Duplicator. This will will pack up your entire WP site (files and database) into a zip file and also give you a customized PHP installer file. Then move the domain over to your new server, make sure it is resolving, and that you have an empty database installed, then upload the zip file and installed to your html root and run the installer and follow the instructions. This will detect absolute paths and such and do all the finding and replacing for you.

Also you can trick your computer and make it point to another server that you domain in not actually resolving to by editing your computers host file. You can put a fake entry and make it point to the ip of the server, just make sure you have the dns entries on that server so it knows how to route them.

Thanks for the reply. Each of the virtual servers in the droplet have mysql databases example-site_data and in this case a WordPress site /cms that have been properly connected to begin with. The WP install is new and doesn’t need to be migrated (I use WP migrate usually). Everything is in place as per my usual workflow, except this time - I don’t have an available domain name. I can’t get it pointed over until I’m further along. (It’s currently on square space) - but we have access to the DNS in Both the client and myself need to have access to the admin (backend only) to start inputing the data. The front end will be an MCV app. I can’t do a quick fix with the hosts file because the client needs access too. It doesn’t need to be a pretty url, but my subdomain fix(see above) seems to have confused the WP install or changed its mysterious mysql-land path. Options I would love to have would be, an ugly IP address path of some sort that lets me interact with the virtual host in the mean time - or to setup a - that I use for the virtual host while that domain is still attached elsewhere.

In the long run, I move 90% of my clients from other providers - to Digital Ocean / and I need a clear path to build their sites before I can point their domains over. This seems like it would be a common situation. I hope that explains more thoroughly - and that you can help. : )

This comment has been deleted

I’ve since setup a subdomain for my main-site in the Domains area of the Digital Ocean admin. and then in the example-site.conf up like this.

DocumentRoot /var/www/example-site/public

This gets me to the index, which is a huge step in the right direction – however, the WordPress install that lives in the /cms subfolder seems to no longer understand where it is and doesn’t connect to it’s database.

Sorry for the formatting. There is not an option to edit.

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

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.

To add a dummy DNS name that is resolved locally, you can use the hosts file.

See this for more info.