Kapitel 07: virtuelle Hosts
This commit is contained in:
parent
8e39b99920
commit
65ca0877fd
75
conf/kapitel/kapitel_07.conf
Normal file
75
conf/kapitel/kapitel_07.conf
Normal file
|
@ -0,0 +1,75 @@
|
|||
##### 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>
|
1
htdocs-8001/index.html
Normal file
1
htdocs-8001/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Svens WebServer auf 8001</h1>
|
1
htdocs-firma1.sv/index.html
Normal file
1
htdocs-firma1.sv/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Svens erster Name-based WebServer</h1>
|
1
htdocs-firma2.sv/index.html
Normal file
1
htdocs-firma2.sv/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Svens zweiter Name-based WebServer</h1>
|
1
htdocs-ipbased.sv/index.html
Normal file
1
htdocs-ipbased.sv/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Svens IP-based WebServer</h1>
|
1
htdocs-mass/mass1.sv/index.html
Normal file
1
htdocs-mass/mass1.sv/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Svens erster Massenhosting-WebServer</h1>
|
1
htdocs-mass/mass2.sv/index.html
Normal file
1
htdocs-mass/mass2.sv/index.html
Normal file
|
@ -0,0 +1 @@
|
|||
<h1>Svens zweiter Massenhosting-WebServer</h1>
|
Loading…
Reference in a new issue