15
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MAMPでのSSL設定 ローカル開発環境でもhttpsでアクセスできるようにする

Last updated at Posted at 2014-11-30

※バージョンによって多少パス等違うかも

 
/Applications/MAMP/conf/apache/httpd.conf

コメントアウトしてhttpd-ssl.confを読み込む

httpd.conf
# Secure (SSL/TLS) connections
Include /Applications/MAMP/conf/apache/extra/httpd-ssl.conf

 

/Applications/MAMP/conf/apache/extra/httpd-ssl.conf

httpd-ssl.conf
SSLCertificateFile "/Applications/MAMP/conf/apache/ssl/localhost.crt"

SSLCertificateKeyFile "/Applications/MAMP/conf/apache/ssl/localhost.key"

 

/Applications/MAMP/conf/apache/extra/httpd-vhosts.conf

httpd-vhosts.conf
NameVirtualHost *:443

<VirtualHost *:443>
    ServerAdmin admin@localhost
    DocumentRoot "/Documents/localhost"
    ServerName localhost

    SSLEngine on
    SSLCertificateFile /Applications/MAMP/conf/apache/ssl/localhost.crt
    SSLCertificateKeyFile /Applications/MAMP/conf/apache/ssl/localhost.key

</VirtualHost>

 

###うまくいかない時に

MAMPのコンパネで起動すると何が原因かわからないので、
下記コマンドでエラーが有る場合わかりやすい(sudo必要)

/Applications/MAMP/Library/bin/apachectl start
/Applications/MAMP/Library/bin/apachectl stop
15
20
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
15
20

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?