Ubuntu下Apache SSL的简洁配置方法(HTTPS的实现)
2014-12-14 23:50
866 查看
sudo a2enmod ssl //启用ssl模块
sudo apt-get install openssl //安装openssl
openssl genrsa -des3 -out server.key 1024 //创建CA签名(不使用密码去除-des3选项)
openssl req -new -key server.key -out server.csr //创建CSR(Certificate Signing Request)
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt //自己签发证书
sudo cp server.crt /etc/ssl/certs
sudo cp server.key /etc/ssl/private
sudo cp /etc/apache2/mods-enabled/000-default /etc/apache2/mods-enabled/001-ssl
sudo vim 001-ssl
在<VirtualHost *:80>段中,DocumentRoot一行的下方加入内容:
SSLEngine On
SSLOptions +StrictRequire
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
端口修改为:443,即<VirtualHost *:443>(ssl的端口)
sudo /etc/init.d/apache2 force-reload
sudo /etc/init.d/apache2 restart
sudo apt-get install openssl //安装openssl
openssl genrsa -des3 -out server.key 1024 //创建CA签名(不使用密码去除-des3选项)
openssl req -new -key server.key -out server.csr //创建CSR(Certificate Signing Request)
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt //自己签发证书
sudo cp server.crt /etc/ssl/certs
sudo cp server.key /etc/ssl/private
sudo cp /etc/apache2/mods-enabled/000-default /etc/apache2/mods-enabled/001-ssl
sudo vim 001-ssl
在<VirtualHost *:80>段中,DocumentRoot一行的下方加入内容:
SSLEngine On
SSLOptions +StrictRequire
SSLCertificateFile /etc/ssl/certs/server.crt
SSLCertificateKeyFile /etc/ssl/private/server.key
端口修改为:443,即<VirtualHost *:443>(ssl的端口)
sudo /etc/init.d/apache2 force-reload
sudo /etc/init.d/apache2 restart
相关文章推荐
- Ubuntu下为Apache简单配置SSL的方法(HTTPS的实现)
- Ubuntu下为Apache简单配置SSL的方法(HTTPS的实现)
- apache中使用mod_gnutls模块实现多个SSL站点配置(多个HTTPS协议的虚拟主机)
- Nginx下配置网站SSL实现https访问本站就是用的这方法
- Nginx下配置网站SSL实现https访问本站就是用的这方法
- 在Ubuntu上的Apache配置SSL(https证书)的正确姿势
- Ubuntu Nginx下配置网站ssl实现https访问
- Windows环境下配置Apache 2.2.x + SSL ,实现https方式
- ubuntu SVN Apache SSL https 安装 与 配置
- 在windows下apache配置SSL以实现http转换为https
- Ubuntu Nginx下配置网站ssl实现https访问
- windows下apache配置SSL以实现http转换为https
- Ubuntu下Apache SSL的配置方法
- Ubuntu下配置Apache的 ssl 模块以支持 HTTPS
- Ubuntu Nginx下配置网站ssl实现https访问
- apache中使用mod_gnutls模块实现多个SSL站点配置(多个HTTPS协议的虚拟主机)
- ubuntu SVN Apache SSL https 安装 与 配置
- Windows平台下Apache SSL/TLS(https)的配置方法
- Apache+mod_ssl实现https服务的主要配置
- apache+tomcat+jk+ssl实现tomcat集群https服务(windows)