Advice on setting up environment

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
JasonTC
Forum Commoner
Posts: 92
Joined: Wed Nov 02, 2005 11:05 am
Location: Grand Rapids, MI

Advice on setting up environment

Post by JasonTC »

I have a question on how to set up my dev/staging/production environment. This isn't entirely a Linux-specific question, but that's what I'm using on my servers and this general question will probably lead to some more Linux-specific questions.

I have the following development situation and it's been working okay so far:
Dev server: Old Ubuntu box sitting in my house. I SSH into it from my Mac and develop from there.
Production server: Media Temple VPS. I use rsync to keep this machine up-to-date.

This solution isn't a terrible one but it does have some limitations:
- If I want to show someone the latest development version of my site, I have to have them actually come to my house and get on my network. I realize that I could use port forwarding to get around this, but in my experience that's slow and unreliable. Even if that weren't a problem, I'd like to have a dev URL that's more memorable than whatever my IP address happens to be. Maybe there's some magical way around these problems, but if there is I don't know about it.
- Similarly, if I want to work on my site, I have to be at my house on my network. This is pretty much just a different symptom of the same problem.

What I did recently was set up a new subdomain, dev.mysite.com, and rsynced my home dev box with this one. Now, if anyone goes to dev.mysite.com, they can see the latest dev version of my site, assuming I've kept it up-to-date.

What I've done, though, has only gotten me part-way to my ultimate goals. I can now access my dev site from anywhere but I still do all my development locally which limits me to one physical location.

Right now, the deployment cycle looks kind of like this:
1. Develop on my home dev box
2. Test on the home dev box
3. rsync from my home dev box to dev.mysite.com
4. rsync from my home dev box to mysite.com (I haven't actually done this yet)

It seems like I want something more like this:
1. Develop on dev.mysite.com
2. rsync (or something) from dev.mysite.com to staging.mysite.com
3. Test on staging.mysite.com
4. rsync (or something) from staging.mysite.com to mysite.com

What do you guys think about this approach? Do you see any gaping holes in my logic? I wouldn't be surprised at all if I'm thinking about this completely the wrong way, so any input would be greatly appreciated.

Thanks,
Jason
JasonTC
Forum Commoner
Posts: 92
Joined: Wed Nov 02, 2005 11:05 am
Location: Grand Rapids, MI

Re: Advice on setting up environment

Post by JasonTC »

I just realized that I overlooked something pretty obvious: If I just get a static IP address from my ISP, the "unreliable" part of my problem with the home server approach probably goes away, at least for the most part. Then I could register a domain name for that address to solve the "hard to remember" part of the problem. What if I don't want a whole new domain name, though? Can I assign dev.mysite.com to an IP address other than the one that mysite.com points to?
Doug G
Forum Contributor
Posts: 282
Joined: Sun Sep 09, 2007 6:27 pm

Re: Advice on setting up environment

Post by Doug G »

Can I assign dev.mysite.com to an IP address other than the one that mysite.com points to?
Yes, you just need to add a host record in the DNS for the domain.
Post Reply