简体   繁体   中英

Trouble setting up SSL to work with MAMP 5.3

After adding a self-signed SSL certificate, I am unable to get my Drupal site to work on localhost.

I have attempted various proposed solutions that I have found online but none have gotten me past a 400 error at https://localhost/

I have uncommented the following in httpd.conf:

LoadModule ssl_module modules/mod_ssl.so

I have Listen set to port 80 in this same file. When I set it to the SSL channel, 443, Apache does not load.

In my httpd-ssl.conf file:

I have set the paths for my server.crt and server.key files correctly.

I have enabled SSLEngine

    <VirtualHost *:443>

    #   General setup for the virtual host
    DocumentRoot "/Applications/MAMP/Library/htdocs"
    ServerName https://127.0.0.1:443
    ServerAdmin you@example.com
    ErrorLog "/Applications/MAMP/Library/logs/error_log"
    TransferLog "/Applications/MAMP/Library/logs/access_log"

I have tried a variety of possibilities for the ServerName. The one above along with localhost:443 both lead to 400 errors.

I have Listen set to 443 here. Setting to 80 so it matches the httpd.conf file leads to the same result described above...not able to connect Apache.

Here is my error log for Apache:

Digest: generating secret for digest authentication ... Digest: done FastCGI: process manager initialized (pid 1845) Apache/2.2.34 (Unix) mod_wsgi/3.5 Python/2.7.13 PHP/7.2.14 mod_ssl/2.2.34 OpenSSL/1.0.2o DAV/2 mod_fastcgi/mod_fastcgi-SNAP-0910052141 mod_perl/2.0.9 Perl/v5.24.0 configured -- resuming normal operations [error] [client 127.0.0.1] client denied by server configuration: /Applications/MAMP/htdocs/.DS_Store, referer: http://localhost/MAMP/?language=English [error] [client 127.0.0.1] client denied by server configuration: /Applications/MAMP/htdocs/.DS_Store, referer: http://localhost/MAMP/?language=English [notice] caught SIGTERM, shutting down

I don't know enough about Apache server configuration to figure out, when I start MAMP to be able to navigate with HTTPS to my Drupal project, which is in the HTDOCs file and make it run without the 400 error.

我通过在虚拟主机部分中注释掉上面的“文档根”来解决了这个问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM