SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Dev Site Vs Test Site Vs Live Site

    Hi, i am close to launching a site i have been working hard on for the past while. The site is developed in PHP.

    I have been developing the site on a VPS with one hosting company (A) and now i have moved the live site to a new better hosting company (B) (i won't go into why they are better)

    Ok, so i was thinking of running with the following set up:

    - development environment on VPS with hosting company A
    - test environment with new hosting company B
    - live site with new hosting company B

    This means i have to pay 2 hosting companies quite a lot of money per month, which is not a huge problem if needed... but do you think i would be ok running with just hosting company B and running the live site beside one testing and development site...

    Thanks in advance for any advice you can offer on this subject, it is much appreciated...

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This really depends on a lot of factors - how many people working on the website and, of course, the nature of your website.

    For a single-developer website, I would stick with having a development environment locally, with a manual SVN linked to a testing subdomain. Edit on your local PC, then if you're happy that it doesn't cause any errors, commit the changes. Then when you're happy with it, copy over to the main domain.

    I'd say the main domain and the test environment should be the same domain, but different subdomains - unless you utilise subdomains as part of your website's functionality. I would also then recommend that the domain and test root directories should be on the same server (preferably siblings of a common parent directory), which would make the process of copying the files over from the testing website to the main website more convenient (and faster).
    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok cool, thanks i was also thinking that it would be a good idea to do as you mentioned above, thanks

  4. #4
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,130
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    I agree with @Jake Arkinstall ; and I do a similar setup (using SVN, but I hear GIT is great for this too).

    I develop and test locally, once I'm happy, I move it to a test subdomain (that is password protected and has bot crawling disabled), this is just to ensure that my changes run on the actual hosting server (in case they have PHP or Apache configured differently than my local machine). Once I'm happy with the test, I push it to the live site.

    Things to keep in mind:
    1. Any files that need to change between the environments, such as configurations, keep out of SVN or write up a script that will update them to the correct values for each environment you deploy to.
    2. Make sure your repository is private as to not show any of your code to outsiders (especially if you have configuration settings in it!)
    3. Document any difference you find between your server and the test environment, then make those changes to your local environment so you are closer to running what is on the test and live environments (this will save you a lot of time later on)

  5. #5
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks guys, my only worry is that setting up SVN or GIT means i have to weaken the file permissions on the actual main server. If i want GIT to be able to write into the webfolder then the access rights must allow that.

  6. #6
    Hosting Team Leader silver trophybronze trophy
    cpradio's Avatar
    Join Date
    Jun 2002
    Location
    Ohio
    Posts
    5,130
    Mentioned
    152 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by oo7ml View Post
    Thanks guys, my only worry is that setting up SVN or GIT means i have to weaken the file permissions on the actual main server. If i want GIT to be able to write into the webfolder then the access rights must allow that.
    Not necessarily. I actually have bash scripts I run for deployment. The one for the test environment, will export the latest from the SVN, and copy it to the test web directory.

    Production's simply copies the files from the test environment to the production folder. That way you can lock it down with different accounts, and give those accounts ownership of the scripts.

  7. #7
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok cool, thanks i will have a look into this, cheers

  8. #8
    Foozle Reducer ServerStorm's Avatar
    Join Date
    Feb 2005
    Location
    Burlington, Canada
    Posts
    2,699
    Mentioned
    89 Post(s)
    Tagged
    6 Thread(s)
    Quote Originally Posted by oo7ml View Post
    Ok cool, thanks i will have a look into this, cheers
    The other way to do this securely is to use openvpn on port 443. Most hosts enable this port as it is for SSL. It is fairly easy to install and there are clients for your phone or whatever computer you have locally.

    Once you get this setup you can enable password-less SSH access. You can easily upload a certificate public key to the server. Then with a simple bash script added to Git's post-receive hook. It then allows you to use a one command push using 'git push...' to get your local Git repository synching up to your web-server repository.

    In the next couple of weeks SitePoint is publishing a free Git tutorial. In the appendix we show how to do all of this with the exception of the VPN which this doc does not show.

    It is nice to have a mirrored repository on you server as it allows you to roll back files or a complete version of your site.

    This may sound hard, but going step by step it is not too bad.
    ictus==""

  9. #9
    SitePoint Addict
    Join Date
    Sep 2011
    Posts
    266
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok cool, thanks...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •