Apache2 cookbook SSL setup

Hi,

I am trying setup apache2 with SSL using the apache2 cookbook. Though I can setup default fairly easily, I am not getting how to pass on the port 443 to the config.

include_recipe 'apache2'
include_recipe 'apache2::mod_ssl'
include_recipe 'apache2::mod_authz_default'
include_recipe 'apache2::mod_authz_host'

node.default['apache']['listen'] = ["*:443"]


web_app 'mytestingsite' do
	template 'web_app.conf.erb'
    server_name node['hostname']
end

This is the simple recipe I am trying to create.

Should a separate template has to be created for SSL ?

Thanks and Regards,

A

Hi, I made some progress,

include_recipe "apache2"
include_recipe "apache2::mod_ssl"
include_recipe 'apache2::mod_authz_core'
include_recipe 'apache2::mod_authz_host'

node.default['apache']['myport'] = "443"


web_app 'mytestingsite' do
	template 'web_app.conf.erb'
    server_name node['hostname']
    listen_ports node['apache']['myport']
end

In the template

VirtualHost *:<%= node.default['apache']['myport'] %>>

That did set the port to 443

[root@centos3 sites-available]# cat mytestingsite.conf 
<VirtualHost *:443>
  ServerName centos3
  DocumentRoot 

  <Directory >
    Options FollowSymLinks
    AllowOverride None
    Require all granted
  </Directory>

  <Directory />
    Options FollowSymLinks
    AllowOverride None
  </Directory>

  <Location /server-status>
    SetHandler server-status

    Require local

  </Location>

Is this the right way ?

Regards,

A