Installation

sudo apt update
sudo apt -y install apache2

Disk Vorbereitung

Auf vmls3 und vmls5.

Installation lshw

sudo apt update
sudo apt -y install lshw

Partitionierung

sudo fdisk /dev/sdb
 
# Command (m for help):
n
# Partition type
#    p   primary (0 primary, 0 extended, 4 free)
#    e   extended (container for logical partitions)
# Select (default p):
 
# Partition number (1-4, default 1): 
 
# First sector (2048-2097151, default 2048): 
 
# Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-2097151, default 2097151): 
 
#Created a new partition 1 of type 'Linux' and of size 1023 MiB.
 
# Command (m for help):
w

Formatierung

sudo mkfs.ext4 /dev/sdb1

Mount

sudo mkdir /www

/etc/fstab:

...
/dev/sdb1   /www    ext4   defaults    1   2
...
sudo mount -a

DNS Einträge erstellen

/etc/bind/db.dmz.smartlearn:

...
www     IN      A       192.168.220.13
@       IN      A       192.168.220.13
...

/etc/bind/db.lan.smartlearn:

...
www     IN      A       192.168.210.65
@       IN      A       192.168.210.65
ku1     IN      A       192.168.210.65
ku2     IN      A       192.168.210.65
www.ku1 IN      A       192.168.210.65
www.ku2 IN      A       192.168.210.65
...
sudo systemctl restart named

Konfiguration vmls3

Verzeichnisse /www/<host> mit den Webseiteinhalten erstellen.

sudo chown -R www-data:www-data /www

Virtuellen Host erstellen

/etc/apache2/sites-available/www.smartlearn.dmz.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@smartlearn.dmz
    ServerName smartlearn.dmz
    ServerAlias www.smartlearn.dmz
    DocumentRoot /www/www.smartlearn.dmz
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Seite aktivieren

sudo a2ensite www.smartlearn.dmz.conf
sudo systemctl reload apache2

Konfiguration vmls3

Verzeichnisse /www/<host> mit den Webseiteinhalten erstellen.

sudo chown -R www-data:www-data /www

Virtuelle Hosts erstellen

/etc/apache2/sites-available/www.smartlearn.lan.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@smartlearn.lan
    ServerName smartlearn.lan
    ServerAlias www.smartlearn.lan
    DocumentRoot /www/www.smartlearn.lan
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

/etc/apache2/sites-available/ku1.smartlearn.lan.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@smartlearn.lan
    ServerName ku1.smartlearn.lan
    ServerAlias www.ku1.smartlearn.lan
    DocumentRoot /www/ku1.smartlearn.lan
    <Directory /www/ku1.smartlearn.lan>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

/etc/apache2/sites-available/ku2.smartlearn.lan.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@smartlearn.lan
    ServerName ku2.smartlearn.lan
    ServerAlias www.ku2.smartlearn.lan
    DocumentRoot /www/ku2.smartlearn.lan
    <Directory /www/ku2.smartlearn.lan>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Seiten aktivieren

sudo a2ensite www.smartlearn.lan.conf
sudo a2ensite ku1.smartlearn.lan.conf
sudo a2ensite ku2.smartlearn.lan.conf
sudo systemctl reload apache2