I'm trying to setup SSL on an ubuntu server. I've generated a key and certificate with the following commands openssl genrsa -out mydomain.key 1024 and openssl req -new -key mydomain.key -x509 -out mydomain.crt. I added LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so to httpd.conf, and the relevant(I think) excerpt from my httpd.conf is
LoadModule ssl_module /usr/lib/apache2/modules/mod_ssl.so NameVirtualHost *:80 NameVirtualHost *:443 Listen 80 Listen 443 # # NOTE: NameVirtualHost cannot be used without a port specifier # (e.g. :80) if mod_ssl is being used, due to the nature of the # SSL protocol. # # # VirtualHost example: # Almost any Apache directive may go into a VirtualHost container. # The first VirtualHost section is used for requests without a known # server name. # <VirtualHost *:443> ProxyPass /software-suite http://localhost:8087/software-suite ProxyPassReverse /software-suite http://localhost:8087/software-suite SSLEngine on SSLCertificateFile /etc/apache2/ssl.crt/hostname.crt SSLCertificateKeyFile /etc/apache2/ssl.key/hostname.key </VirtualHost> <VirtualHost *:80> ProxyPass /software-suite http://localhost:8087/software-suite ProxyPassReverse /software-suite http://localhost:8087/software-suite </VirtualHost> When I run sudo service apache2 start, I get
* Starting web server apache2 Thu Feb 25 23:01:37 2016] [warn] module ssl_module is already loaded, skipping [Thu Feb 25 23:01:37 2016] [warn] The Alias directive in /etc/apache2/httpd.conf at line 499 will probably never match because it overlaps an earlier Alias. (98)Address already in use: make_sock: could not bind to address 0.0.0.0:443 no listening sockets available, shutting down Unable to open logs Action 'start' failed. The Apache error log may have more information. but when I run sudo netstat -ltnp | grep ':443' nothing is listening
Update
I moved the <VirtualHost *:443> node and its contents to /etc/apache2/sites-available/default-ssl. When I start apache2 I get
* Starting web server apache2 [Fri Feb 26 16:36:43 2016] [warn] The Alias directive in /etc/apache2/httpd.conf at line 499 will probably never match because it overlaps an earlier Alias. [ OK ] and I can now access my website on port 80 but I get ERR_SSL_PROTOCOL_ERROR when I try to access it with https. Also when I execute sudo service apache2 status I get Apache2 is NOT running. even though it appears to be handling requests coming into port 80. I also commented out NameVirtualHost *:443, LoadModule ssl_module, and Listen 443 in httpd.conf. I don't see any errors in /var/log/apache2/error.log or /var/log/apache2/access.log, the only logs in /var/log/apache2
apache2 -v. What version of ubuntu you have? executelsb_release -a. Did you manually create thehttpd.conf file?/etc/apache2/sites-available/default-ssl). Make a copy of the current httpd file and/or rename it. Give a tryERR_SSL_PROTOCOL_ERROR. I'll update the question