Laran Evans
I develop software people love to use.
  • Home
  • About
  • Contact
  • Resume
  • Testimonials
Skip to content
  • Entrepreneurship
    • Leadership
    • Project Management
    • Team Development
    • Time Management
  • Puzzles
  • Software Architecture
    • Cloud Computing
  • Software Development
    • Algorithms
    • CSS
    • Java
    • Javascript
    • MySQL
    • PHP
    • Python
    • Ruby and Rails
    • System Administration
« Installing Phusion Passenger for Apache: Step 1.5
Simple Fix for Apache on Snow Leopard »

6 Must-Know Sys-Admin How-Tos for Web Developers

By laran | Published: 2009/12/21

The ability to develop software productively requires the ability to manage your development, test and production environments. Managing a production environment is best left to a professional, trained system administrator. But managing a development environment is something that most developers like to do themselves because it gives them the flexibility to set it up however they like.

This can become a tremendous time sync however if you’re working on multiple projects in parallel, each of which requires a slightly different development environment. Settings and configurations can conflict. Without the know-how to quickly tweak settings and modify your environment you’ll end up losing many hours to figuring out how to just get a working development environment.

How-Tos

Export and import a MySQL database in one step

Use mysqldump to export the file and mysql to import it. Pipe the output of a into b and you’ve copied your database from servera to serverb.

mysqldump -uroot -prootpassword -hservera a_database | mysql -uroot -prootpassword -hserverb a_database

Securely Copy a File from a Linux Server to your Workstation

* Requires a *nix shell on both ends.

scp me@server:/path/to/file local.file.name

Set up a local Apache Virtual Host

Be sure you have this fragment in your Apache config somewhere before including your virtual host config file (which in recent versions of Apache is included via files other than httpd.conf.

NameVirtualHost *:80

Then add the snippet below wherever your virtual-hosts are defined (can be anywhere inside your configuration, but is often done on Linux via sites-available/sites-enabled and other times via /path/to/apache/conf/extra/httpd-vhosts.conf.

<VirtualHost *:80>
  ServerName appname.local
  DocumentRoot /path/to/app
  <Directory /path/to/app>
    Options All
    AllowOverride All
    Order deny,allow
    Allow from all
  </Directory>
</VirtualHost>

After making this change you’ll need to restart Apache (see how) and map the new hostname (see how).

Then point your browser to http://appname.local/ and you’re in business.

Restart Apache

On *nix (including OSX):

sudo apache2ctl graceful

On Windows

Either restart the Apache2 service (see: How to Restart a Windows Service).

Restart a Windows Service

  1. Right-click “My Computer”
  2. Click “Manage”
  3. Click “Services” under “Services and Applications”
  4. Select the service you want to restart and click “Restart”

Map a virtual host name to localhost

To get http://app.local to point to your local machine:

On *nix

Add the following to /etc/hosts:

127.0.0.1 app.local

On Windows

Add the following to C:/Windows/system32/drivers/etc/hosts:

127.0.0.1 app.local

Conclusion

There are countless individual, simple tasks which you’ll need to perform over and over as a developer. These are just a few that I use more than others. So take these, put them in your bag of tricks and build great apps. Enjoy!

This entry was posted in System Administration and tagged apache, linux, MySQL, unix, windows. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.
« Installing Phusion Passenger for Apache: Step 1.5
Simple Fix for Apache on Snow Leopard »

Post a Comment

Click here to cancel reply.

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • About Me

    I've got a masters degree in computer science and over 10 years of experience building web-based systems using Java/J2EE, Ruby, Rails and PHP. I'm a strong believer in the effectiveness of Agile Methods. Read more »

  • Subscribe

  • Table of Contents
    • How-Tos
      • Export and import a MySQL database in one step
      • Securely Copy a File from a Linux Server to your Workstation
      • Set up a local Apache Virtual Host
      • Restart Apache
        • On *nix (including OSX):
        • On Windows
      • Restart a Windows Service
      • Map a virtual host name to localhost
        • On *nix
        • On Windows
    • Conclusion
  • Similar Posts
    • What's running on port XXXX?
    • Simple Fix for Apache on Snow Leopard
    • Resolve MySQL Issues in Rails on Windows
    • Installing Magento on Dreamhost the easy way
    • Debugging Cron on Ubuntu
Hello world
  • From Around the Web

    • Chopper Girl @ The 2010 Brass Balls Long Road Party (Uploads from BRASS BALLS BOBBERS)
    • Web App Business Models: User Needs and What People Pay For (Box UK Blog)
    • Blog Writing Tips from the World’s Most Famous Authors (Blogsessive.com)
    • How to get exponential success on your blog (CatsWhoBlog.com)
    • The Four Stages of Growing a Blog (Daily Blog Tips)
    Shared Items
  • Recent Posts

    • 80 pages of Ruby on Rails Performance Optimization Tips
    • Ruby Garbage Collection In-Depth
    • Binary Logic Basics
    • Kuali in Nacubo Magazine
    • Ruby Blocks, Procs, Lambda
  • Older Posts By Month

    Let's Talk

    Ask a question below. You'll be prompted for your name and email after you click the "Ask" button.

Know more. Accomplish more. Succeed.