前提・実現したいこと
最終的にはMACのMAMPで作ったローカル環境をXサーバー上の
WordPress本番環境に移行し、適宜、作成した記事などをローカル環境で
テストしつつサイトを運営していきたいと考えています。
MAMPのSSL対応化については参考サイトを見てhttpsに対応したMAMPのサイトhttps://localhost/MAMP/?language=Japaneseに飛べるのでできているのではないかと思います。
しかし、バーチャルホストで設定したhttps://localhost:●●●(※●=httpd-vhosts.confで宣言したポート番号)で接続すると見れません。単なるlocalhost:●●●で入力した場合はインストールしたWordPressのローカルサイトがブラウザ上で表示はされますが。
<質問>
①MAMPのSSL対応化というのはlocalhost:●●●の頭にhttps://が付いてローカル環境でWordPressの記事の編集等を行う際にもSSLに対応している状態での動作テストが可能という意味ではないのでしょうか?
②ローカル環境のWordPressで管理画面から確認する「WordPressアドレス」と「サイトアドレス」がともに現在http://〜となっていますが、これをlocalhost/phpmyadminからhttps://〜に変更すれば、SSlで表示できるという認識で合っていますでしょうか?
③そもそも、ブラウザにlocalhostとだけ入力した際に読み込みに行くディレクトリはどこなのでしょうか?先ほどあげたlocalhost:●●●(ポート番号)であれば/Applications/MAMP/htdocs/の直下を読みに行っているので動作テスト用のindex.phpなどを置いても表示はされます。ポート番号を指定しないlocalhostが読みにいくディレクトリを調べる方法をお教えいただければありがたいです。
<追記>
■(1)httpd-vhosts.confでの追記内容
NameVirtualHost *:80 ~中略~ #site01用(ポート49152を使用) Listen 49152 <VirtualHost *:49152> DocumentRoot "//Applications/MAMP/htdocs/テストフォルダ01" ←コピペミス <Directory "/Applications/MAMP/htdocs/テストフォルダ01"> AllowOverride All </Directory> ErrorLog "logs/site1-error_log" CustomLog "logs/site1-access_log" common </VirtualHost>
■(2)httpd-ssl.conf(SSL化に設定した箇所)
※これは不要だとは思いましたが確かにSSLではデフォルトはポート443のようでした。
<VirtualHost _default_:443> # General setup for the virtual host DocumentRoot "/Applications/MAMP/htdocs/テストフォルダ01" ServerName localhost ServerAdmin you@example.com ErrorLog "/Applications/MAMP/Library/logs/error_log" TransferLog "/Applications/MAMP/Library/logs/access_log" # SSL Engine Switch: # Enable/Disable SSL for this virtual host. SSLEngine on # SSL Cipher Suite: # List the ciphers that the client is permitted to negotiate. # See the mod_ssl documentation for a complete list. # Uncomment the next line if Apache should not accept SSLv3 connections, to learn more google for "POODLE SSLv3". # SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:-SSLv3:+EXP:+eNULL # Comment the next line (and uncomment the line above) if Apache should not accept SSLv3 connections, to learn more google for "POODLE SSLv3". SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL # Server Certificate: # Point SSLCertificateFile at a PEM encoded certificate. If # the certificate is encrypted, then you will be prompted for a # pass phrase. Note that a kill -HUP will prompt again. Keep # in mind that if you have both an RSA and a DSA certificate you # can configure both in parallel (to also allow the use of DSA # ciphers, etc.) SSLCertificateFile "/Applications//MAMP/conf/apache/keys/server.crt" #SSLCertificateFile "/Applications/MAMP/conf/apache/server-dsa.crt" # Server Private Key: # If the key is not combined with the certificate, use this # directive to point at the key file. Keep in mind that if # you've both a RSA and a DSA private key you can configure # both in parallel (to also allow the use of DSA ciphers, etc.) SSLCertificateKeyFile "/Applications/MAMP/conf/apache/keys/server.key" #SSLCertificateKeyFile "/Applications/MAMP/conf/apache/server-dsa.key" # Server Certificate Chain: # Point SSLCertificateChainFile at a file containing the # concatenation of PEM encoded CA certificates which form the # certificate chain for the server certificate. Alternatively # the referenced file can be the same as SSLCertificateFile # when the CA certificates are directly appended to the server # certificate for convinience. #SSLCertificateChainFile "/Applications/MAMP/conf/apache/server-ca.crt"
補足情報(FW/ツールのバージョンなど)
macOS High Sierra(ver10.13.1)
MAMP ver5.3
→ポート番号設定 Apache:80、MySQL:3306
Php(Apache)ver7.3.1
MySQL ver5.7.25

回答1件
あなたの回答
tips
プレビュー