WP Install using server IP during test


#1

Hi there. I just installed WP just fine.
I am testing the WP before moving a live site over, thus…
I need to use the server’s IP as the URL.
Is there anyway to have the serverIP load wp-admin so I can login and use WP?


#2

You can edit the hosts file on your computer to point the domain to the IP of the server, without having to edit the A records of the domain itself.

So when you visit example.com your computer will go to the IP address you’ve told it to, bypassing the DNS records you’ve currently set on the domain. Easiest way to do this is to create your site as normal, if you need SSL then create it with the --wildcard flag as this verifies the domain via TXT records and doesn’t need the domain to be pointed to the IP of the server. Create the site with all the flags you actually require, as if the site were to be live (ie if you need the cache, use the --cache flag, and any other config you might need such as custom db name or password, wp user/admin/email etc)

Then if you’re on Windows, edit the hosts file – you’ll need to run notepad as administrator, hosts file is located at c:\windows\system32\drivers\etc\hosts – if you’re OSX or any other OS, editing the hosts file is pretty much the same/easy, but the file is obviously not in the same location, a quick google search will show you how to do that.

Insert a line with the IP of the server and the domain you’re directing to that IP

123.45.678.91       example.com

Save the file. Open cmd and clear your computer’s DNS cache (ipconfig /flushdns) – you might also need to clear your browser cache. Now when you visit example.com it will be as if your domain is live, but only to you on your own computer. Once you’ve finished setting up your website and everything is ready to go live, you can then delete this line out of your hosts file and point edit the DNS entries on your domain to point the A records to the server IP, so the site will then be live to everyone.


closed #3

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.