Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

Apache/Virtual hosting

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Principle Virtual hosting in Apache allows a single instance of the Apache software to host more than one distinct web site. Since only one instance of Apache can use port 80 on a server at once, without virtual hosting each new web site you hosted would need a new server. Sites hosted under virtual hosting appear to end users as normal sites in every way; the only difference is that fewer server machines are needed to host them. Virtual hosting is commonly used by high-volume low-price web hosting companies, who give each of their customers a virtual host, with potentially hundreds of customers sharing the same server. Configuration To add a virtual host, edit apache2.conf (or httpd.conf). Example:https://httpd.apache.org/docs/2.4/en/vhosts/examples.html <VirtualHost MyIP:80> ServerAdmin admin@site1.com DocumentRoot /home/site1/public_html ServerName site1.com ServerAlias www.site1.com </VirtualHost> <VirtualHost MyIP:80> ServerAdmin admin@site2.com DocumentRoot /home/site2/public_html ServerName site2.com ServerAlias www.site2.com AccessLog /home/site2/access.log ErrorLog /home/site2/error.log <Directory /home/site2/public_html> AllowOverride All </Directory> </VirtualHost> References fr:Apache/Serveurs virtuels