Are you always working online, or maybe even on the live version of your website? There are plenty of reasons not to do that, for example an internet connection may not be around, or you risk corrupting your live website, and break it for potential users. That’s not professional.
Please check out these related blog articles on version control:
- Use version control to improve development workflows
- Manage your code with GitHub
- Source Tree provides a GUI for version control
- Using GitTower to work with your code
- Is Beanstalk an alternative to GitHub?
Local development environment
If you use a version control system you may not have a centralized development system, or maybe you simply prefer local development. Either way you need to set up a local development environment. If you are a regular web developer, this includes a webserver with script-support and a database server. Typically this is Apache webserver with PHP support and a MySQL database server. Check out XAMPP (or MAMP, for Mac users). Those two bundles offers you a complete ready-to-go local development enivronment.
Setup local domain “myproject.local”
If you’re a Unix user, you can easily setup your system to even support a fictitious local domain, like myproject.local. Simply edit the /etc/hosts file to point the intended domain name to your local IP address (typically 127.0.0.1). See the other entries in the /etc/hosts file for examples and syntax. You can just copy and customize the existing entries.
In your webserver conf (using Apache in this example), you need to setup virtual hosts. Otherwise the webserver will react on any domain name. Setup a virtual host for this example like this:
<VirtualHost *:80> ServerName myproject.local DocumentRoot /path/to/my/project # Other directives here </VirtualHost>
Developing on a local machine can be a real time saver if using a proper syncing or versioning tool. Happy coding :-)
No comments yet (leave a comment)