Skip to content

Instantly share code, notes, and snippets.

@mansourcodes
Created November 28, 2016 20:40
Show Gist options
  • Save mansourcodes/f051a665dd434fcc902e018912712ec1 to your computer and use it in GitHub Desktop.
Save mansourcodes/f051a665dd434fcc902e018912712ec1 to your computer and use it in GitHub Desktop.
# Install OpenSSL
apt-get install openssl
# Create a directory for your certificates
mkdir /etc/apache2/ssl/
# Create the certificates
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -out /etc/apache2/ssl/Sentora.crt -keyout /etc/apache2/ssl/Sentora.key
# Fill in all the information that is needed when prompted. (Makee sure you put your domain url in Common Name)
Country Name (2 letter code) [AU]: GB
State or Province Name (full name) [Some-State]: Lancashire
Locality Name (eg, city) []: Bolton
Organization Name (eg, company) [Internet Widgits Pty Ltd]: MyCompany Ltd
Organizational Unit Name (eg, section) []: IT
Common Name (eg, YOUR name) []: mydomain.com
Email Address []: [email protected]
# TIP: Before actually making any changes to your sentora Configuration I recommend you take a backup copy of /etc/zpanel/configs/apache/httpd-vhosts.conf file, this way if after the changes your Apache server fails to start you can always restore your original httpd-vhosts.conf file!
sudo cp -i /etc/sentora/configs/apache/httpd-vhosts.conf /etc/sentora/configs/apache/httpd-vhosts_original.conf
# Step 2
# Now log into your Sentora control panel
# Go to Menu Admin/Modual Admin/Apache Config
# select the domain that you wish to secure from the Override a Virtual Host Setting drop down.
1. Port Override: 443
2. Check Box Forward Port 80 to overrride port
3. IP Override: server ip address: YOUR SERVER IP ADDRESS
4. Custom Entry
#Add the following to custom entry, make sure you change the **USER** and change mydomain_com to your personal server and domain name.
##################################################
# Apache VHOST configuration file
# Generated by Taner Temel
# Generated on: 14:15 7th April 2015 GMT
# NameVirtualHost *:443
##################################################
SSLEngine On
SSLCertificateKeyFile /etc/apache2/ssl/Sentora.key
SSLCertificateFile /etc/apache2/ssl/Sentora.crt
ServerAdmin zadmin@localhost
DocumentRoot "/var/sentora/hostdata/**USER**/public_html/mydomain_com"
ServerAlias mydomain.com
# Now go back to terminal
# Activate SSL (if not already done)
a2enmod ssl
# Run Sentora deamon
php -q /etc/sentora/panel/bin/daemon.php
# Restart apache server
service apache2 restart
# Now go to the front end of your website to check the SSL is install correctly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment