1
0

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.

[mac]XAMPPのApacheでSSLの有効無効を切り替える

Last updated at Posted at 2019-08-24

はじめに

macでhttpsを有効にしたかったのですが、xamppでは既にデフォルトでhttpsが使えたので
どの値をいじれば有効無効が切り替えられるか確認してみました。

環境

macOS Mojave 10.14.5
XAMPP 5.6.40-1
phpver 5.6.38

有効無効の切り替え

まずは以下の記事を参考にphp.iniの「extension=php_openssl.dll」が
どうなっているか確認しました。
https://qiita.com/sutara79/items/21a068494bc3a08a4803

php.ini
;extension=php_openssl.dll

あれ?コメントアウトされてるのにhttpsが動いてます。
macだとこの記述必要ないのでしょうか?

とりあえずphpのドキュメントでphp.iniのopensslについて調べてみます。
https://www.php.net/manual/ja/openssl.installation.php
phpのコンパイルが必要と。。。
でも私の環境はxamppなので、動作からすると既にopensslありきでコンパイル済みってことでしょうか?インストールと設定のところにもphp_openssl.dllについてこうしてくださいな記載は見つけられませんでした。。。


追記

php.iniを見直してたらこんな記載があったのを発見。

php.ini
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

省略

;extension=php_openssl.dll

dllはwindows用の拡張機能を使用するときに必要なもののようですね。
つまりmacではdllは不要ってことですね。
しっかり書いてありました。


次にapacheの公式サイトを確認しました。
https://httpd.apache.org/docs/2.4/ssl/

説明を読むと「mod_ssl」がopensslライブラリを使用する為のインターフェースなようなので、xampp内のフォルダを「mod_ssl」で全検索をかけたところ、以下がヒットしました。

httpd.conf
LoadModule ssl_module modules/mod_ssl.so

既にLoadModuleでロード済みなので有効化されているということですね。
これをコメントアウトすれば無効にすることができるということですね。
コメントアウトは#。

httpd.conf
# LoadModule ssl_module modules/mod_ssl.so

とりあえず、これで有効無効が切り替えられそうです。

1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?