Amazon-web-services – (98)Address already in use: make_sock: could not bind to address [::]:443

amazon ec2amazon-web-servicesapachessl

What I am trying to do is direct my website on an Amazon EC2 Instance so that I am able to open on an HTTPS protocol. My site was running before but with a warning that it did not have a valid certificate, using this link example https://my.site.name.edu but now I get a "Webpage is not Available" prompt when I try to visit the site.

Please note that I have:

Installed Drupal for this testing site on a Linux server using Apache

My EC2 Instance attached to an Elastic IP

Used the steps in this guide: Creating, Uploading, and Deleting Server Certificates

Valid CA signed Apache certificates

An openssl-1.0.1f file installed in /home/ec2-user folder

Used this link to create the Virtual Host: http://ananthakrishnanravi.wordpress.com/2012/04/15/configuring-ssl-and-https-for-your-website-amazon-ec2/

Below is when the error occurred, while trying to solve the HTTPS access issue

I tried to change the ssl.conf file in this link to see if it would solve the problem: Setup an SSL certificate on an EC2 instance

I copied a new ssl.conf file, commented the old SSLCertificateKeyFile, SSLCertificateFile and SSLCertificateChainFile. I then pasted the copied, modified file into the directory after I coded the first four lines like this:

<VirtualHost 00.00.00.00:443>
  SSLCertificateKeyFile /home/ec2-user/castestingapache/privatekey.pem
  SSLCertificateFile /home/ec2-user/castestingapache/my_site_name_edu.pem 
  SSLCertificateChainFile /home/ec2-user/castestingapache/my_site_name_edu_interm.crt

But when I restarted Apache:

service httpd restart

I received this error message:

Stopping httpd:                                            [FAILED]
Starting httpd: [Wed May 21 14:44:31 2014] [warn] module ssl_module is already loaded,     skipping
(98)Address already in use: make_sock: could not bind to address [::]:443
                                                       [  OK  ]

My httpd.conf is set up like this:

<VirtualHost 00.00.00.00:443>    #Same as the IP in the ssl.conf#
ServerAdmin ec2-user@ec2-00-00-00-00.compute.amazonaws.com
DocumentRoot /var/www/html
ServerName https://my.site.name.edu
SSLEngine on
SSLProtocol all -SSLv2
SSLCipherSuite ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM
# ErrorLog logs/errorlogs
# CustomLog logs/custom
SSLCertificateFile /home/ec2-user/castestingapache/my_site_name_edu.pem 
SSLCertificateKeyFile /home/ec2-user/castestingapache/privatekey.pem
SSLCertificateChainFile /home/ec2-user/castestingapache/my_site_name_edu_interm.crt
# SSLCACertificateFile /etc/httpd/conf/bundle.txt 
SetEnvIf User-Agent “.*MSIE.*” nokeepalive ssl-unclean-shutdown
# CustomLog /usr/local/apache/logs/ssl_request_log \
# “%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \”%r\” %b”
</VirtualHost>

EDIT: I tried reverting back to the old ssl.conf but when I try to restart Apache it gives me the same error. THIS PROBLEM HAS BEEN SOLVED I had to delete one of the ssl.conf even though I had renamed it…

Update I have added this line onto the httpd.conf file:

NameVirtualHost 00.00.00.00:443

I believe the problem is that my certificates are not pointing to this IP address.

Update I have just ran the certificate installation checker test here http://ssltool.com/?action=sslCheckOpenSSL and this is what I got:
enter image description here

Note: IP 12-34-56-78 is my private IP address on my AWS EC2 Instance.

Any help is greatly appreciated.

Thanks,

Best Answer

Ugh.... the answer was in this link the whole time...

Setup an SSL certificate on an EC2 instance

This line in the ssl.conf:

<VirtualHost 00.000.000.00:443>

Had to be changed to:

<VirtualHost _default_:443> 

Add the rest:

SSLCertificateKeyFile /etc/ssl/mydomain_com.key
SSLCertificateFile /etc/ssl/mydomain_com.crt
SSLCertificateChainFile /etc/ssl/mydomain_com.ca-bundle
</VirtualHost>

And voilah! Your HTTPS: link should work...

Related Topic