4.6 Apache Web Server Configuration

Apache2 listens for requests on all interfaces by default as defined by the following directive in /etc/apache2/listen.conf:

Listen 80

If only a particular interface is to be used, its IP address must be added to this directive. For example:

Listen 10.10.10.101:80

Apache2 should be configured for automatic service start:

systemctl enable apache2

In the next step the directories that will be accessed over HTTP and their URLs need to be configured. Apache2 has a default directive which ensures that all files located in the directory /etc/apache2/conf.d and suffixed with .conf will be read and processed every time Apache2 is loaded.

We are using the file inst_server.conf to provide all configuration directives for the Consulting Installation Framework.

# httpd configuration for the Consulting Installation Framework AutoYaST
# server included by httpd.conf

        Alias /oes2018sp2               /data/install/oes2018/sp2/cd1
        Alias /sles12sp5                /data/install/sles12/sp5/cd1
        Alias /sles15sp1                /data/install/sles15/sp1/cd1
        Alias /sles15sp1_Packages       /data/install/sles15/sp1/Packages

        Alias /install                  /data/install
        Alias /isos                     /data/isos

        Alias /autoyast                 /data/autoyast
        Alias /configs                  /data/autoyast/configs
        Alias /files                    /data/autoyast/files
        Alias /info                     /data/autoyast/info
        Alias /lib                      /data/autoyast/lib
        Alias /scripts                  /data/autoyast/scripts
        Alias /upgrade                  /data/autoyast/upgrade
        Alias /xml                      /data/autoyast/xml

        <Directory "/data/autoyast">
        # +FollowSymLinks does work in Directory but it does not work
        #  in DirectoryMatch!!!
        #  (https://httpd.apache.org/docs/2.4/mod/core.html#options)

            Options +Indexes +FollowSymLinks
            IndexOptions +NameWidth=*
            Require all granted
        </Directory>

        <DirectoryMatch "^/data/(install|isos).*">
            Options +Indexes
            IndexOptions +NameWidth=*
            Require all granted
        </DirectoryMatch>

The various Alias directives are used to map descriptive URLs to lengthy file system paths allowing for easier access to the different parts of the installation framework.

There are two different methods to grant access to these directories. The Directory directive grants access to the specified directory and its sub-directories with support for symbolic links. This approach has been used to grant access to the autoyast branch of the file system structure used by the CIF. Access to another part of the file system with symbolic link support would require a separate Directory directive with the same options.

The DirectoryMatch directive uses a regular expression to match multiple directories but does not support symbolic links. It has been used to grant access to the directory where the ISO files are stored and to the directory where they are loop-mounted.