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

I have some domains and a CentOS VPS server. I built a basic LAMP server on my VPS and now I want to connect all of my domains to a different folder. Something like this:


How to do this? I am sorry but I am really new at server managing stuff...

share|improve this question

1 Answer 1

up vote 1 down vote accepted

The basic principal is called 'VHost' or 'Virtual Hosts'. A VHost config will look something like

<VirtualHost *:80/>
    ServerAdmin you@domain.com
    DocumentRoot /var/www/html/yoursite
    ServerName yoursite.com
    ServerAlias www.yoursite.com

<VirtualHost *:80/>
    ServerAdmin you@domain.com
    DocumentRoot /var/www/html/yourothersite
    ServerName yourothersite.com
    ServerAlias www.yourothersite.com

For a more in-depth example just google 'Apache Virtual Hosts'

You might also want to look into CPanel, Plesk, Webmin and similar GUI based config generators to look after everything on your server

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.