Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

How to configure Apache to load special folder when using special port ?

Document root is : www\
Now i want to load www\folder\ when i enter http://localhost:8090/ on url.

I think i should create a virtual host. but don't know how to configure it.

share|improve this question
up vote 2 down vote accepted

yes , you answered yourself. Here's a generic configuration

Server configuration

# Ensure that Apache listens on port 80
Listen 80

# Listen for virtual host requests on all IP addresses
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /www

# Other directives here


<VirtualHost *:8090>
DocumentRoot /www/folder

# Other directives here


I am considering and pointing to ie. localhost

share|improve this answer
Thank you dear Kaji – Omid Amraei Feb 6 '12 at 14:25

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.