Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.