最近将自己做的练习放到linux虚拟机中运行,可是在发送邮件的地方出了问题,我用的是phpmailer,发送失败,最终推测是加密那块的问题,就是ssl/tls这块,所以决定在linux虚拟机中安装ssl,但是弄了半天,一切都没出问题,证书也签了,但是./apachectl startssl却出现了提示:Please edit httpd.conf to include the SSL configuration settings
and then use apachectl start.后来在google中找到貌似是在高版本中不支持这个命令了,只要./apachectl start就行了,可是我apache启动时候并没有遇到类似输入密码的提示,在浏览器中测试https://server也访问不到,不知道为何,baidu、google找了很久依然没有针对这个问题做出正确的解答,等待高手指点迷津...
and then use apachectl start.后来在google中找到貌似是在高版本中不支持这个命令了,只要./apachectl start就行了,可是我apache启动时候并没有遇到类似输入密码的提示,在浏览器中测试https://server也访问不到,不知道为何,baidu、google找了很久依然没有针对这个问题做出正确的解答,等待高手指点迷津...
http://blog.s135.com/startssl/
http://wiki.oss.org.tw/index.php/Php_openssl
http://djxailc.blog.sohu.com/56732044.html
建议看一下errorlog,应该是没有配置成功,ssl模块并没有加载基于的Ubuntu版本Edgy,在Ubuntu下面安装配置Apache都比较简单。相应的配置文件位置如下:默认站点在 /var/www/配置文件在 /etc/apache2/日志在 /var/log/apache/启动脚本是 /usr/sin/apache2ctl 或者 /etc/init.d/apache21、安装Apache$sudo apt-get install apache22、开启SSL模块$sudo a2enmod ssl3、创建证书可以使用apache内置的工具创建默认的证书,通过-days指定有效期。$sudo apache2-ssl-certificate另外我们可以使用openssl来创建$sudo openssl req -x509 -newkey rsa:1024 -keyout apache.pem -out apache.pem -nodes -days 999注:在要求输入Common Name (eg, YOUR name) 时,输入你的主机名。4、编辑SSL的配置我们可以将当前的默认站点配置文件拷贝一份,然后进行修改#vi /etc/apache2/sites-enabled/001-ssl把端口改为443加入SSL认证配置其它的根据需要自己定制 与普通配置无异NameVirtualHost *:443ServerSignature On
SSLEngine On
SSLCertificateFile /etc/apache2/ssl/apache.pemServerAdmin webmaster@localhost
#[......]修改普通http方式的配置#vi /etc/apache2/sites-enabled/000-default把端口改为80NameVirtualHost *:80ServerAdmin webmaster@localhost#[......]编辑Apache端口配置,加入443端口(SSL的)#vi /etc/apache2/ports.conf:Listen 80Listen 443重新载入Apache的配置#/etc/init.d/apache2 force-reload或者重新启动Apache2#/etc/init.d/apache2 restart
$mail->CharSet = "gb2312";
ssl传输在很多地方用到,必如ssh,puty之类的客户端,都支持加密传输
是可以指定文档类型和编码的如text/html charse=utf-8; 纯文件:text/plain, charset=gb2312;
本来编码统一用UTF-8 有些细节的问题 导致一直不能统一 调试的结果!