Don’t select a website in IIS, just add the domain to certificate directly.
In the authorization, set the challenge type to http-01 and set the directory as the base of the web site in Apache. Tick to perform the challenge response checks and remove the tick for the application auto config.
Set the deployment to Certificate Store Only or No Deployment, as we don’t want it going anywhere in IIS.
Save the script above to a ps1 file and set the path and certificate file names as required. I keep a seperate folder for each site, but that’s not a requirement. I updated the script to use the full page to the openssl.exe file. Add the script to the Post-request PS Script option.
That’s it, the certificate should download and save out as crt and key files, which you can then set using the SSL settings in your apache configuration.
I run IIS and Apache on the same server on different ports and domains, with one configuration for IIS and one for Apache and it works.