当前位置:编程学习 > php >>

Ubuntu 7.1 server从无到有搭建jsp/php/rails全能WEB生产环境(六)

版权声明:可以任意转载,转载时请务必以超链接形式标明文章原始出处和作者信息及本版权声明。
http://www.dingl.com/blog/archives/18
作者:丁令

作为生产环境,经常需要使用SSL来支持https协议,这部分主要为Apache增加SSL支持。

六、配置apache支持ssl:

1、修改Apache配置文件:
vi /usr/local/apache/conf/httpd.conf
确保两面这行没有被注释:
LoadModule ssl_module modules/mod_ssl.so
Include conf/extra/httpd-ssl.conf

再配置一个虚拟主机(可配置成xxx.dingl.com,根据购买的SSL证书设置):
<VirtualHost *:80>
ServerName www.dingl.com
DocumentRoot /home/dingl/jsp-web

ResinConfigServer localhost 6800

AddHandler caucho-request jsp
AddHandler caucho-request xtp
AddHandler caucho-request vm
</VirtualHost>

2、修改ssl配置文件:
vi /usr/local/apache/conf/extra/httpd-ssl.conf
dingl.com修改成如下形式:

Listen 443

AddType application/x-x509-ca-cert .crt
AddType application/x-pkcs7-crl    .crl

SSLPassPhraseDialog  builtin

SSLSessionCache        “shmcb:/usr/local/apache/logs/ssl_scache(512000)”
SSLSessionCacheTimeout  300

SSLMutex  “file:/usr/local/apache/logs/ssl_mutex”

##
## SSL Virtual Host Context
##
<VirtualHost _default_:443>

#   General setup for the virtual host
DocumentRoot “/home/dingl/jsp-web”
ServerName www.dingl.com:443
ServerAdmin you@example.com
ErrorLog “/usr/local/apache/logs/error_log”
TransferLog “/usr/local/apache/logs/access_log”

#   SSL Engine Switch:
#   Enable/Disable SSL for this virtual host.
SSLEngine on

SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL

SSLCertificateFile “/usr/local/apache/conf/dingl.com.crt”
#SSLCertificateFile “/usr/local/apache/conf/server-dsa.crt”

SSLCertificateKeyFile “/usr/local/apache/conf/dingl.com.key”补充:Php教程,Php常用代码

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,