環境
vagrant
centOS6.7
apache
ansible-role-apache
こちらのroleでアパッチを管理しているので出来ればansibleでSSL対応をしたいです。
site:yml
roles: - name: geerlingguy.mysql - name: geerlingguy.apache vars: apache_vhosts: - servername: "local.dev" documentroot: "/var/www/takeo_ec/home" apache_vhosts_ssl: - servername: "local.dev" documentroot: "/var/www/takeo_ec/ssl/home" certificate_file: "/etc/pki/tls/certs/localhost.crt" certificate_key_file: "/etc/pki/tls/private/localhost.key" certificate_chain_file: "/etc/pki/tls/certs/ca-bundle.crt" tags: - apache - name: geerlingguy.php
こちらでplaybookを実行するとvhosts.confにも以下のように反映されていました。
<VirtualHost *:80> ServerName local.dev DocumentRoot /var/www/example/home <Directory "/var/www/example/home"> AllowOverride All Options -Indexes +FollowSymLinks Order allow,deny Allow from all </Directory> </VirtualHost> <VirtualHost *:443> ServerName local.dev DocumentRoot /var/www/example/ssl/home SSLEngine on SSLCipherSuite AES256+EECDH:AES256+EDH SSLProtocol All -SSLv2 -SSLv3 SSLHonorCipherOrder On SSLCertificateFile /etc/pki/tls/certs/localhost.crt SSLCertificateKeyFile /etc/pki/tls/private/localhost.key SSLCertificateChainFile /etc/pki/tls/certs/ca-bundle.crt <Directory "/var/www/example/ssl/home"> AllowOverride All Options -Indexes +FollowSymLinks Order allow,deny Allow from all </Directory> </VirtualHost> ただ https://example.devにアクセスしても Apache 2 Test Pageが表示されてしまいます。 本当は/var/www/example/ssl/home にアクセスして欲しいです。 (example.devはvagrantで設定したURLです。) この他 `openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout example.key -out example.crt` で鍵を作って * /etc/pki/tls/private/localhost.key * /etc/pki/tls/certs/localhost.crt こちらに置き換えたりもしましたが変化ありませんでした。 足りない情報などあれが補足いたします。 ご教授いただければ幸いです。 よろしくお願いいたします。
あなたの回答
tips
プレビュー