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
Ipotizziamo di inserire le seguenti due direttive nel file di configurazione di Apache:
ServerName pippo.it
DocumentRoot "C:\Programmi\Apache2\htdocs\pippo.it"
ServerName DocumentRoot "C: \\ Program Files \\ Apache2 \\ htdocs \\ pluto.it"
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
If the server receives a request for a resource hosted in the domain pluto.it realizes that the first directive
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