[How-TO] apache2 SSL ubuntu 14.04
02-06-2015, 12:32 AM
(This post was last modified: 02-10-2015, 04:11 AM by Diablo925.
Edit Reason: Smal fixs thx Cantalipo
)
How To Create a SSL Certificate
Enable SSL on you server
1: enable apache2 ssl
Setup ssl on you server
2: make a folder to the crt and key files
change name with your username
3: Create a Self Signed SSL Certificate
output
follow this -->
4: Enable Port 443
just before
add
and reset apache2
Setup SSL to website
5: Now log on to you sentora panel and go to
and select domain
6: under Custom Entry:
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 ?
Enable SSL on you server
1: enable apache2 ssl
Code:
sudo a2enmod ssl
sudo service apache2 restart
2: make a folder to the crt and key files
Code:
sudo mkdir /var/sentora/hostdata/username/ssl
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
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.
-----
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
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>
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
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 ?