From 65ca0877fd9c26da64930098b78a17f0fa7e8162 Mon Sep 17 00:00:00 2001 From: Sven Velt Date: Tue, 15 Oct 2024 14:40:20 +0200 Subject: [PATCH] Kapitel 07: virtuelle Hosts --- conf/kapitel/kapitel_07.conf | 75 +++++++++++++++++++++++++++++++++ htdocs-8001/index.html | 1 + htdocs-firma1.sv/index.html | 1 + htdocs-firma2.sv/index.html | 1 + htdocs-ipbased.sv/index.html | 1 + htdocs-mass/mass1.sv/index.html | 1 + htdocs-mass/mass2.sv/index.html | 1 + 7 files changed, 81 insertions(+) create mode 100644 conf/kapitel/kapitel_07.conf create mode 100644 htdocs-8001/index.html create mode 100644 htdocs-firma1.sv/index.html create mode 100644 htdocs-firma2.sv/index.html create mode 100644 htdocs-ipbased.sv/index.html create mode 100644 htdocs-mass/mass1.sv/index.html create mode 100644 htdocs-mass/mass2.sv/index.html diff --git a/conf/kapitel/kapitel_07.conf b/conf/kapitel/kapitel_07.conf new file mode 100644 index 0000000..fc41328 --- /dev/null +++ b/conf/kapitel/kapitel_07.conf @@ -0,0 +1,75 @@ +##### Kapitel 7 - Virtuelle Hosts + +### Vorbereitung + + Require all granted + + +### IP-based VHost + + + 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/ + + +### Name-based VHost + + + DocumentRoot /var/www/empty + ServerName 172.31.31.102 + ErrorLog logs/102-error.log + + + + DocumentRoot /usr/local/apache2/htdocs-firma1.sv + ServerName firma1.sv + ServerAlias *.firma1.sv + CustomLog logs/firma1-access.log combined + ErrorLog logs/firma1-error.log + + + + DocumentRoot /usr/local/apache2/htdocs-firma2.sv + ServerName firma2.sv + ServerAlias *.firma2.sv + CustomLog logs/firma2-access.log combined + ErrorLog logs/firma2-error.log + + +### 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 + + + VirtualDocumentRoot /usr/local/apache2/htdocs-mass/%-2.0.%-1.0 + CustomLog logs/masshosting-access.log vcombined + ErrorLog logs/masshosting-error.log + + +##### Weiteres + +### VHost auf 127.0.0.1:8001 + +Listen 127.0.0.1:8001 + + + DocumentRoot /usr/local/apache2/htdocs-8001 + CustomLog logs/8001-access.log combined + ErrorLog logs/8001-error.log + + +### Name-base VHosts zusätzlich auf Port 8002 + +Listen *:8002 + +# +# [...] +# diff --git a/htdocs-8001/index.html b/htdocs-8001/index.html new file mode 100644 index 0000000..679f8f2 --- /dev/null +++ b/htdocs-8001/index.html @@ -0,0 +1 @@ +

Svens WebServer auf 8001

diff --git a/htdocs-firma1.sv/index.html b/htdocs-firma1.sv/index.html new file mode 100644 index 0000000..dd0753e --- /dev/null +++ b/htdocs-firma1.sv/index.html @@ -0,0 +1 @@ +

Svens erster Name-based WebServer

diff --git a/htdocs-firma2.sv/index.html b/htdocs-firma2.sv/index.html new file mode 100644 index 0000000..6aeafef --- /dev/null +++ b/htdocs-firma2.sv/index.html @@ -0,0 +1 @@ +

Svens zweiter Name-based WebServer

diff --git a/htdocs-ipbased.sv/index.html b/htdocs-ipbased.sv/index.html new file mode 100644 index 0000000..49e05ba --- /dev/null +++ b/htdocs-ipbased.sv/index.html @@ -0,0 +1 @@ +

Svens IP-based WebServer

diff --git a/htdocs-mass/mass1.sv/index.html b/htdocs-mass/mass1.sv/index.html new file mode 100644 index 0000000..91b31b8 --- /dev/null +++ b/htdocs-mass/mass1.sv/index.html @@ -0,0 +1 @@ +

Svens erster Massenhosting-WebServer

diff --git a/htdocs-mass/mass2.sv/index.html b/htdocs-mass/mass2.sv/index.html new file mode 100644 index 0000000..3c80e44 --- /dev/null +++ b/htdocs-mass/mass2.sv/index.html @@ -0,0 +1 @@ +

Svens zweiter Massenhosting-WebServer