This is an old revision of the document!
: Explain the page/service.
First, install a base installation of Photon OS with the following changes:
Caddy
Setup minimal installed profile of PhotonOS
OVA with virtual hardware v15
from https://github.com/vmware/photon/wiki/Downloading-Photon-OSCreate/Register VM
:Deploy a virtual machine from an OVF or OVA file
Target Datastore
Power on automatically
Finish
Host
> Manage
> System
> Autostart
:Enable
Start earlier
and Start later
to set the desired orderVirtual Machines
on the sidebar and click on the current VMActions
> Edit Settings
:Add other device
> NVMe controller
Hard Disk 1
> Controller location
> NVMe controller 0
Edit Settings
SCSI controller 0
Hardware Configuration
> Network adapter 1
) and desired hostname# Login with root details from the VM note # Follow instructions to set new password # Remove docker related packages if not needed to save space and faster updates tdnf erase containerd docker docker-cli docker-engine # Update packages: tdnf upgrade tdnf clean all # Disable password expiry: chage -M -1 root # Set new hostname: hostnamectl set-hostname <hostname-as-set-in-router> # Set the timezone to Perth ln -sf /usr/share/zoneinfo/Australia/Perth /etc/localtime # Change the SSH port to 50001: sed -i "s/#Port 22/Port 50001/" /etc/ssh/sshd_config sed -i "s/-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT/-A INPUT -p tcp -m tcp --dport 50001 -m state --state NEW -j ACCEPT/" /etc/systemd/scripts/ip4save exit
Minimal installed profile of PhotonOS User: root Ports: 50001/tcp SSH
Base Install
http,https
to the IP of the VM# FIXME: Allow http/https through iptables? printf "-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT" >> /etc/systemd/scripts/ip4save printf "-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT" >> /etc/systemd/scripts/ip4save # Download Caddy tdnf install tar mkdir /tmp/caddy cd /tmp/caddy # Copy the link for the "caddy_2.x.x_linux_amd64.tar.gz" file from https://github.com/caddyserver/caddy/releases/latest curl -OL "<DownloadLink>" tar -xzf <DownloadedFile> mv caddy /usr/bin/ cd / rm -r /tmp/caddy # Add caddy group/user groupadd --system caddy useradd --system \ --gid caddy \ --create-home \ --home-dir /var/lib/caddy \ --shell /usr/sbin/nologin \ --comment "Caddy web server" \ caddy # Setup startup cd /etc/systemd/system/ curl -OL "https://raw.githubusercontent.com/caddyserver/dist/master/init/caddy.service" systemctl daemon-reload systemctl enable caddy # Config file mkdir /etc/caddy chmod 755 /etc/caddy cd /etc/caddy # FIXME: Download Caddyfile chmod 644 Caddyfile systemctl start caddy # View the Caddy log journalctl -u caddy # Use updated config file systemctl reload caddy
Configured
tdnf upgrade
tdnf clean all
reboot # If desired/needed
{{page>esxi:caddy_server#Update}}
# Copy the link for the "caddy_2.x.x_linux_amd64.tar.gz" file from https://github.com/caddyserver/caddy/releases/latest curl -OL "<DownloadLink>" tar -xzf <DownloadedFile> mv caddy /usr/bin/ cd / rm -r /tmp/caddy