How is your development server set up?

Discussion in 'Web Design and Development' started by jrrdnx, Jan 17, 2010.

  1. jrrdnx macrumors member

    jrrdnx

    Joined:
    Nov 13, 2008
    Location:
    Indiana
    #1
    This just crossed my mind as I was sitting here, and it made me curious to know how people have their development servers set up. Before I started doing web dev professionally and was introduced to the difference between development and production server, I used to just put 'Under Construction' notices on pages or create a 'beta' subfolder and work in that. Now I try to stress the importance of working on a dev server before ever moving to production.

    At my employer's, we actually have a server room (closet ;)) with a few servers running, one of which being our development server. Only accessible for uploading files from within the LAN, but sites are publicly viewable so clients can view progress, request changes, etc.

    At home (prior to the last few months), I had set up XAMPP on my old desktop pc. However, every time i made an update I then had to switch to another window to transfer the file and then switch to my browser and reload to see the changes, and for some reason it took quite some time to load the page. The pc never had any other processes running, so it was quite confusing and very annoying.

    Currently, thanks to some help from a coworker, I installed Ubuntu to a virtual machine in VMWare Fusion and set up Apache, MySQL, and PHP. To make it easier to update my files, I mounted my development folder inside Documents on my Mac. No more transferring the updated files to see my changes :eek:. Finally, I updated the hosts file on my Mac so all I have to do is type 'dev' in my address bar and it brings up the contents of my development folder :D. Works perfectly for me, as I'm able to work on a site no matter where I'm at regardless of internet availability, and without having to take the time and extra effort (no matter how miniscule) to manually transfer files after they're updated.

    What do you use as your development server? And do you have any suggestions for improvements to the people who've already posted?
     
  2. miles01110 macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #2
    I think the real question should be how many people posting on MR run their own server? :-\
     
  3. jrrdnx thread starter macrumors member

    jrrdnx

    Joined:
    Nov 13, 2008
    Location:
    Indiana
    #3
    I figured I'd find those that do here in 'Web Design and Development'...

    Doesn't necessarily mean that they have to run their own server either, but I suppose I could have worded it a bit differently.
     
  4. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #4
    I just MAMP on my machine to do development then upload when ready for live. Setting the hosts file is nice for testing from other machines as well on my network, like for Windows testing. Virtual machines are nice too for this. Then, I also have Subversion setup locally for version control.

    I think the setup depends in part with the level of experience and the depth of complexity of a site. Some people edit the files live using an editor that lets them do this. Most beginners will just upload their files to a live site to test things, but as they learn more they find out about things like MAMP. Then, in professional settings, use dedicated servers (or server space) for development where a team of developers can access and edit files. As a lone developer, having everything local works very well for me.

    I keep my entire site on my flash drive, and can take it wherever and use VirtualHost in Apache to serve the site from my flash drive when developing it. Lets me easily work on my site at home or work.
     
  5. angelneo macrumors 68000

    Joined:
    Jun 13, 2004
    Location:
    afk
    #5
    Our coders have xampp or lamp on their localhost workstation, and our svn server will automatically push out updates to the testing server. Once it is ready for deployment, we will have a staging server (usually another local server) with the current live setup, and we will try migrating to the staging server before performing the updates to the live servers.
     
  6. splitpea macrumors 6502a

    Joined:
    Oct 21, 2009
    Location:
    Among the starlings
    #6
    I run a "LAMP" stack (well, it's not technically LAMP on OS X) installed using MacPorts. In addition to Apache, MySQL, and PHP, I'm set up to run Perl, Python, and PostgreSQL as needed, and set up (lots of) virtual hosts manually using Apache .conf files; I use NetInfo Manager to add hostnames.

    Like the OP, I really like the seamlessness of being able to save files directly to a local drive as I work, and having them appear instantly in place even for a dynamic site.

    I host Git and SVN repositories on external servers so that when necessary I can check out copies and make commits from other networks without having to worry about opening ports in my router or firewall, or about whether my Mac is sleeping at the moment I happen to want file access.

    Are you liking that? What do you see as the advantage of running everything in a VM or under Linux instead of natively with MAMP or MacPorts or even the bundled Apache instance? Are there any downsides?
     
  7. savar macrumors 68000

    savar

    Joined:
    Jun 6, 2003
    Location:
    District of Columbia
    #7
    You actually have a pretty cool setup. I've been thinking about doing that but haven't gotten around to it yet.

    I currently run Apache/PHP/MySQL in Mac OS X and then just connect to local host. My webroot is a symbolic link that I move around when I want to work on different projects.

    But I've finally run into a dead end with this setup, because I'm working on some different projects that aren't all compatible with the same versions of PHP and APC. I've already got a bunch of VMs, so I'm thinking about doing what you did and set up a new VM for each different configuration that I am interested in.

    The cool thing about running in a VM is if you want to do something risky -- like recompile a particular package -- you can clone the VM and not worry about hosing your system.

    EDIT: Forgot to mention that I have a Core Duo, and the virtualization is pretty slow on my laptop. Once I get a core i3 laptop I'm hoping I will be able to run a VM in the background and not grind my machine down to a halt.
     
  8. jrrdnx thread starter macrumors member

    jrrdnx

    Joined:
    Nov 13, 2008
    Location:
    Indiana
    #8
    Loving it. I keep that particular VM suspended so it only takes about 10-15 seconds to get ready. There was an issue at first where the networking wouldn't work (which is crucial to this setup) without a full reboot, but it turned out to be just an issue with VMWare Tools.

    I'm not sure there's an advantage to running it in a VM, but I wasn't happy with my old XAMPP setup and wanted to do something different. I also wanted to get the experience setting up and running a server from scratch and that was a big part of it. I'd worked with servers before and played around with Ubuntu, but never had the knowledge or experience to set up my own server.

    The only downside at the moment is that I use Firefox's Web Developer plugin to check the validity of the style and structure, but the W3C validators obviously don't have access. I believe there is a package available to install the markup validator in Ubuntu but it's an older version. I also tried downloading the current version for a different platform and converting it, but couldn't get the install to work for some reason. So for now it's an annoying task to copy and paste directly to the validators, but I plan on fixing that in the future.
     
  9. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #9
    If you use the "Validate Local HTML/CSS" option it should work as long as your machine has internet access.
     
  10. jrrdnx thread starter macrumors member

    jrrdnx

    Joined:
    Nov 13, 2008
    Location:
    Indiana
    #10
    You just made my day! As long as I've been using that toolbar, I guess I've never seen or just didn't pay enough attention enough to those options. Problem solved! :D
     
  11. splitpea macrumors 6502a

    Joined:
    Oct 21, 2009
    Location:
    Among the starlings
    #11
    This is an issue regardless of whether you're running in a VM or natively: it's a matter of the W3C validator not being able to load your site because it can't associate the hostname you're using with your machine's IP address.
     
  12. Cromulent macrumors 603

    Cromulent

    Joined:
    Oct 2, 2006
    Location:
    The Land of Hope and Glory
    #12
    I just run Glassfish 3 and PostgreSQL 8.4 on my development machine, although I am planning on moving them off to a Ubuntu Server 9.10 box running those and Bugzilla for project management purposes.

    The only real problem with that is power consumption. I already have Git running on the server and a couple of other little things so it isn't such a big change but having it turned on more often will obviously make a difference.
     
  13. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #13
    Except it's not an issue at all. It works just fine.
     
  14. splitpea macrumors 6502a

    Joined:
    Oct 21, 2009
    Location:
    Among the starlings
    #14
    Yes, "Validate local" always works fine. But having to use that instead of the "plain" Validate tool is always the case unless you've set up something using dynamic DNS or actually have a static IP and set up DNS records for each development host. It doesn't depend on whether you're using a VM or not.

    Sorry, should have been clearer.
     
  15. zeroge macrumors newbie

    Joined:
    Feb 3, 2010
    #15
    Hello and greetings to everyone from a MAC novice.

    I am about to change from W...... to Mac buying an iMac in about two days and thus brand new to the mac environment. Hence, my apology for the level of ignorance I display here.

    I find this forum very interesting and helpful and specific your post about setting up a local server on a MAC, jrrdnx, has an extreme good sound. No idea about UBUNTU, etc, would it be possible for me to get a bit of a personal push from you to help me set up my dev server on my new Mac in a few days?

    On a PC I used to work with xampp but I am not so keen to continue this setup on the Mac. YOUR solution is a M times better, I trust.

    Cheers
    Norbert
     
  16. ChicoWeb macrumors 65816

    ChicoWeb

    Joined:
    Aug 16, 2004
    Location:
    California
    #16
    Typically we create a new domain, using an existing domain... IE, chicodev.com. Then when the site is ready for deployment, we rename the domain to their final destination. Works pretty well and allows clients and other developers to see it rather then it being local.
     

Share This Page