Forum Moderators: rogerd & travelin cat

Message Too Old, No Replies

Using WP on a site with no domain

         

csdude55

3:00 am on Jul 7, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Can you guys explain how I might build a site with Wordpress that doesn't have a domain yet?

I have it set up so new accounts are at example.com/~foo, but I can't seem to build anything unless the domain is there. But if the client already has a site somewhere else and I'm rebuilding it, they don't want it to go live until the new site is done. I need to build it on my end, get it approved, then point the domain to it.

TIA!

lucy24

3:34 am on Jul 7, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Isn't that what pseudo-servers (WAMP and so on) are for?

ergophobe

3:36 am on Jul 7, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There shouldn't be any issue with building on example.com/~foo as long as you have the site URL defined correctly in your settings.

That, however, is not typically how I would do it. I generally use a dev -> test -> live workflow

dev = Laragon is the easiest way to run a dev server on Windows. MAMP is the easiest way on Mac. On most Linux distros, you already have everything you need.
test= your example.com server, but I typically use devsite.example.com rather than trying to use the user directory system, which can be tricky.
live = live

Ideally, the environments are identical, but unless you're using Docker containers, that's not likely. But with WP, I've only had a few issues and they typically appear right away (for example if you have FollowSymLinks in your .htaccess and your live platform only allows SymLinksIfOwnerMatch).

So build whatever you want using your Laragon install. You'll be on a domain like example.test. You can save yourself some headache by editing your hosts file and setting example.com to resolve to 127.0.0.1. That way, you are using the live domain on your local machine and you don't have to worry about any problems with links going bad.

My method, however, is to have a local config file that overrides the DB settings


// Local config file should be outside the server's DOCUMENT_ROOT

$config_file = '/path/to/local-wp-config.php';
if (file_exists($config_file)) {
include($config_file);
}
else {
define('WP_HOME','https://liveserver.com');
define('WP_SITEURL','https://liveserver.com');
define('DB_NAME', 'liveDB');
define('DB_USER', 'liveDBuser');
define('DB_PASSWORD', 'liveDBpass');
define('DB_HOST', 'localhost');
}


local-wp-config.php contains the local site url (http://mylocalsite.test) and the local DB connection parameters. You can, of course, just use the same DB parameters for local test and live and simplify it a bit.

That way if you are tracking your wp-config.php in git and using git to push your changes from dev to test to live, you don't have to worry about your DB settings

ergophobe

3:50 am on Jul 7, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>pseudo-servers

There's nothing pseudo about them. They are fully functional servers. Whether they are accessible to the outside world and can serve up live pages is entirely dependent on your network, DNS, etc. But the server is ready to roll

[edited by: ergophobe at 3:51 am (utc) on Jul 7, 2018]

not2easy

3:51 am on Jul 7, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



You can build it on your desktop with WAMP server for Windows. There's also MAMP for Mac or even LAMP which can be done via Linux. WP runs by requesting resources from a database, so it needs a server. A WAMP package (free) gives you a server environment on your desktop. WAMP stands for Windows, Apache, Mysql, PHP.

Be aware that it takes more than pointing a domain at a WP site. It can't exist except on a server, either desktop or in a folder prepared for its installation. The configuration requires entry of a domain, even if it is a placeholder. It requires a database and PHP.

You might try setting up a free WP site at wordpress.com to work on setup, design, etc but they don't allow anything commercial so you can't do much in that respect. Once you have the setup, the site itself can be gzipped and exported to a different host and domain.

You should definitely go visit WordPress.org to learn enough about the platform to know what's involved in moving it and to learn enough to set it up the best way for your client. If it's a wordpress site you can't really rebuild it so much as reconfigure it and put on a new skin.

not2easy

3:54 am on Jul 7, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If ergophobe recommends Laragon instead of WAMP, please listen to him. ;)

tangor

5:05 am on Jul 7, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



All the above ... install a local (your system) server and go from there. Your domain will be something like "localhost"...

ergophobe

10:24 pm on Jul 9, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>If ergophobe recommends Laragon instead of WAMP, please listen to him.
I've used WAMP and XAMPP and I've set up all the components individually on Windows machines. I've also tried virtual machines running Ubuntu (my VPS is Ubuntu, so you can closely match your production environment). And I've tried Docker containers.

I find that Laragon is the easiest by far. For example, you tell Laragon in the settings what your TLD will be. In my case, I use the default "test"

If I create a folder in server doc root named "example," Laragon will autodetect the folder and set up all the virtual host details, http and https. It edits your host file and the Apache config files. You restart Laragon, go to example.test and you're good to go.

