Skip to content
SDI-Docs

Basic Pages

Install Apache

apt install apache2

Create DNS Record

We need to create a DNS Record on the nssdi.mi.hdm-stuttgart.de SDI DNS Server.

nsupdate -y $HMAC
> server nssdi.mi.hdm-stuttgart.de
> update add www.g1.sdi.mi.hdm-stuttgart.de 3600 IN CNAME sdi1.g1.sdi.mi.hdm-stuttgart.de
> send
> quit

Move Index file

mv /var/www/html/index.html /var/www/html/doc.html

Result

Create own Root Index File

vim /var/www/html/index.html
curl localhost
<h1> Hello &#9995; </h1>

Install and acces the Apache Documentation

apt install apache2-doc

To find the documentation we can look in the default page provided by apache, which is now named doc.html In there we can find the path to the documentation, which is /manual

...
<div class="content_section_text">
  <p>
    Debian's Apache2 default configuration is different from the upstream
    default configuration, and split into several files optimized for
    interaction with Debian tools. The configuration system is
    <b>fully documented in /usr/share/doc/apache2/README.Debian.gz</b>. Refer to
    this for the full documentation. Documentation for the web server itself can
    be found by accessing the <a href="/manual">manual</a> if the
    <tt>apache2-doc</tt>
    package was installed on this server.
  </p>
  ...
</div>
curl localhost/manual/
<html><head><meta http-equiv="refresh" content="0; URL=en/index.html"></head>
<body>
<table><tr><td><a href="da/index.html">da/</a></td></tr>
<tr><td><a href="de/index.html">de/</a></td></tr>
<tr><td><a href="en/index.html">en/</a></td></tr>
<tr><td><a href="es/index.html">es/</a></td></tr>
<tr><td><a href="fr/index.html">fr/</a></td></tr>
<tr><td><a href="ja/index.html">ja/</a></td></tr>
<tr><td><a href="ko/index.html">ko/</a></td></tr>
<tr><td><a href="pt-br/index.html">pt-br/</a></td></tr>
<tr><td><a href="ru/index.html">ru/</a></td></tr>
<tr><td><a href="tr/index.html">tr/</a></td></tr>
<tr><td><a href="zh-cn/index.html">zh-cn/</a></td></tr>

Adding an Alias

We first create the directory for our documentation /home/sdidocs.

Now we can add an alias to our apache configuration file.

vim /etc/apache2/mods-available/alias.conf
<IfModule alias_module>
	# Aliases: Add here as many aliases as you need (with no limit). The format is
	# Alias fakename realname
	#
	# Note that if you include a trailing / on fakename then the server will
	# require it to be present in the URL.  So "/icons" isn't aliased in this
	# example, only "/icons/".  If the fakename is slash-terminated, then the
	# realname must also be slash terminated, and if the fakename omits the
	# trailing slash, the realname must also omit it.
	#
	# We include the /icons/ alias for FancyIndexed directory listings.  If
	# you do not use FancyIndexing, you may comment this out.

	Alias /icons/ "/usr/share/apache2/icons/"


	<Directory "/usr/share/apache2/icons">
	  Options FollowSymlinks
	  AllowOverride None
	  Require all granted
	</Directory>

	Alias /mk381 "/home/sdidocs/"

	<Directory "/home/sdidocs">
	  Options FollowSymlinks
	  AllowOverride None
	  Require all granted
	</Directory>
</IfModule>

Now we can access our documentation via http://www.g1.sdi.mi.hdm-stuttgart.de/mk381/

curl http://www.g1.sdi.mi.hdm-stuttgart.de/mk381/
<a href="https://sdi.knerrich.com"> SDI DOCS </a>