Skip to content

Instantly share code, notes, and snippets.

@jasonsnider
Created December 20, 2010 19:17
Show Gist options
  • Save jasonsnider/748841 to your computer and use it in GitHub Desktop.
Save jasonsnider/748841 to your computer and use it in GitHub Desktop.
#!/bin/bash
#=============================================================================
# The MIT License (http://www.opensource.org/licenses/mit-license.php)
# Copyright (c) 2010, Jason Snider <[email protected]>
#
# vhosts.sh - Assists in building new VirtualHosts
#
# Assists in quickly building local dev sites. Out of the box, this shouldn't
# be used in production, though with a little modification it can be suited
# for such use.
#
# @author Jason D Snider <[email protected]>
#=============================================================================
#=============================================================================
# Update your hosts file ##choose an editor
#=============================================================================
sudo vim /etc/hosts
#=============================================================================
# Udpate your vhosts file ##choose an editor
#=============================================================================
sudo vim /etc/apache2/sites-available/default
#=============================================================================
# Udpate your ssl- vhosts file ##choose an editor
#=============================================================================
sudo vim /etc/apache2/sites-available/default-ssl
#=============================================================================
# Disable the existing hosts configuration
#=============================================================================
sudo a2dissite default
sudo a2dissite default-ssl
sudo /etc/init.d/apache2 restart
#=============================================================================
# Enable the existing hosts configuration
#=============================================================================
sudo a2ensite default
sudo a2ensite default-ssl
sudo /etc/init.d/apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment