树莓派/Debian “无法定位软件包 mod_ssl” 问题解决方案
<h1 id="树莓派debian-无法定位软件包-mod_ssl-问题解决方案">树莓派/Debian “无法定位软件包 mod_ssl” 问题解决方案</h1><h2 id="一前言">一、前言</h2>
<p>对于使用 OpenSSL 来加载第三方 SSL 证书来实现 HTTPS 安全连接实现的方法来说,CentOS、Ubuntu 等与 Debian 的实现方法并不一样。</p>
<ul>
<li>
<p>对 CentOS、Ubuntu 等 Linux 发行版来说,使用 OpenSSL 来加载第三方 SSL 证书来实现 HTTPS 安全连接,可以参考 ownCloud 社区的文档:</p>
<p> Configure Apache with Let’s Encrypt</p>
</li>
<li>
<p>问题描述:</p>
<pre><code class="language-shell">yogile@debyogile:~$ SSLOpenSSLConfCmd DHParameters /etc/apache2/dh4096.pem
sudo: SSLOpenSSLConfCmd:找不到命令
</code></pre>
<p>或</p>
<pre><code class="language-shell">yogile@debyogile:~$ sudo apt install mod_ssl
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
E: 无法定位软件包 mod_ssl
</code></pre>
</li>
</ul>
<h2 id="二问题回答">二、问题回答</h2>
<ul>
<li>
<p>如前言所述:对于使用 OpenSSL 来加载第三方 SSL 证书来实现 HTTPS 安全连接实现的方法来说,CentOS、Ubuntu 等与 Debian 的实现方法并不一样,也在于对于 Apache 模块的管理两方不一样。</p>
</li>
<li>
<p>在 CentOS、Ubuntu 等之中,<code>SSLOpenSSLConfCmd</code> 命令依赖于 Apache 的模块 <strong>mod_ssl</strong> 。</p>
<p>但是对于 Apache 模块,管理其模块是通过 <strong>yum</strong> 实现的,而不是 Debian 的 <strong>apt</strong> 。</p>
</li>
</ul>
<h2 id="三解决方案">三、解决方案</h2>
<p>通过以下命令加载 <strong>ssl</strong> 模块:</p>
<pre><code class="language-shell">sudo a2enmod ssl
</code></pre>
<p>再通过重启 Apache 启用 <strong>ssl</strong> 模块:</p>
<pre><code class="language-shell">sudo /etc/init.d/apache2 restart
或
sudo service apache2 restart
</code></pre>
<p>Debian 下 Apache 其实已经准备好了类似 <strong>mod_ssl</strong> 的模块:<strong>ssl</strong> 。</p>
<p>在 <strong><code>/etc/apache2/mods-available/</code></strong> 文件夹下,有着非常多的 Apache 模块,只是没有加载启用。而已经启用的模块软链接到 <strong><code>/etc/apache2/mods-enabled/</code></strong> 文件夹下。</p>
<p>这时,输入 <code>ls /etc/apache2/mods-enabled/</code> 就可以看到 <strong>ssl</strong> 模块被加载:</p>
<pre><code class="language-shell">yogile@debyogile~$ ls /etc/apache2/mods-enabled
access_compat.loadautoindex.confmime.load setenvif.conf
alias.conf autoindex.loadmpm_prefork.confsetenvif.load
alias.load deflate.conf mpm_prefork.loadsocache_shmcb.load
auth_basic.load deflate.load negotiation.confssl.conf
authn_core.load dir.conf negotiation.loadssl.load
authn_file.load dir.load php7.3.conf status.conf
authz_core.load env.load php7.3.load status.load
authz_host.load filter.load reqtimeout.conf
authz_user.load mime.conf reqtimeout.load
</code></pre><br><br>
来源:https://www.cnblogs.com/Yogile/p/12495147.html
頁:
[1]