Apache Virtualhost ???

Gladly Suffer gladly_suffer na centrum.cz
Čtvrtek Prosinec 9 16:49:40 CET 2004


Co to zkusit treba takhle:

### Section 3: Virtual Hosts
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry 
about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for requests without a known
# server name.
#
<VirtualHost *:80>
         ServerName hlavni.web.cz
         DocumentRoot /home/wwwroot
         LogFormat "%h %l %u %t \"%r\" %>s %b" common
         CustomLog logs/hlavni.web.cz.access_log common
         ErrorLog logs/hlavni.web.cz.error_log
</VirtualHost>

<VirtualHost *:80>
         ServerName host1.domena1.cz
         DocumentRoot /home/host1.domena1.cz
         LogFormat "%h %l %u %t \"%r\" %>s %b" common
         CustomLog logs/host1.domena1.cz.access_log common
         ErrorLog logs/host1.domena1.cz.error_log
</VirtualHost>

<VirtualHost *:80>
         ServerName host2.domena2.cz
         DocumentRoot /home/host2.domena2.cz
         LogFormat "%h %l %u %t \"%r\" %>s %b" common
         CustomLog logs/host2.domena2.cz.access_log common
         ErrorLog logs/host2.domena2.cz.error_log
</VirtualHost>

<VirtualHost *:80>
         ServerName host3.domena3.cz
         DocumentRoot /home/host3.domena3.cz
         LogFormat "%h %l %u %t \"%r\" %>s %b" common
         CustomLog logs/host3.domena3.cz.access_log common
         ErrorLog logs/host3.domena3.cz.error_log
</VirtualHost>


pokavad v nekolika hostech budes chtit stejnej obsah tak jim dej stejnej 
                stejnejd DocumentRoot.

Ja to takhle pouzivam na Apache2.

S pozdravem

GS

PS: http://httpd.apache.org/docs-2.0/vhosts/


Další informace o konferenci Linux