>>Your domain will be something like "localhost"..

It can be anything. In fact, you could set it to be google.com. All you need to do is set google.com to resolve to 127.0.0.1 in your hosts file and set up your virtual host and boom, on your local machine, google.com goes to your Wordpress site. Of course, that would be sort of a bad idea and rather inconvenient. But you can do it.

In my case, since I have many local installs, I give them all a name
site1.test
site2.test

Nothing runs on localhost directly

lucy24

12:52 am on Jul 10, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



since I have many local installs, I give them all a name
Mine are all called “local”, as in
example1.local
example2.local
so I can only hope “local” never becomes a really, really common TLD or my browser will get seriously confused. In fact my primary site has two names, because it’s also the default localhost.

tangor

1:23 am on Jul 10, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



names on devs become important only if icann or other seriously screws the pooch and makes same a tld.

gollymissmolly works just as well. :)

The point is setting up a local server for all testing purposes ... and each of the named above works just fine. (XAMPP for myself, for example)

csdude55

2:37 am on Jul 10, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'll be honest, you guys are about 10 miles over my head on this one. I've been a programmer for near 20 years, but I've always used semi-managed servers (Linux or CentOS) so I don't have to do too much on the backend other than general maintenance.

My current server is CentOS 6, but I'll have to upgrade to CentOS 7 sometime this year. I know both jack and squat about Laragon, WAMP, or LAMP... you guys are talking Greek to me on that one :-( This thread was literally the first time I've ever heard of Laragon.

All I know is that when I install Wordpress (using cPanel) I have to enter a domain name, and if I don't have the domain pointing to the server then I get all kinds of errors when trying to use the CMS.

Are you guys suggesting that I have a subdomain for Wordpress while their live site is on the WWW directory, then I (somehow) move the subdomain data to the WWW directory when it's ready to go live?

lucy24

2:54 am on Jul 10, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



you guys are about 10 miles over my head on this one
Speaking strictly for myself: I don't speak a word of Apache and would flee in terror from a live server. In order to run multiple sites off a single MAMP install without having to keep changing preferences, I had to do some internet searching to learn how to edit my computer's hosts file. Basically this involves carefully typing exactly what it tells me to type. (I shun Terminal like the very devil, and will go to considerable lengths to avoid using it, so this was a very unpleasant and scary exercise.) In other words, I did exactly what I keep telling people not to do.

All the things with -AMP at the end are programs that you run on your own computer--different versions for each OS family, hence the varying first initial--enabling you to make things behave exactly the way they do on a “live” site: php, databases and whatnot. That includes playing around with a new WP site without having to muck about with aliases and subdomains in some hidden corner of your live site while hoping nothing gets accidentally exposed to the visible world.

But it does help to have a test site--a live one, that is--something that has no function except to let you try out stuff without fear of bringing your “real” site crashing to the ground. Cough up the $10 or so for a domain name and let it piggyback on your real sites’ server space.

ergophobe

7:22 pm on Jul 10, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>Are you guys suggesting that I have a subdomain for Wordpress while their live site is on the WWW directory

2 options.

1. Do that, and set a basic directory level password, as you can easily do in CPanel
2. What we are suggesting is that you just run a dev server on your own computer. No network connection needed. You can work on the plane.

If you feel we are 10 miles over your head, I strongly suggest using Laragon over the other options. It's this easy
1. Install the software and start it
2. Once installed, you'll have an icon in the system tray. *Right* click and look for hte Quick Create link.
3.Select "Wordpress" and when prompted, give your project a name like "mysite"
4. Restart Laragon. It will auto detect the new site, update your hosts file, create the virtual server settings and all that.
5. Go to mysite.test - welcome to your new Wordpress site
6. Go to HeidiSQL (included with Laragon and, in my opinion, th ebest Windows MySQL client available). Import your current DB if you want.

You might have to transfer some files if you have already built something. In that case, just download the zip archive, unzip and move what you need into your Laragon project folder for this site.

It's actually easier than using CPanel in my opinion (though I haven't used CPanel in many years, so I'm not totally sure on that)

csdude55

7:39 pm on Jul 10, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ohhhhhh, OK, I get what you mean now :-)

The problem with developing it locally is that I would be developing it for a client, so they need to see it as I develop. Plus, I have other clients that are just hosting and want to build it themselves without taking down their old site, so this would become a recurring issue.

So I guess developing under a subdomain is the better move. Can you suggest what steps I would need to take to change it from a subdomain to the main WWW when it's ready to go live? Or would it be easier to just modify the .htaccess to point everything to the subdomain?

tangor

