Development Server Implementation

  • Posted January 8, 2013

Hello everyone!

I’m working on a side project with a friend. We currently develop code on a domain/server package purchased on hostmonster. During development I stumbled upon Digital Ocean and decided to give it a try. I created an Ubuntu Server droplet, pulled down a build from git, and the rest was history. I had the test site up and running in minutes! I was sold from that point on – I want to use Digital Ocean for all my web hosting needs. Creating a test site for our project was easy. I’m not really sure, however, what the best approach would be to creating a droplet to serve as a development server.

What is the best way to use a droplet as a development server? Should we develop code on our local machines, push the code to git, and then pull the development code down from git onto the development droplet?


Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

thank you for your comment on wordpress installation on localhost.

Yes, it’s much easier and will accomplish the same thing, you can either setup an .htpasswd file and use .htaccess to restrict it on a username/password basis or you can restrict it via an access list mod_auth which is precompiled as one of the base modules: <br> <br>Order deny,allow <br>Deny from all <br>Allow from your.whitelisted.ip <br>Allow from your.whitelisted.ip2 <br>

We’re running a LAMP stack on Ubuntu Server 64x 12.10 . Do you recommend not editing the iptables but instead editing the Apache config?

I’m assuming you are running a web application so you’ll also want to restrict access to HTTP. <br> <br>That’s easier done via whatever web server you are running like Nginx or Apache than to mess around with iptables, but you’ll also need a whitelist of your IPs, your local PCs/laptops that you will want to connect with. <br> <br>What application stack are you running and which webserver? <br> <br>Also you don’t want to run those iptables rules without adding a whitelist set of IPs and also its a good idea to take a snapshot of your server before doing any config changes that may lock you out, otherwise you will be fixing them via console, or you could just revert to the snapshot prior to the change.

Quick follow up question. How should I configure the iptables on the development server? I don’t want the public to be able to access the development server from the Internet. I currently created the following iptables firewall rules: <br> <br># iptables -A INPUT -i lo -j ACCEPT <br># iptables -A INPUT -p tcp --dport ssh -j ACCEPT <br># iptables -A INPUT -j REJECT <br> <br>Should this suffice for our server? I’m new to iptables so I want to ensure that our server will be hidden from the Internet.

Thank you very much for the quick replies! Your help is greatly appreciated. We’re going to develop locally and then test on a development server. This sounds like the best way to go.

I’d definitely agree with Moisey on this one. Develop on your local environment then use the development server or ‘staging’ server to test to see how the code will run in a ‘production’ setting… compile assets, deploy from git and see how everything runs. If you need any more help, just drop me a line!

There’s no particular right or wrong way to do it, it all comes down to what’s comfortable. <br> <br>One way that you can develop quickly and test without having to constantly deploy to the development server is to grant access to your DB from your local laptops/PCs and develop and test the code initially straight from your laptop, assuming it has the ability to run the stack you are developing in. <br> <br>Then after you’ve done a days worth of work or a week you can deploy to the dev server and test from the web to ensure that everything works as expected from a proper linux server environment. <br> <br>Using this method your development DB always stays in sync because even if you develop locally on your machine you are still connecting to the DB that is maintained on your development server. It also allows your friend to see the same DB state as you do when you guys are working.