Set Up HTTP Server

This guide will walk you through configuring your HTTP server. It will serve:

  • the installation source for your desired OS,
  • the configuration files for your physical hosts, and
  • the initial authorized SSH keys for your physical hosts.

For the above you will use separate paths, namely /iso, /conf, and /files, with directory listing enabled.

Note

This guide will operate on your bootstrap host and use lighttpd as an HTTP server. If you already have an HTTP server, configure it accordingly.

What You’ll Need

Procedure

  1. Go to your bootstrap host and install the necessary packages, if you don’t have them already on your system:

    root@host:~# apt-get update root@host:~# apt-get install -y lighttpd rsync
  2. Configure lighttpd.

    1. Enable directory listing:

      root@host:~# lighty-enable-mod dir-listing Enabling dir-listing: ok Run "service lighttpd force-reload" to enable changes
    1. Enable access logs:

      root@host:~# lighty-enable-mod accesslog Enabling accesslog: ok Run "service lighttpd force-reload" to enable changes
    2. Reload the service:

      root@host:~# service lighttpd force-reload
  3. Copy the installation source under your site. Choose one of the following options based on your desired OS.

    root@host:~# mkdir -p /var/www/html/iso/Rocky8 root@host:~# rsync -avP /mnt/iso/ /var/www/html/iso/Rocky8
  4. Prepare for serving the OS configuration files under /conf:

    root@host:~# mkdir -p /var/www/html/conf

    Note

    You will use host-specific configuration files under this directory later on.

  5. Prepare for serving the initial authorized SSH keys for your physical hosts. Copy your public SSH key you created before:

    root@host:~# mkdir -p /var/www/html/files/initial_authorized_keys root@host:~# cp ~/.ssh/id_rsa.pub /var/www/html/files/initial_authorized_keys

    Note

    Extend initial_authorized_keys with any additional SSH keys. These keys will be used for initial SSH access to your hosts and may be replaced afterwards.

Verify

  1. Go to your bootstrap host and install the necessary packages, if you don’t have them already on your system:

    root@host:~# apt-get update root@host:~# apt-get install -y lynx
  2. Verify that your installation source is available. Choose based on your desired OS.

    root@host:~# lynx -dump -hiddenlinks=listonly --listonly localhost/iso/Rocky8 References 1. http://localhost/iso/ 2. http://localhost/iso/Rocky8/BaseOS/ ...
  3. Verify that your OS configuration files are available. Choose based on your desired OS.

    root@host:~# lynx -dump -hiddenlinks=listonly --listonly localhost/conf References 1. http://localhost/
  4. Verify that your initial authorized SSH keys are available:

    root@host:~# lynx -dump -hiddenlinks=listonly --listonly localhost/files References 1. http://localhost/ 2. http://localhost/files/initial_authorized_keys

Summary

You have successfully configured your HTTP server.

What’s Next

The next step is to configure your DHCP server.