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.

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

1 Answer 1

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
ServerName www.example1.com

# Other directives here

</VirtualHost>

<VirtualHost *:8090>
DocumentRoot /www/folder
ServerName www.example2.org

# Other directives here

</VirtualHost>

I am considering www.example2.org and www.example1.com pointing to 127.0.0.1 ie. localhost

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

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.