====== HTTP Server: Configuring your server for its domains (virtual hosts) ======
This little guide is for Gandi AI users who have Apache2 installed on their servers. If you haven't installed Apache2 yet, you can do so via the Gandi AI interface (**[[en:hosting:gandi-ai:manage|help]]**) before applying this tutorial.
===== Essential configuration =====
This step is essential for your server to be organised according to the domains (virtual hosts) that will refer to it.
You will need to create and select a user for each virtualhost. This user (and of course the user "admin") will have access to the files of this virtualhost. This will allow you to share the management of the website corresponding to the virtualhost with another user.
Following which, you'll need to configure these virtual hosts by pointing them to the server (see below).
{{en:hosting:gandi-ai:en_hosting_gandi-ai_apache.png|}}
In the above example, you can see how a server can be configured according to the relevant virtual hosts.
The **www** and **blog** sub-domains for **mysite.com**, and the **www** sub-domain for **johns-site.com** will have their own folders on my server.
Once these virtual hosts point to your server, the following addresses will direct visitors to content hosted on your server:
\\
\\
//%%http://www.mysite.com%%//\\
//%%http://blog.mysite.com%%//\\
//%%http://www.johns-site.com%%//\\
\\
===== Advanced configuration =====
Now let's take a look at one of the options available in this module's **Advanced server administrator mode** (make sure you have activated this mode at the top of the AI interface).
* In the "Server Alias" section, you can enter all the sub-domains, other domain names that will respond by displaying the same site, corresponding to this virtualhost.
* Add a protected directory : use this option to restrict the access of a folder of your virtualhost. For example, type "/protected" if you want to restrict the access to "www.anotherwebsite.com/protected".
\\
{{en:hosting:gandi-ai:en_hosting_gandi-ai_apache-bis.png|}}
\\
Restricted access to your server for a user, as set up here, only concerns the use of FTP clients. If a user of yours connects to your server using SSH, he will have a much wider range of action. This function should therefore only used to give access to people you trust. Server-less friends, in other words. :)
You won't be able to "see" your websites at your chosen domains unless you have pointed these domains to your server. To do so, please read the following tutorial:
* [[en:hosting:manage-quota:attach-domain|Configure your virtual hosts (domains)]]
----