Drupal 7 Tutorial Part 19: Understanding Drupal 7 Content Types & Fields Concepts !
How to create Virtual Hosts for Drupal Instance on Linux Ubuntu Local Machine
Instead of using localhost/sitename if you would like to use domains such as local.sitename.com then follow below process. It will be helpful to avoid basepath in rich text editor links and can avoid basepath issues if any !
Assume your code resides at /var/www/drupalsite.
You can access your site using http://localhost/drupalsite.
You would like to access same site using http://local.drupalsite.com to solve path issues and wysiywig editor images, and files link issues.
Open the file in your editor. /etc/apache2/sites-enabled/vhosts.conf
Edit file with below lines of code.