美文网首页
ubuntu14.0 配置apahe2https

ubuntu14.0 配置apahe2https

作者: 拉肚 | 来源:发表于2017-01-02 13:25 被阅读53次

    1、sudo a2enmod ssl

    Considering dependency setenvif for ssl:

    Module setenvif already enabled

    Considering dependency mime for ssl:

    Module mime already enabled

    Considering dependency socache_shmcb for ssl:

    Enabling module socache_shmcb.

    Enabling module ssl.

    See /usr/share/doc/apache2/README.Debian.gz on how to configure SSL and create self-signed certificates.

    To activate the new configuration, you need to run:

    service apache2 restart

    /usr/share/doc/apache2/README.Debian.gz  中有对应的配置ssl教程

    2、修改配置/etc/apache2/sites-available/default-ssl.conf

    打开default-ssl.conf,找到这两个

    SSLCertificateFile

    SSLCertificateKeyFile

    指向对应自己的目录

    SSLCertificateFile /home/linwen/AndroidStudioProjects/https/server.crt

    SSLCertificateKeyFile /home/linwen/AndroidStudioProjects/https/server.key

    重启

    访问https://127.1.1.0/

    3、更改访问目录

    /etc/apache2/sites-available/default-ssl.conf

    DocumentRoot 更改微自己的主目录

    4、配置自己的网址

    ServerAdmin下面加上一行

    ServerName Test.com

    重启

    5、配置单一站点为https

    配置单一站点必须是先执行sudo a2enmod ssl  开启ssl模块

    <VirtualHost *:443>

    ServerName Test.com

    ServerAlias *.Test.com

    DocumentRoot /home/linwen/Apache2Workspaces/www/html/bailinong-server-v2/public

    SSLEngine on

    SSLCertificateFile /home/linwen/AndroidStudioProjects/https/server.crt

    SSLCertificateKeyFile /home/linwen/AndroidStudioProjects/https/server.key

    Options Indexes FollowSymLinks

    AllowOverride All

    Require all grantedErrorLog

    ${APACHE_LOG_DIR}/error.logCustomLog

    ${APACHE_LOG_DIR}/access.log combined

    </VirtualHost>

    然后把文件放到

    /etc/apache2/sites-available/000-default.conf

    在最后面导入

    IncludeOptional sites-available/你的名字.conf

    相关文章

      网友评论

          本文标题:ubuntu14.0 配置apahe2https

          本文链接:https://www.haomeiwen.com/subject/smewvttx.html