[How-TO] apache2 SSL ubuntu 14.04
#1
[How-TO] apache2 SSL ubuntu 14.04
How To Create a SSL Certificate

Enable SSL on you server

1: enable apache2 ssl
Code:
sudo a2enmod ssl sudo service apache2 restart
Setup ssl on you server
2: make a folder to the crt and key files
Code:
sudo mkdir /var/sentora/hostdata/username/ssl
change name with your username
3: Create a Self Signed SSL Certificate
Code:
sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /var/sentora/hostdata/username/ssl/domain.tld.key -out /var/sentora/hostdata/username/ssl/domain.tld.crt
output
Code:
Generating a 2048 bit RSA private key .............+++ ................+++ writing new private key to '/var/sentora/hostdata/username/ssl/domain.tld.key' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. -----
follow this -->
Code:
Country Name (2 letter code) [AU]:US State or Province Name (full name) [Some-State]:New York Locality Name (eg, city) []:NYC Organization Name (eg, company) [Internet Widgits Pty Ltd]:Name of company Organizational Unit Name (eg, section) []: just press enter Common Name (e.g. server FQDN or YOUR name) []: website name example.com Email Address []:Email

4: Enable Port 443

Code:
nano /etc/sentora/configs/apache/httpd.conf
just before
Code:
# Now we include the generic VHOST configuration file that holds all Sentora user hosted vhost data Include /etc/sentora/configs/apache/httpd-vhosts.conf

add
Code:
<IfModule ssl_module>        Listen 443 </IfModule>
and reset apache2
Code:
sudo service apache2 restart

Setup SSL to website


5: Now log on to you sentora panel and go to
Code:
Module Admin --> Apache Config --> Override a Virtual Host Setting
and select domain

6: under Custom Entry:
Code:
</virtualHost> <virtualhost *:443> ServerName Domain.tld ServerAlias  www.domain.tld ServerAdmin zadmin@localhost DocumentRoot "/var/sentora/hostdata/Username/public_html/Domain_tld" php_admin_value open_basedir "/var/sentora/hostdata/Username/public_html/Domain_tld:/var/sentora/temp/" 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" SSLEngine on SSLCertificateFile /var/sentora/hostdata/username/ssl/domain.tld.crt SSLCertificateKeyFile /var/sentora/hostdata/username/ssl/domain.tld.key SSLProtocol -All +TLSv1 +TLSv1.1 +TLSv1.2 SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!A$ SSLHonorCipherOrder on ErrorLog "/var/sentora/logs/domains/Username/Domain.tld-error.log" CustomLog "/var/sentora/logs/domains/Username/Domain.tld-access.log" combined CustomLog "/var/sentora/logs/domains/Username/Domain.tld-bandwidth.log" common <Directory "/var/sentora/hostdata/Username/public_html/Domain_tld">   Options +FollowSymLinks -Indexes   AllowOverride All   Require all granted </Directory> AddType application/x-httpd-php .php3 .php ErrorDocument 500 /_errorpages/500.html ErrorDocument 403 /_errorpages/403.html ErrorDocument 404 /_errorpages/404.html ErrorDocument 510 /_errorpages/510.html DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm

now wait to Daemon has run take about 5 min

now hXXps://sitename.tld Works

Thx Cantalupo and remember dont use Apple iPad to make guide ?
Sentora 1.0.3 on [Image: DO_Logo_Horizontal_Blue-3db19536.png]

-= Github =-  -= My Repo =-

My Modules
Reply
#2
RE: [How-TO] apache2 SSL ubuntu 14.04
Nice.
 By: Cantalupo
Reply
#3
RE: [How-TO] apache2 SSL ubuntu 14.04
Hi

I get the following error when i restart apache
[Sun Feb 08 12:37:23.360612 2015] [ssl:emerg] [pid 24145] AH02240: Server should be SSL-aware but has no certificate configured [Hint: SSLCertificateFile] (/etc/sentora/configs/apache/httpd-vhosts.conf:72)
Reply
#4
RE: [How-TO] apache2 SSL ubuntu 14.04
Can you made a past of you custom entry
Sentora 1.0.3 on [Image: DO_Logo_Horizontal_Blue-3db19536.png]

-= Github =-  -= My Repo =-

