如何使用https? [英] How to use https?

查看:274
本文介绍了如何使用https?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果在服务器上,我们已经设置/配置了SSL证书,我怎样才能使用安全页面制作我的网站?只需将linke设为 https://example.com/etc.php

If on the server, we already setup/configured the SSL certificate, how could I make my websites using secure page? Just make the linke to https://example.com/etc.php?

谢谢!

推荐答案

必须要做两件事。


  1. 你需要正确设置ssl证书,这听起来像你有

  2. 正如其他评论员所说,这取决于您使用的是哪个网络服务器。更有可能的是,apache:

Apache:

你会需要修改apache设置以支持您网站的https版本。如果您使用Apache2的现代安装与虚拟主机,通常会有一个站点可用目录,其中每个域都存在单独的配置文件。对于同时具有http和https(80和443)的域,你会做这样的事情,假设apache正在监听127.0.0.1(大多数apache安装都不会这样,所以一定要改变ip )。不言而喻,您需要更改以下内容中的路径和域名:

You'll need to modify the apache settings to support the https version of your site. If you're using a modern installation of Apache2 with virtual hosts, usually there will be a "sites-available" directory where individual config files exists for each domain. For a domain that will have both http and https (80 and 443), you would do something like this, assuming apache is listening on 127.0.0.1 (this would not be the case for most apache installations, so be sure to change the ip). It also goes without saying that you need to change the paths and domain name in the following:

<VirtualHost 127.0.0.1:80>
  ServerAdmin somebody@domain.com
  ServerName somebody.com
  ServerAlias www.somebody.com
  DocumentRoot /home/somebody/www
  <Directory "/home/somebody/www">
        Options FollowSymLinks
        AllowOverride All
        Options -Indexes
  </Directory>
  ErrorLog /home/logs/somebody.error.log
  CustomLog /home/logs/somebody.access.log combined
</VirtualHost>
<VirtualHost 127.0.0.1:443> SSLEngine On SSLCertificateFile /etc/apache2/ssl/something.crt SSLCertificateKeyFile /etc/apache2/ssl/something.key SSLCertificateChainFile /etc/apache2/ssl/gd_bundle.crt ServerAdmin somebody@something.com ServerName somebody.com ServerAlias www.somebody.com DocumentRoot /home/somebody/www <Directory "/home/somebody/www"> Options FollowSymLinks AllowOverride All Options -Indexes </Directory> ErrorLog /home/logs/somebody.ssl.error.log CustomLog /home/logs/somebody.ssl.access.log combined </VirtualHost>

如果你使用的是nginx,你需要有一个类似的双块:80和:443。查看80已有的块并查阅其文档:

If you are using nginx, there is a similar dual block you'll need to have for :80 and :443. Look at the block you already have for 80 and consult their documentation:

http://nginx.org/en/docs/http/configuring_https_servers.html

您可能也在使用iis,在这种情况下,这是版本7的说明:

You may also be using iis, in which case, here are the instructions for version 7:

如何在IIS 7中为SSL配置站点?

这篇关于如何使用https?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