76 lines
1.7 KiB
Plaintext
76 lines
1.7 KiB
Plaintext
##### Kapitel 7 - Virtuelle Hosts
|
|
|
|
### Vorbereitung
|
|
<Directory /usr/local/apache2/htdocs-*>
|
|
Require all granted
|
|
</Directory>
|
|
|
|
### IP-based VHost
|
|
|
|
<VirtualHost 172.31.31.101:80>
|
|
DocumentRoot /usr/local/apache2/htdocs-ipbased.sv
|
|
ServerName ipbased.sv
|
|
CustomLog logs/ipbased-access.log combined
|
|
ErrorLog logs/ipbased-error.log
|
|
|
|
#Redirect / https://ipbased.sv/
|
|
</VirtualHost>
|
|
|
|
### Name-based VHost
|
|
|
|
<VirtualHost 172.31.31.102:80>
|
|
DocumentRoot /var/www/empty
|
|
ServerName 172.31.31.102
|
|
ErrorLog logs/102-error.log
|
|
</VirtualHost>
|
|
|
|
<VirtualHost 172.31.31.102:80 *:8002>
|
|
DocumentRoot /usr/local/apache2/htdocs-firma1.sv
|
|
ServerName firma1.sv
|
|
ServerAlias *.firma1.sv
|
|
CustomLog logs/firma1-access.log combined
|
|
ErrorLog logs/firma1-error.log
|
|
</VirtualHost>
|
|
|
|
<VirtualHost 172.31.31.102:80 *:8002>
|
|
DocumentRoot /usr/local/apache2/htdocs-firma2.sv
|
|
ServerName firma2.sv
|
|
ServerAlias *.firma2.sv
|
|
CustomLog logs/firma2-access.log combined
|
|
ErrorLog logs/firma2-error.log
|
|
</VirtualHost>
|
|
|
|
### Massen-Hosting
|
|
|
|
LoadModule vhost_alias_module modules/mod_vhost_alias.so
|
|
|
|
UseCanonicalName off
|
|
LogFormat "%V %h %l %u %t \"%r\" %>s %b" vcommon
|
|
LogFormat "%V %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" vcombined
|
|
|
|
<VirtualHost 172.31.31.103:80>
|
|
VirtualDocumentRoot /usr/local/apache2/htdocs-mass/%-2.0.%-1.0
|
|
CustomLog logs/masshosting-access.log vcombined
|
|
ErrorLog logs/masshosting-error.log
|
|
</VirtualHost>
|
|
|
|
##### Weiteres
|
|
|
|
### VHost auf 127.0.0.1:8001
|
|
|
|
Listen 127.0.0.1:8001
|
|
|
|
<VirtualHost 127.0.0.1:8001>
|
|
DocumentRoot /usr/local/apache2/htdocs-8001
|
|
CustomLog logs/8001-access.log combined
|
|
ErrorLog logs/8001-error.log
|
|
</VirtualHost>
|
|
|
|
### Name-base VHosts zusätzlich auf Port 8002
|
|
|
|
Listen *:8002
|
|
|
|
#<VirtualHost 172.31.31.102:80 *:8002>
|
|
# [...]
|
|
#</VirtualHost>
|