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.

link|improve this question
feedback

1 Answer

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

link|improve this answer
Thank you dear Kaji – Omid Amraei Feb 6 at 14:25
feedback

Your Answer

 
or
required, but never shown

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