Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

How can i install SSL HTTPS in my apache webserver in Red hat enterprise linux? Only following is installed. And i have tried this website follow up but its not working it fails.

$ uname -a
2.6.32-358.6.1.el6.x86_64 #1 SMP Fri Mar 29 16:51:51 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux

[root@ip-10-210-144-105 conf]# pwd
/etc/httpd/conf
[root@ip-10-210-144-105 conf]# tree
.
├── ca-bundle
│   └── root.crt
├── httpd.conf
├── magic
├── ssl.crt
│   └── crt.crt
└── ssl.key
    └── key.key

3 directories, 5 files

EDIT httpd.conf file applied

Listen 80
Listen 443

<VirtualHost *:80>
 ServerName s.org
 ServerAlias s.org www.s.org
 DocumentRoot /var/www/html/s/public
 <Directory /var/www/html/s/public>
    #AddDefaultCharset utf-8
    DirectoryIndex index.php
    #AllowOverride FileInfo
    AllowOverride All
    Order allow,deny
    Allow from all
 </Directory>

 #SSLEngine on
 #SSLCertificateFile /etc/httpd/conf/ssl.crt/crt.crt
 #SSLCertificateKeyFile /etc/httpd/conf/ssl.key/key.key
 #SSLCertificateChainFile /etc/httpd/conf/ca-bundle/root.crt

</VirtualHost>

<VirtualHost *:443>
 ServerName s.org
 ServerAlias s.org www.s.org
 DocumentRoot /var/www/html/s/public
 <Directory /var/www/html/s/public>
    #AddDefaultCharset utf-8
    DirectoryIndex index.php
    #AllowOverride FileInfo
    AllowOverride All
    Order allow,deny
    Allow from all
 </Directory>

 #SSLEngine on
 #SSLCertificateFile /etc/httpd/conf/ssl.crt/crt.crt
 #SSLCertificateKeyFile /etc/httpd/conf/ssl.key/key.key
 #SSLCertificateChainFile /etc/httpd/conf/ca-bundle/root.crt

</VirtualHost>

Fails

[root@ip-10-210-144-105 conf]# service httpd restart
Stopping httpd:                                            [FAILED]
Starting httpd: (98)Address already in use: make_sock: could not bind to address [::]:443
                                                       [  OK  ]
share|improve this question
add comment

closed as not a real question by jasonwryan, slm, vonbrand, Renan, rahmu May 14 '13 at 8:35

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 0 down vote accepted

Red hat Enterprise linux - how do i install copy paste easy way SSL/HTTPS? (its not rocket science anyway!).

1) Ask your domain provider to give you three license files which is like

a) CERTIFICATE

-----BEGIN CERTIFICATE-----
MIIEvTCCA6WgAwIBAgIS

b) KEY

-----BEGIN RSA PRIVATE KEY-----
MIIEpQIBAAK

c) INTERMEDIATE (ROOT CA)

-----BEGIN CERTIFICATE-----
MIIELzCCAx
  • They will send you attached file or email plain encoded data

2) Download them or make them in your server stored like below.

[root@ip-10-210-144-105 conf]# pwd
/etc/httpd/conf
[root@ip-10-210-144-105 conf]# tree
.
├── ca-bundle
│   └── root.crt
├── httpd.conf
├── magic
├── ssl.crt
│   └── crt.crt
└── ssl.key
    └── key.key

3 directories, 5 files

3) RED HAT has already https prepared, just use httpd.conf as usual for your port 80 http. Only for https 443 port go to :

[root@ip-10-210-144-105 conf.d]# tree
.
├── authz_ldap.conf
├── perl.conf
├── php.conf
├── phpMyAdmin.conf
├── README
├── ssl.conf
├── webalizer.conf
└── welcome.conf

0 directories, 8 files

$ vim welcome.conf
# 
# This configuration file enables the default "Welcome"
# page if there is no default index page present for
# the root URL.  To disable the Welcome page, comment
# out all the lines below.
#
#<LocationMatch "^/+$">
#    Options -Indexes
#    ErrorDocument 403 /error/noindex.html
#</LocationMatch>


[root@ip-10-210-144-105 conf.d]# cat ssl.conf

LoadModule ssl_module modules/mod_ssl.so

Listen 443

SSLPassPhraseDialog  builtin
SSLSessionCache         shmcb:/var/cache/mod_ssl/scache(512000)
SSLSessionCacheTimeout  300
SSLMutex default
SSLRandomSeed startup file:/dev/urandom  256
SSLRandomSeed connect builtin

SSLCryptoDevice builtin

<VirtualHost *:443>

# General setup for the virtual host, inherited from global configuration
DocumentRoot "/var/www/html/s/public"
ServerName www.s.org:443
 <Directory /var/www/html/s/public>
    #AddDefaultCharset utf-8
    DirectoryIndex index.php
    #AllowOverride FileInfo
    AllowOverride All
    Order allow,deny
    Allow from all
 </Directory>
ErrorLog logs/ssl_error_log
TransferLog logs/ssl_access_log
LogLevel warn
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW
SSLCertificateFile /etc/httpd/conf/ssl.crt/crt.crt
SSLCertificateKeyFile /etc/httpd/conf/ssl.key/key.key
SSLCertificateChainFile /etc/httpd/conf/ca-bundle/root.crt

<Files ~ "\.(cgi|shtml|phtml|php3?)$">
    SSLOptions +StdEnvVars
</Files>
<Directory "/var/www/cgi-bin">
    SSLOptions +StdEnvVars
</Directory>

SetEnvIf User-Agent ".*MSIE.*" \
         nokeepalive ssl-unclean-shutdown \
         downgrade-1.0 force-response-1.0
CustomLog logs/ssl_request_log \
          "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

</VirtualHost>  

4) service httpd restart

Enjoy, happy copy paste.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.