Environmental Ubuntu12.04
Server Configuration
1, first in the access to find/etc/apache2/apache2.conf configuration file, which contains more configuration file path such as: httpd.conf/ports.conf (port configuration)/site-enabled/, etc.
2, in port.conf Configuration port (http port=80, HTTPS port = 443)
Namevirtualhost *:80
Listen 80
Namevirtualhost *:443
Listen 443
3, locate the certificate with the configuration path of key in/etc/apache2/sites-enabled/default-ssl, configure the following three places
Sslcertificatefile/etc/apache2/ssl/httpd.cert
Sslcertificatekeyfile/etc/apache2/ssl/httpd.key
Sslcertificatechainfile/etc/apache2/ssl/cacert.pem (here Cacert.pem and Httpd.cert content are exactly the same)
When the certificate is generated, the common name = Native IPis configured, otherwise the authentication is not available and the command is as follows:
OpenSSL req-x509-nodes-newkey ras:2048-keyout server.key-out server.crt-days 10950
4, after the configuration is complete, service apache2 restart
Client use
Wget-ca--certificate=/certpath/cert-p/dstfilepath HTTPS://... Ip.. /srcfile (if accessed via HTTP, the client will not validate the certificate)
wget--no-check-certificate-p/dstfilepath http://... Ip.. /srcfile;
When the client uses the certificate, the local time must be later than the server generation time. Otherwise, the certificate not Alive is prompted.
Apache2 and HTTPS certificate configuration