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 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:

/var/www//html

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

share|improve this question
add comment

1 Answer

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>


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

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
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.