Sunday, April 26, 2009

Brazilian Waxing Edmonton

Creare Virtual hosts con Apache

The technique allows you to host multiple virtual hosts domains behind a single IP address, and then on the same machine.

E 'Simply plug in your Apache configuration file (httpd.conf or other related files such as conf / extra / httpd-vhosts.conf) guidelines. In particular:

NameVirtualHost Directive
Used to tell Apache which IP address / port should expect to receive requests for virtual hosts. You can specify un IP specifico, ad esempio:
NameVirtualHost 23.34.45.56:80

Oppure potete usare l'asterisco:
NameVirtualHost *:80
per dire ad Apache che qualsiasi richiesta arrivi sulla porta 80, indirizzata a qualsiasi indirizzo IP, può potenzialmente riferirsi ad un virtual host.

A questo punto Apache va alla ricerca di direttive che gli dicano come comportarsi per questa richiesta.

Ipotizziamo di inserire le seguenti due direttive nel file di configurazione di Apache:

<VirtualHost *:80>
ServerName pippo.it
DocumentRoot "C:\Programmi\Apache2\htdocs\pippo.it"
< / VirtualHost >

\u0026lt;VirtualHost *:80>
pluto.it
ServerName DocumentRoot "C: \\ Program Files \\ Apache2 \\ htdocs \\ pluto.it"
\u0026lt; / VirtualHost >

If the server receives a request for a resource hosted in the domain pippo.it (HTTP 1.1 requires the client to send the hostname to which it addresses) realizes that the First Directive with matcha IP: port of the request, then reads the ServerName directive, which also matches with the hostname specified in the request, and then argues that the DocumentRoot to search the requested resource is C: \\ Program Files \\ Apache2 \\ htdocs \\ pippo.it.

If the server receives a request for a resource hosted in the domain pluto.it realizes that the first directive does not match with the IP: port of the request and matches the second directive, and then reasoning as before, going to recover requested resource in the specified location from the DocumentRoot C: \\ Program Files \\ Apache2 \\ htdocs \\ pluto.it

The official documentation for the version of Apache 2.2 is at http://httpd.apache.org/docs/2.2/ vhosts /

Hello!

0 comments:

Post a Comment