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¶
- A bootstrap host.
- The OS installation source mounted under
/mnt/iso
. - An SSH key.
Procedure¶
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 rsyncConfigure lighttpd.
Enable directory listing:
root@host:~# lighty-enable-mod dir-listing Enabling dir-listing: ok Run "service lighttpd force-reload" to enable changes
Enable access logs:
root@host:~# lighty-enable-mod accesslog Enabling accesslog: ok Run "service lighttpd force-reload" to enable changesReload the service:
root@host:~# service lighttpd force-reload
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/Rocky8Prepare for serving the OS configuration files under
/conf
:root@host:~# mkdir -p /var/www/html/confNote
You will use host-specific configuration files under this directory later on.
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_keysNote
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¶
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 lynxVerify 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/ ...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/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.