8:28 pm on Jul 10, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I don't do WP, though I have helped a few with some coding from time to time. Help out, kiddies. ... isn't there a multi-site version of WP that can have each site password protected?

csdude55 ... even if that is possible I personal do not recommend dev work on live facing sites, password protected or not. All too easy to make a mistake and let folks in either too early, or before you have finished. When those kinds of things happen it takes months, sometimes YEARS to make that error go away.

The beauty of local dev (as mentioned above) is you can put that server on a flash drive and hand it to the client if they aren't willing to come to your location and see what's been done. Keeps it OFF THE WEB before prime time!

ergophobe

12:33 am on Jul 11, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



>>server on a flash drive

Really? And the average client can boot the server and use the site?

I actually do have a test site for the client on a test/demo subdomain. However, I maintain a dev -> test/demo -> live/production workflow.

The general rule of thumb there is code only moves up, data only moves down. The problem with Wordpress, though, is that a lot of config is in the database, so you can't always enforce that rule.

If you successfully push the site from dev to test, then you also know that you can push the site from test to live. That greatly reduces the risk of borking the whole thing.

In terms of your question about how to do it specifically with Wordpress, see my first post.

If all that sounds daunting, there is a simple, easy solution. Host somewhere that has a staging/production workflow built in, such as Siteground or WPEngine
[wpengine.com...]
[siteground.com...]

I have also heard very good things about Duplicator
[wordpress.org...]

There are also many other staging to live plugins that I've never heard of, but that have high ratings.

Many ways to skin this cat. You just need to find the one that suits you best. The easiest one may be to just throw a small amount of money at the problem with hosting that handles this for you

Leosghost

1:07 am on Jul 11, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Bitnami will do what you want.. works on win / mac / linux..( gives you an apache server environment ) can be installed on a thumb drive and switched between machines, or you can copy the drive..Wordpress is one of many modules that are available from the Bitnami people, once you have set up the Bitnami basic server, you can add the Wordpress module to it..( or any other module, such as , prestashop etc ) installation instructions are clear and easy..

Use it to dev on a local machine, when done take it live.

If you have your own server(s) or a VPS ? with WHM installed..?

You could also use WHM to to add an additional user account, which then comes with a standalone cpanel, then use the built in installer panel to add wordpress account etc for that user, just block it from access from any Ip ( including all search engines etc ) other than your own while you do your dev work, customer wants to look , allow their Ip for the time that they look, or password protect the entire user account..change your passwords frequently, such as every 24 hours :)

Leosghost

1:12 am on Jul 11, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Oh..and "harden" your wordpress installation, wordpress is a hacker magnet, "hardening" will somewhat delay the inevitable.

Milchan

4:58 pm on Oct 5, 2018 (gmt 0)

5+ Year Member Top Contributors Of The Month



Ive not tried Laragon , looks decent and I wil check it out, but even though im late to the party here , just wanted to suggest "DesktopServer" as a very easy local wordpress dev option. The free version lets you have up to 3 sites running and it automatically sorts you local hosts entries out etc and creates the site on domainname.dev.cc . when you done developing just use a plugin like "All in One WP Migration" to export then reimport on the live server (plugin needs to be installed on both obviously) - it has a function to change/replace the domain name to the live one when you import it.

dntool

11:10 am on Oct 15, 2018 (gmt 0)

5+ Year Member



Wamp Server would be the easy method, where you can install Wordpress on localhost. But I'm not sure Wamp is compatible with Linux or not.

You will be building on Windoes PC, or buy Windows VPS and wild there, give logins of Windows VPS to your client to check.

Of course, WAMP is free, I think it is an open source program, but you will be paying for the Windows VPS.

Or share your personal computer with TeamViewer to show the localserver website you built to your client.

martinibuster

5:04 pm on Oct 15, 2018 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The easy way to stage a site is with WP Stagecoach. I have used it and found it to have little to no learning curve. It is designed to be highly intuitive to use, which I appreciated. You can stage it on their server and when you're ready push it to the live site.

I used it and found it to be the perfect sandbox for me. I have used a desktop sandbox (not Laragon) and never really felt comfortable with it. WP Stagecoach was perfect because it enabled me to get things done without having to learn a whole new set of skills and technical jargon.

https://wpstagecoach.com/ [wpstagecoach.com]

WP Stagecoach article about staging on a different server [wpstagecoach.com]

Laragon


That sounds great! I'm going to download it for my own projects.

ergophobe

5:04 pm on Oct 17, 2018 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It's not as convenient as a staging -> live solution like WPStageCoach or SiteGround or (I think) WPEngine

But
- unlimited number of sites for free
- not limited to Wordpress