Skip to content

Instantly share code, notes, and snippets.

@m0k1
Last active February 24, 2016 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save m0k1/8934345d380a470e3c66 to your computer and use it in GitHub Desktop.
Save m0k1/8934345d380a470e3c66 to your computer and use it in GitHub Desktop.
Let's Encrypt command generator for Sentora Gist Available on https://gist.githack.com/m0k1/8934345d380a470e3c66/raw/SentoraLetsEncrypt.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="https://code.jquery.com/jquery-1.9.1.js"></script>
<title>LetsEcryptSentora</title>
<script type='text/javascript'>
//<![CDATA[
$(window).load(function()
{
var log_base = '/var/log/httpd/';
$('#domain').bind('input', function()
{
//Add in the directory value automagically
$('#directory').val($('#domain').val());
regenerate();
});
$('#directory').bind('input', function()
{
regenerate();
});
$('#user').bind('input', function()
{
regenerate();
});
$('#directory_base').bind('input', function()
{
regenerate();
});
$('#log_directory_base').bind('input', function()
{
regenerate();
});
function regenerate()
{
var template = '# Redirect Permanent / https://' + $('#domain').val() + '/\n' + '# when un commented, for some reason the above causes a\n' + '# redirect loop, this makes me sad\n' + '</VirtualHost>\n' + '\n' + '# DOMAIN: ' + $('#domain').val() + ':443\n' + '<VirtualHost *:443>\n' + ' ServerName ' + $('#domain').val() + '\n' + ' ServerAlias www.' + $('#domain').val() + '\n' + ' ServerAdmin webmaster@' + $('#domain').val() + '\n' + '\n' + ' DocumentRoot "/var/sentora/hostdata/' + $('#user').val() + '/public_html/' + $('#directory').val() + '"\n' + ' php_admin_value open_basedir "/var/sentora/hostdata/' + $('#user').val() + '/public_html/' + $('#directory').val() + ':/var/sentora/temp/"\n' + ' php_admin_value suhosin.executor.func.blacklist "passthru, show_source, shell_exec, system, pcntl_exec, popen, pclose, proc_open, proc_nice, proc_terminate, proc_get_status, proc_close, leak, apache_child_terminate, posix_kill, posix_mkfifo, posix_setpgid, posix_setsid, posix_setuid, escapeshellcmd, escapeshellarg, exec"\n' + ' ErrorLog "/var/sentora/logs/domains/' + $('#user').val() + '/' + $('#domain').val() + '-error.log"\n' + ' CustomLog "/var/sentora/logs/domains/' + $('#user').val() + '/' + $('#domain').val() + '-access.log" combined\n' + ' CustomLog "/var/sentora/logs/domains/' + $('#user').val() + '/' + $('#domain').val() + '.log" common\n' + ' AddType application/x-httpd-php .php3 .php\n' + ' <Directory "/var/sentora/hostdata/' + $('#user').val() + '/public_html/' + $('#directory').val() + '">\n' + ' Options +FollowSymLinks -Indexes\n' + ' AllowOverride All\n' + ' Require all granted\n' + ' </Directory>\n' + ' ErrorDocument 403 /_errorpages/403.html\n' + ' ErrorDocument 500 /_errorpages/500.html\n' + ' ErrorDocument 510 /_errorpages/510.html\n' + ' ErrorDocument 404 /_errorpages/404.html\n' + ' DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm\n' + '\n' + ' SSLEngine on\n' + ' SSLProtocol all -SSLv2 -SSLv3\n' + ' SSLCertificateFile /etc/letsencrypt/live/' + $('#domain').val() + '/cert.pem\n' + ' SSLCertificateKeyFile /etc/letsencrypt/live/' + $('#domain').val() + '/privkey.pem\n' + ' SSLCertificateChainFile /etc/letsencrypt/live/' + $('#domain').val() + '/fullchain.pem\n';
$('#vhost').val(template);
var template = './letsencrypt-auto certonly --webroot -w /var/sentora/hostdata/' + $('#user').val() + '/public_html/' + $('#directory').val() + ' -d ' + $('#domain').val();
$('#lets').val(template);
}
//On page load
$(document).ready(function()
{
regenerate();
})
}); //]]>
</script>
</head>
<body>
<h1>Let's Encrypt command generator for Sentora</h1>
<p> Enter required informations to generate the rest of the VirtualHost file for SSL Sites. </p>
<ul>
<li>
</p>Domain: <input type="text" name="domain" value="domain.com" id="domain" onClick="this.select();"> </li>
<li>Directory: <input type="text" name="directory" value="domain_com" id="directory" onClick="this.select();"> </li>
<li>User base: <input type="text" name="user" value="Sentora Login name" id="user" onClick="this.select();"> </li>
</ul>
<h2>
lets encrypt command:
</h2> <textarea rows="1" cols="180" id="lets" onClick="this.select();"></textarea>
<h2>
vhost:
</h2> <textarea rows="35" cols="180" id="vhost" onClick="this.select();"></textarea> </body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment