network-service:enablessl
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| network-service:enablessl [2010/04/01 16:56] – percy | network-service:enablessl [2016/05/05 13:07] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== 网站启用SSL加密 ====== | ||
| + | |||
| + | 为了防止我的博客中因出现某些敏感词汇而被墙,启用SSL加密连接。 | ||
| + | |||
| + | 参考:http:// | ||
| + | |||
| + | ====== Create a Certificate | ||
| + | |||
| + | -apt-get install ssl-cert | ||
| + | -mkdir / | ||
| + | -make-ssl-cert / | ||
| + | | ||
| + | Usage: / | ||
| + | Usage: / | ||
| + | | ||
| + | | ||
| + | ====== Create virtualhost(SSL) | ||
| + | 这个教程是拷贝了默认的一个模板进行修改。 | ||
| + | |||
| + | 我发现在sites-available目录下已经有了一个默认的SSL模板: | ||
| + | default-ssl | ||
| + | 既然已经有了那就直接用它了。 | ||
| + | |||
| + | 对这个文件进行简单的修改,我一共就修改了4行: | ||
| + | |||
| + | *主要修改网站根目录: | ||
| + | < | ||
| + | ServerAdmin pengjianqing@gmail.com | ||
| + | |||
| + | DocumentRoot / | ||
| + | < | ||
| + | Options FollowSymLinks | ||
| + | AllowOverride None | ||
| + | </ | ||
| + | < | ||
| + | Options Indexes FollowSymLinks MultiViews | ||
| + | AllowOverride None | ||
| + | Order allow,deny | ||
| + | allow from all | ||
| + | </ | ||
| + | </ | ||
| + | |||
| + | *修改证书目录: | ||
| + | < | ||
| + | # SSL Engine Switch: | ||
| + | # | ||
| + | SSLEngine on | ||
| + | |||
| + | # A self-signed (snakeoil) certificate can be created by installing | ||
| + | # the ssl-cert package. See | ||
| + | # / | ||
| + | # If both key and certificate are stored in the same file, only the | ||
| + | # | ||
| + | SSLCertificateFile | ||
| + | # | ||
| + | </ | ||
| + | 保证: | ||
| + | SSLEngine on | ||
| + | 还有SSLCertificateFile路径正确 | ||
| + | SSLCertificateFile | ||
| + | | ||
| + | | ||
| + | | ||
| + | |||
| + | 最后重启apache,一切正常。 | ||
| + | |||
| + | 可以用https:// | ||
| + | |||
| + | 发现加密之后很耗系统资源,特别是内存。 | ||
| + | |||
| + | 用https访问一下网页,内存立马减少将近100M,数据传输完后又会恢复了,如果人多的话,岂不是VPS立马就将内存耗尽? | ||
| + | |||
| + | |||
