nquinnathome1
May 25th, 2008, 10:55 AM
I'm trying to extend my 8.04 web server so that it can also use HTTPS; I have a default LAMP install and followed the guide for SSL located at https://help.ubuntu.com/community/forum/server/apache2/SSL#head-6097389ac6c921feb19fca8ddbc03278cb115738, generating a certificate via the 7.10 method shown.
I then copied my available-sites/default config to available-sites/ssl, modified it so the port was 443 not 80, enabled it and reloaded, but for some reason, Apache restarts just fine, but any attempts to access my webserver with https results in a "ssl_error_rx_record_too_long" error in my browser, and in the Apache error log I get the error "[error] [client 192.168.1.100] Invalid method in request \x16\x03\x01". Accessing the server by ordinary http still works absolutely fine and Apache returns no restart errors or warnings.
I don't know if it's relevant but below is my sites-available/ssl file:
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot /NETWORKDISK/Web/WWW
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /NETWORKDISK/Web/WWW/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ServerName my.domain.com
</VirtualHost>
I've been trying to get it to work for hours, so any help will be greatly appreciated :)
EDIT: I've found the problem - the solution is to ensure your Apache SSL virtual hosts are included in your httpd.conf file and not in a file in your sites-available directory. As soon as I moved the SSL virtual hosts to httpd.conf the error message disappeared and I was able to connect over https.
I then copied my available-sites/default config to available-sites/ssl, modified it so the port was 443 not 80, enabled it and reloaded, but for some reason, Apache restarts just fine, but any attempts to access my webserver with https results in a "ssl_error_rx_record_too_long" error in my browser, and in the Apache error log I get the error "[error] [client 192.168.1.100] Invalid method in request \x16\x03\x01". Accessing the server by ordinary http still works absolutely fine and Apache returns no restart errors or warnings.
I don't know if it's relevant but below is my sites-available/ssl file:
NameVirtualHost *:443
<VirtualHost *:443>
DocumentRoot /NETWORKDISK/Web/WWW
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pem
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /NETWORKDISK/Web/WWW/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ServerName my.domain.com
</VirtualHost>
I've been trying to get it to work for hours, so any help will be greatly appreciated :)
EDIT: I've found the problem - the solution is to ensure your Apache SSL virtual hosts are included in your httpd.conf file and not in a file in your sites-available directory. As soon as I moved the SSL virtual hosts to httpd.conf the error message disappeared and I was able to connect over https.