3.3 The /srv/www/htdocs Structure for SLE 11

The path to the directory containing the mirror is set by the MirrorTo option in the /etc/smt.conf configuration file. For more information about /etc/smt.conf, see Section 7.2.1, /etc/smt.conf. If the MirrorTo option is not set to the Apache htdocs directory /srv/www/htdocs/, the following links need to be created. In case the directories already exist, they need to be removed prior to creating the link (the data from that directories will be lost!). MIRRORTO has to be replaced with the path defined with MirrorTo:

  • /srv/www/htdocs/repo/$RCE should point to MIRRORTO/repo/$RCE/

  • /srv/www/htdocs/repo/RPMMD to MIRRORTO/repo/RPMMD/

  • /srv/www/htdocs/repo/testing to MIRRORTO/repo/testing/ and

  • /srv/www/htdocs/repo/full to MIRRORTO/repo/full/

The directory specified by the option MirrorTo and the subdirectories listed above must exist. Files and directories in /MirrorTo as well as the links need to belong to the user smt and the group www.

For example, if the MirrorTo is set to /mirror/data:

l /srv/www/htdocs/repo/
total 16
lrwxrwxrwx 1 smt  www    22 Feb  9 14:23 $RCE -> /mirror/data/repo/$RCE/
drwxr-xr-x 4 smt  www  4096 Feb  9 14:23 ./
drwxr-xr-x 4 root root 4096 Feb  8 15:44 ../
lrwxrwxrwx 1 smt  www    23 Feb  9 14:23 RPMMD -> /mirror/data/repo/RPMMD/
lrwxrwxrwx 1 smt  www    22 Feb  9 14:23 full -> /mirror/data/repo/full/
drwxr-xr-x 2 smt  www  4096 Feb  8 11:12 keys/
lrwxrwxrwx 1 smt  www    25 Feb  9 14:23 testing -> /mirror/data/repo/testing/
drwxr-xr-x 2 smt  www  4096 Feb  8 14:14 tools/

The links can be created using the ln -s commands. For example:

cd /srv/www/htdocs/repo/
for LINK in \$RCE RPMMD full testing; do
  ln -s /mirror/data/repo/${LINK}/ && chown -h smt.www ${LINK}

IMPORTANT: The /srv/www/htdocs/repo Directory

The /srv/www/htdocs/repo directory must not be a symbolic link.

IMPORTANT: Apache and Symbolic Links

By default Apache on SUSE Linux Enterprise is configured to not follow symbolic links. To enable symblic links for /srv/www/htdocs/repo/ add the following snippet to /etc/apache2/default-server.conf (or the respetive virtual host configurtion in case you are running SMT on a virtual host):

<Directory "/srv/www/htdocs/repo">
  Options FollowSymLinks

After having made the change, test the syntax and reload the Apache configuration files to activate the change:

rcapache2 configtest && rcapache2 reload