MacOS(Apache)에서 가상 호스트용 SSL 받기

MacOS(Apache)에서 가상 호스트용 SSL 받기

Apache를 실행하는 Mac OS Big Sur 호스트가 있습니다. 여러 가상 호스트를 구성했습니다. 이제 SSL을 활성화하여 다음을 사용하여 로컬 사이트에 액세스하고 싶습니다.https://example.local.

저는 이 문제를 3시간 넘게 보고 있는데 튜토리얼이 하나도 작동하지 않는 것 같습니다.

이것예를 들어 튜토리얼: 2단계에서는 다음 오류가 발생합니다.

unable to load Private Key
4781444780:error:09FFF06C:PEM routines:CRYPTO_internal:no start line:/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/libressl/libressl-56.60.2/libressl-2.8/crypto/pem/pem_lib.c:684:Expecting: ANY PRIVATE KEY

server.key는 디렉토리에 있습니다.

나도 시도했다Certbot을 사용하는 이 튜토리얼. 하지만 Certbot에는 공개적으로 액세스 가능한 도메인이 필요합니다. 내 로컬 가상 호스트는 물론 공개되지 않습니다.

내가 시도하고 얻은 또 다른 명령여기이다:

openssl req -x509 -out localhost.crt -keyout localhost.key \
  -newkey rsa:2048 -nodes -sha256 \
  -subj '/CN=example.local' -extensions EXT -config <( \
   printf "[dn]\nCN=example.local\n[req]\ndistinguished_name = dn\n[EXT]\nsubjectAltName=DNS:example.local\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth")

다음과 같이 vhost 파일을 구성했습니다.

<VirtualHost *:443>
    DocumentRoot "/Users/Niel/Sites/example/"
    ServerName example.local

    SSLEngine on
    SSLCertificateFile "/Users/niel/.config/letsencrypt/localhost.crt"
    SSLCertificateKeyFile "/Users/niel/.config/letsencrypt/localhost.key"

    <Directory "/Users/Niel/Sites/example/">
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

다음과 같은 오류가 발생합니다 /var/log/apache2/error_log.

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
[Tue Dec 29 00:15:13.939507 2020] [ssl:warn] [pid 68986] AH01873: Init: Session Cache is not configured [hint: SSLSessionCache]
PHP Warning:  PHP Startup: Unable to load dynamic library 'zip.so' (tried: /usr/lib/php/extensions/no-debug-non-zts-20180731/zip.so (dlopen(/usr/lib/php/extensions/no-debug-non-zts-20180731/zip.so, 9): image not found), /usr/lib/php/extensions/no-debug-non-zts-20180731/zip.so.so (dlopen(/usr/lib/php/extensions/no-debug-non-zts-20180731/zip.so.so, 9): image not found)) in Unknown on line 0
[Tue Dec 29 00:15:14.145551 2020] [mpm_prefork:notice] [pid 68986] AH00163: Apache/2.4.46 (Unix) LibreSSL/2.8.3 PHP/7.3.24-(to be removed in future macOS) configured -- resuming normal operations
[Tue Dec 29 00:15:14.145632 2020] [core:notice] [pid 68986] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Tue Dec 29 00:19:41.205429 2020] [authz_core:error] [pid 69057] [client 127.0.0.1:58915] AH01630: client denied by server configuration: /Users/Niel/Websites

어쨌든, 나는 수천 가지를 시도했지만 아무것도 효과가 없었습니다. MacOS에서 Apache를 사용하여 가상 호스트에서 SSL을 얻으려면 어떻게 해야 합니까?

관련 정보