Virtualhosts in apache

To activate virtualhosts write, in the end of the httpd.conf :

NameVirtualHost *

And after that you can add virtualhosts with this syntax, just make sure the dns names points to your servers ip:

<VirtualHost *>
    Documentroot /home/subdomain
    ServerName subdomain.cyberfamily.dk
    Serveralias www.subdomain.cyberfamily.dk
    ScriptAlias /cgi-bin/ "/home/subdomain/cgi-bin"
</VirtualHost>

 

Documentroot , tells apache where the .html files will be
ServerName , tells what name apache should call itself when a users requests a page from the virtualdomain
Serveralias , tells apache an alias for the vhost, for an instance www.
ScriptAlias , tells apache where to find cgi-scripts for vhost

Dette indlæg blev udgivet i Apache, Knowledge Base, Old Base. Bogmærk permalinket.

Skriv et svar