Differenze tra le versioni di "Apache con virtual hosts"

Da Caos per caso.
Jump to navigation Jump to search
imported>Giorgio
(Creata pagina con 'You have multiple domains going to the same IP and also want to serve multiple ports. By defining the ports in the "NameVirtualHost" tag, you can allow this to work. If you try u…')
 
imported>Giorgio
 
Riga 6: Riga 6:
 
         NameVirtualHost 111.22.33.44:80
 
         NameVirtualHost 111.22.33.44:80
 
         NameVirtualHost 111.22.33.44:8080
 
         NameVirtualHost 111.22.33.44:8080
 
+
 
         <VirtualHost 111.22.33.44:80>
 
         <VirtualHost 111.22.33.44:80>
 
         ServerName www.domain.tld
 
         ServerName www.domain.tld
 
         DocumentRoot /www/domain-80
 
         DocumentRoot /www/domain-80
 
         </VirtualHost>
 
         </VirtualHost>
 
+
 
         <VirtualHost 111.22.33.44:8080>
 
         <VirtualHost 111.22.33.44:8080>
 
         ServerName www.domain.tld
 
         ServerName www.domain.tld
 
         DocumentRoot /www/domain-8080
 
         DocumentRoot /www/domain-8080
 
         </VirtualHost>
 
         </VirtualHost>
 
+
 
         <VirtualHost 111.22.33.44:80>
 
         <VirtualHost 111.22.33.44:80>
 
         ServerName www.otherdomain.tld
 
         ServerName www.otherdomain.tld
 
         DocumentRoot /www/otherdomain-80
 
         DocumentRoot /www/otherdomain-80
 
         </VirtualHost>
 
         </VirtualHost>
 
+
 
         <VirtualHost 111.22.33.44:8080>
 
         <VirtualHost 111.22.33.44:8080>
 
         ServerName www.otherdomain.tld
 
         ServerName www.otherdomain.tld

Versione attuale delle 22:59, 30 nov 2009

You have multiple domains going to the same IP and also want to serve multiple ports. By defining the ports in the "NameVirtualHost" tag, you can allow this to work. If you try using <VirtualHost name:port> without the NameVirtualHost name:port or you try to use the Port directive, your configuration will not work.

Server configuration:

       ...   
       NameVirtualHost 111.22.33.44:80
       NameVirtualHost 111.22.33.44:8080

       <VirtualHost 111.22.33.44:80>
       ServerName www.domain.tld
       DocumentRoot /www/domain-80
       </VirtualHost>

       <VirtualHost 111.22.33.44:8080>
       ServerName www.domain.tld
       DocumentRoot /www/domain-8080
       </VirtualHost>

       <VirtualHost 111.22.33.44:80>
       ServerName www.otherdomain.tld
       DocumentRoot /www/otherdomain-80
       </VirtualHost>

       <VirtualHost 111.22.33.44:8080>
       ServerName www.otherdomain.tld
       DocumentRoot /www/otherdomain-8080
       </VirtualHost>


Fonte

http://httpd.apache.org/docs/1.3/vhosts/examples.html