参考:http://www.metsky.com/archives/561.html
1.安装Apache
sudo apt-get install apache2
2.安装opensslsudo
sudo apt-get install openssl
3.开启SSL模块
sudo a2enmod ssl
4.创建证书
证书有两种:一种是自签名证书,另外一种是第三方CA机构签名证书。第一种随便使用,只是没有经过官方认可的机构认证而已,后一种则是正规的签名证书,有发证机构签名。其实很多所谓的大网站上使用的SSL证书,一样都是自签名的,主要是因为这个证书只做为在线验证使用,保证传输数据安全即可,不过使用这种证书,对常规浏览器和一些软件而言,一般均会弹出警告,让你确认这个签名证书的有效性。正规签名证书也不过只是多了一重保障而已,而且浏览器、软件等可以自己鉴别。
4.1自签名证书
openssl req -x509 -newkey rsa:1024 -keyout apache.pem -out apache.pem -nodes -days 999
mkdir /etc/apache2/ssl
mv apache.pem /etc/apache2/ssl
4.2第三方CA机构签署证书
openssl req -new -nodes -keyout private.key -out public.csr
openssl req -new -nodes -newkey rsa:2048 -keyout domain.key -out domain.csr
5.HTTPS(SSL)配置
vi /etc/apache2/ports.conf
NameVirtualHost *:80
Listen 80
NameVirtualHost *:443
vi /etc/apache2/httpd.conf
ServerName 域名
ln -s /etc/apache2/sites-available/default /etc/apache2/sites-enabled/default
vi /etc/apache2/sites-enabled/default
NameVirtualHost *:80
ServerName 域名
ln -s /etc/apache2/sites-available/default-ssl /etc/apache2/sites-enabled/default-ssl
vi /etc/apache2/sites-enabled/default-ssl
NameVirtualHost *:443
ServerName 域名
SSLEngine on
#SSLCertificateFile /etc/apache2/ssl/apache.pem
SSLCertificateFile /etc/apache2/ssl/server.crt
SSLCertificateKeyFile /etc/apache2/ssl/server.key
SSLCertificateChainFile /etc/apache2/ssl/cfca.crt
7.配置强制http转换到https
vi /etc/apache2/httpd.conf
ServerName 域名
LoadModule rewrite_module modules/mod_rewrite.so
vi /etc/apache2/sites-enabled/default
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]
8.重启apache
/etc/init.d/apache2 restart
service apache2 restart
分享到:
相关推荐
Ubuntu18 安装Autoware教程支持文件,详细内容在:https://blog.csdn.net/qq_35813104/article/details/117412553
下载地址:https://github.com/wszqkzqk/deepin-wine-ubuntu 下载zip压缩包,在本地解压,并在此目录下进入终端输入如下命令进行安装: sudo sh install.sh 二、下载容器 下载该地址...
选择linux下的Ubuntu进入:https: launchpad net jon severinsson +archive ubuntu ffmpeg 点击Technical details about this PPA展开 选择:Trusty 14 04 复制下面的内容 加载第三方源输入: sudo su">首先安装...
有时候会遇到客户是内网环境的...2、然后执行命名 dpkg -i vsftpd_3.0.3-3ubuntu2_amd64.deb 进行安装 3、进行ftp配置即可,不动配置的可看我上一博客(https://blog.csdn.net/qq_32648289/article/details/123654639)
cd /rootgit clone https://github.com/yijixiuxin/chanlun-pro.git使用 conda 创建当前环境,并
详述了如何在Windows系统上安装Ubuntu18.04虚拟机的操作
环境:win10企业版 + ubuntu 18.04 LTS [WSL] win10安装Docker for windows 现在 Docker 有专门的 Win10 专业版系统的安装包,需要开启Hyper-V。 开启 Hyper-V 程序和功能 启用或关闭Windows功能 选中Hyper-...
1、vlc播放rtp说明: ...2、linux vlc安装: sudo apt-get install vlc dkpg默认保存路径:/var/cache/apt/archives 安装包下载路径: http://cn.archive.ubuntu.com/ubuntu/pool/universe/libc/libcddb/ ...
k8s离线文件包 Ubuntu 使用Kubeadm 离线安装k8s 参考连接 https://blog.csdn.net/u010952056/article/details/127276191?spm=1001.2014.3001.5501
1.从intel官网下载I218 for LINUX的驱动压缩包e1000e-3.3.4.tar.gz(https://downloadcenter.intel.com/download/15817) 2.ubuntu下切换到root:sudo -i 3.解压网卡驱动tar -xzvf e1000e-3.3.4.tar.gz 4.cd e1000e-...
Ubuntu安装Pintos所需两个文档:bochs-2.6.7.tar.gz 和 pintos.tar.gz。我用的安装教程链接是:https://www.cnblogs.com/crayygy/p/ubuntu-pintos.html
ubuntu安装docker 安装Docker在Ubuntu上相对简单,您可以按照以下步骤进行: 1. **更新包列表**: ```bash sudo apt update ``` 2. **安装必要的软件包,以允许apt使用HTTPS来访问Docker仓库**: ```bash sudo ...
1. Yafu安装包含gmp,gmp-ecm,msieve,yafu的安装 2. 将所需资源文件,安装脚本统合到安装资料 3. 可以通过脚本文件分步安装yafu,也...4. 参考文档 https://blog.csdn.net/weixin_42747691/article/details/122926819
安装好了Linux子系统,用户目录是/home/user,C盘目录是/mnt/c。但是这个子系统其实是在C盘上的,如果你要在上面配置一些环境可能会大量占用C盘空间,未来保证系统盘空间充足,我们还要将其迁移到非系统盘。需要一个...
NULL 博文链接:https://nigelzeng.iteye.com/blog/1465516
NULL 博文链接:https://ljl-xyf.iteye.com/blog/2231940
ubuntu 7.10安装及基本设置 博文链接:https://mqzsweet.iteye.com/blog/149848
ubuntu20.04安装ros 具体参考: https://varhowto.com/install-ros-noetic-ubuntu-20-04/ https://blog.csdn.net/qq_44339029/article/details/120579608
ubuntu本地apt方式安装ca-certificates和gnupg,此为arm架构的。 1、把对应的deb文件放到容器中,docker cp xxx 2、apt-get install ./*.deb -y
Ubuntu 安装 .NET SDK / .NET Runtime 支持 Demo for Ubuntu https://blog.csdn.net/loveric/article/details/132086925