diff -up smeserver-bandwidthd-2.0.1.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86bandwidthd.requireSSL smeserver-bandwidthd-2.0.1.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86bandwidthd --- smeserver-bandwidthd-2.0.1.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86bandwidthd.requireSSL 2013-12-30 13:03:28.000000000 -0500 +++ smeserver-bandwidthd-2.0.1.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/86bandwidthd 2013-12-30 13:06:39.000000000 -0500 @@ -60,6 +60,7 @@ $OUT .= "\n"; $OUT .= " AddType application/x-httpd-php .php .conf\n"; $OUT .= " php_admin_value open_basedir /var/www/bandwidthd/htdocs\n"; + $OUT .= " SSLRequireSSL\n"; $OUT .= " Options None\n"; $OUT .= " order deny,allow\n"; $OUT .= " deny from all\n"; @@ -94,6 +95,7 @@ $OUT .= "\n"; $OUT .= " AddType application/x-httpd-php .php .conf\n"; $OUT .= " php_admin_value open_basedir /var/www/bandwidthd/phphtdocs\n"; + $OUT .= " SSLRequireSSL\n"; $OUT .= " Options None\n"; $OUT .= " order deny,allow\n"; $OUT .= " deny from all\n"; diff -up smeserver-bandwidthd-2.0.1.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/80bandwidthd.requireSSL smeserver-bandwidthd-2.0.1.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/80bandwidthd --- smeserver-bandwidthd-2.0.1.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/80bandwidthd.requireSSL 2013-12-30 13:13:00.000000000 -0500 +++ smeserver-bandwidthd-2.0.1.1/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/80bandwidthd 2013-12-30 13:17:41.000000000 -0500 @@ -0,0 +1,16 @@ +{ + my $status = $bandwidthd{'status'} || "disabled"; + return " # bandwidthd is disabled in this VirtualHost" + unless $status eq 'enabled'; + $haveSSL = (exists ${modSSL}{status} and ${modSSL}{status} eq "enabled") ? 'yes' : 'no'; + +if (($port ne "443") && ($haveSSL eq 'yes') ) + { + $OUT .= "RewriteEngine on\n"; + $OUT .= " RewriteRule ^/bandwidthd(/.*|\$) https://%{HTTP_HOST}/bandwidthd\$1 [L,R]\n"; + $OUT .= " RewriteRule ^/bandwidthd-php(/.*|\$) https://%{HTTP_HOST}/bandwidthd-php\$1 [L,R]\n"; + $OUT .= " RewriteRule ^/bandwidthd-static(/.*|\$) https://%{HTTP_HOST}/bandwidthd-static\$1 [L,R]\n"; + if (exists $bandwidthd{'URL'}) + { $OUT .= " RewriteRule ^/$bandwidthd{'URL'} https://%{HTTP_HOST}/$bandwidthd{'URL'}\$1 [L,R]\n"; } + } +}