My Modules
Reply
#5
RE: [How-TO] apache2 SSL ubuntu 14.04
Code:
</VirtualHost> # Configuration for WebMail <VirtualHost *:80> ServerAlias webmail.pcfeverhosting.co.za DocumentRoot "/etc/sentora/panel/etc/apps/webmail/" AddType application/x-httpd-php .php <Directory "/etc/sentora/panel/etc/apps/webmail/"> Options +FollowSymLinks -Indexes AllowOverride All Require all granted </Directory> </virtualHost> <virtualhost *:443> ServerName pcfeverhosting.co.za ServerAlias  www.pcfeverhosting.co.za ServerAdmin info@pcfeverhosting.co.za DocumentRoot "/var/sentora/hostdata/pcfeverhosting/public_html/pcfeverhosting.co.za" php_admin_value open_basedir "/var/sentora/hostdata/pcfeverhosting/public_html/pcfeverhosting.co.za:/var/sentora/temp/" 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" SSLProtocol -All +TLSv1 +TLSv1.1 +TLSv1.2 SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!A$ SSLHonorCipherOrder on ErrorLog "/var/sentora/logs/domains/pcfeverhosting/pcfeverhosting.co.za-error.log" CustomLog "/var/sentora/logs/domains/pcfeverhosting/pcfeverhosting.co.za-access.log" combined CustomLog "/var/sentora/logs/domains/pcfeverhosting/pcfeverhosting.co.za-bandwidth.log" common <Directory "/var/sentora/hostdata/pcfeverhosting/public_html/pcfeverhosting.co.za"> Options +FollowSymLinks -Indexes AllowOverride All Require all granted </Directory> AddType application/x-httpd-php .php3 .php ErrorDocument 500 /_errorpages/500.html ErrorDocument 403 /_errorpages/403.html ErrorDocument 404 /_errorpages/404.html ErrorDocument 510 /_errorpages/510.html DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm
Reply
#6
RE: [How-TO] apache2 SSL ubuntu 14.04
Hi @[etienne7702]
Sorry my fault Blush

I forgot to add the line
Code:
SSLEngine on SSLCertificateFile /var/sentora/hostdata/username/ssl/domain.tld.crt SSLCertificateKeyFile /var/sentora/hostdata/username/ssl/domain.tld.key

I have updated my post
Sentora 1.0.3 on [Image: DO_Logo_Horizontal_Blue-3db19536.png]

-= Github =-  -= My Repo =-

My Modules
Reply
#7
RE: [How-TO] apache2 SSL ubuntu 14.04
Now the tutorial was better.
 By: Cantalupo
Reply
#8
RE: [How-TO] apache2 SSL ubuntu 14.04
Got it, thanks! Big Grin
 By: Cantalupo
Reply
#9
RE: [How-TO] apache2 SSL ubuntu 14.04
Thanks for this tutorial.

How can I also connect to my panel.mydomain.com with https? When I go to https://panel.mydomain.com it brings me to mydomain.com. with http:// no problems. How to fix this?
Reply
#10
RE: [How-TO] apache2 SSL ubuntu 14.04
(02-10-2015, 04:13 AM)Diablo925 Wrote: Hi @[etienne7702]
Sorry my fault Blush

I forgot to add the line

Code:
SSLEngine on SSLCertificateFile /var/sentora/hostdata/username/ssl/domain.tld.crt SSLCertificateKeyFile /var/sentora/hostdata/username/ssl/domain.tld.key

I have updated my post

Hello! Thank you for the post, now I have a better idea of how everything works but I can´t get my site working.
This is my Custom entry in the Virtual Host Override module:
</virtualHost>


<virtualhost *:443>
ServerName tilabmx.com
ServerAlias  www.tilabmx.com
ServerAdmin hcmarcos@tilabmx.com
DocumentRoot "/var/sentora/hostdata/zadmin/public_html/tilabmx_com"
php_admin_value open_basedir "/var/sentora/hostdata/zadmin/public_html/tilabmx_com:/var/sentora/temp/"
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$
SSLEngine on
SSLCertificateKeyFile /etc/apache2/ssl/tilabmx_com.key

SSLCertificateFile /etc/apache2/ssl/tilabmx_com.crt

SSLCertificateChainFile /etc/apache2/ssl/tilabmx.com.ca-bundle
SSLProtocol -All +TLSv1 +TLSv1.1 +TLSv1.2
SSLCipherSuite ECDHE-RSA-AES256-SHA384:AES256-SHA256:RC4:HIGH:!MD5:!aNULL:!EDH:!A$
SSLHonorCipherOrder on
ErrorLog "/var/sentora/logs/domains/zadmin/tilabmx.com-error.log"
CustomLog "/var/sentora/logs/domains/zadmin/tilabmx.com-access.log" combined
CustomLog "/var/sentora/logs/domains/zadmin/tilabmx.com-bandwidth.log" common
<Directory "/var/sentora/hostdata/zadmin/public_html/tilabmx_com">
  Options +FollowSymLinks -Indexes
  AllowOverride All
  Require all granted
</Directory>
AddType application/x-httpd-php .php3 .php
ErrorDocument 500 /_errorpages/500.html
ErrorDocument 403 /_errorpages/403.html
ErrorDocument 404 /_errorpages/404.html
ErrorDocument 510 /_errorpages/510.html
DirectoryIndex index.html index.htm index.php index.asp index.aspx index.jsp index.jspa index.shtml index.shtm



The bold letters indicate the files as instructed by Comodo PositiveSSL instructions here:
https://support.comodo.com/index.php?/Kn...e--mod_ssl
And in the Sentora Docs:
http://docs.sentora.org/?node=64

THank you very much in advance I hope you can help me.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Upgrade to Ubuntu 16.04 from 14.04 HogensHero 8 33 ,921 07-18-2020, 03:13 AM
Last Post: dycott78
Ubuntu: How to Enable tls/ssl in proftpd Diablo925 2 14 ,250 04-21-2020, 03:35 AM
Last Post: iraqiboy90
Ubuntu 18.04 or 20.04 Kangarooo 1 8 ,032 03-20-2020, 11:39 AM
Last Post: Jettaman

Forum Jump:


Users browsing this thread: 1 Guest(s)