1

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

Povylas
  • 113
  • 3

1 Answers1

1

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