Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am coming from IIS and setting up virtual directories there is so pleasantly easy. You just right-click and add a "virtual directory" pointing to any path you like. This relative path gets reflected through the browser when viewing the site.

How do I accomplish the same thing with Apache? Symlinks scare me because deleting cascades through. Is there a better way to create virtual directories in Apache? I am using MAMP for Mac which uses apache2.

share|improve this question

Use the Alias directive in the Apache configuration file.

Alias /virtual-dir /var/www/foo

Additionally, rm -r does not traverse symlinks and will not cascade through.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.