歡迎您光臨本站 註冊首頁

apache 如何添加ssl ?

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

apache 如何添加ssl ?

apache 2.2.x,當初在編譯的時候沒有-enable-ssl, 但是有-enable-module=so,現在需要使用https的方式來訪問已有的web,除了重新編譯apache外還有其他的辦法嗎?重新編譯應該會中斷服務吧?
《解決方案》

HTTPS Websites
Many online shopping malls and password-protected areas use what they
call secure websites. What they mean by this is that they use SSL to encrypt traffic
between the server and the client. While these sites aren』t as secure as the
name implies, SSL provides a vital layer of protection. SSL functionality is
integrated with Apache via the extra/httpd-ssl.conf file. Uncomment the entry
for this file in httpd.conf to enable SSL.

All SSL web servers need a secure certificate. We discussed generating a
certificate request and creating a self-signed certificate in Chapter 9. For your
private use, a self-signed certificate is sufficient, but anything that faces the
public really needs a certificate from an accredited CA. If you attempt to use
a self-signed certificate on a customer-facing application, the client』s web
browser will spew scary looking warnings about your lack of security.

The completed certificate has two parts: a certificate file (hostname.crt)
and a host key (hostname.key). Place these files in a directory outside of the
web content, so that nobody can download them from the web server itself.
Be sure to make these files readable only by the web server unprivileged
user and not by regular users:# chmod 600 hostname.crt
# chmod 600 hostname.key
# chown www:www hostname.crt
# chown www:www hostname.keyNow that you have the certificate on the system, tell Apache about it.
In the past, SSL configuration used to bring tears to the eyes of experienced
system administrators; today, it only requires four lines within your virtual
host configuration:<VirtualHost 192.168.1.5:443>
ServerName secure.absolutefreebsd.com
SSLEngine on
SSLCertificateFile etc/apache22/ssl.crt/hostname.crt
SSLCertificateKeyFile etc/apache22/ssl.key/hostname.key
...First, note that the we』re using an IP-based virtual host that』s listening on
port 443. Standard HTTPS sites run on TCP port 443.

The ServerName is extremely important for HTTPS websites. The ServerName
should exactly match the reverse DNS of this IP address and the name on the
SSL certificate. If the three names do not exactly match, the user might see
security warnings. ServerAlias is not useful for HTTPS websites.
We then turn the SSL engine on for the site and list the full path to the
certificate and the host key. Use the full hostname for the files containing
the certificate and key.

SECURE WEB SERVERS AND SSL
I recommend avoiding the term 「secure website」 when you mean SSL. Encrypting
the network traffic between the client and the server only defends against one
particular type of network attack. Intruders can still penetrate either the server or the
client. A secure web server requires regular maintenance, good web design, and an
educated system administrator who is left alone long enough to do his job. While
that last one looks like a significant barrier, it pales compared to one of the
requirements for a secure web client: an educated user!

此書下載地址:http://www.itpub.net/forum.php?mod=viewthread&tid=934371

[火星人 ] apache 如何添加ssl ?已經有436次圍觀

http://coctec.com/docs/service/show-post-12740.html