The configuration file location is /etc/apache2/sites-available/default-ssl.conf for Ubuntu. For the SSLCertificateKeyFile setting, replace the path to the private key with the URI to the private key inside the HSM e.g. SSLCertificateKeyFile "pkcs11:token=CryptoServer%20PKCS11%20Token;object=private_key_label;pin-value=0000" (see https://datatracker.ietf.org/doc/html/rfc7512 for the URI format details).