为 XAMPP 启用 SSL 后 Apache 无法启动
Posted
技术标签:
【中文标题】为 XAMPP 启用 SSL 后 Apache 无法启动【英文标题】:Apache won't start after enabling SSL for XAMPP 【发布时间】:2015-11-20 22:15:01 【问题描述】:我在 Windows 7 上运行 XAMPP v3.2.1。我让它在端口 80 上运行,并且可以从我的网络访问,没有任何问题。
但是,当我尝试启用 SSL 时,Apache 无法启动。
这是我为 Appache 启用 SSL 所做的工作
我打开了一个名为 https-vhosts.conf
的文件,该文件位于 F:\xamp\apache\extra
并更改了以下内容
<VirtualHost *:80>
DocumentRoot "F:/xampp/htdocs/proj1"
ServerAdmin test@localhost.com
ServerName server1.domain.com
ServerAlias server1.domain.com
<Directory "F:/xampp/htdocs/proj1">
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
到
<VirtualHost *:443>
DocumentRoot "F:/xampp/htdocs/proj1"
ServerAdmin test@localhost.com
ServerName server1.domain.com
ServerAlias server1.domain.com
SSLEngine On
SSLCertificateFile "F:/xampp/conf/ssl.crt/server.crt"
SSLCertificateKeyFile "F:/xampp/conf/ssl.key/server.key"
<Directory "F:/xampp/htdocs/proj1">
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
除了上述之外,我没有更改其他文件或设置。
这是我在 XAMPP 控制面板中得到的
11:24:25 AM [Apache] Attempting to start Apache app...
11:24:25 AM [Apache] Status change detected: running
11:24:26 AM [Apache] Status change detected: stopped
11:24:26 AM [Apache] Error: Apache shutdown unexpectedly.
11:24:26 AM [Apache] This may be due to a blocked port, missing dependencies,
11:24:26 AM [Apache] improper privileges, a crash, or a shutdown by another method.
11:24:26 AM [Apache] Press the Logs button to view error logs and check
11:24:26 AM [Apache] the Windows Event Viewer for more clues
11:24:26 AM [Apache] If you need more help, copy and post this
11:24:26 AM [Apache] entire log window on the forums
我错过了什么? 如何更正此问题并启用 SSL?
【问题讨论】:
【参考方案1】:我让它工作了。我的证书路径错误
这是我的虚拟主机现在的样子
<VirtualHost *:443>
DocumentRoot "F:/xampp/htdocs/proj1"
ServerAdmin test@localhost.com
ServerName server1.domain.com
ServerAlias server1.domain.com
SSLEngine On
SSLCertificateFile "conf/ssl.crt/server.crt"
SSLCertificateKeyFile "conf/ssl.key/server.key"
<Directory "F:/xampp/htdocs/proj1">
AllowOverride All
Order Allow,Deny
Allow from all
Require all granted
</Directory>
</VirtualHost>
【讨论】:
以上是关于为 XAMPP 启用 SSL 后 Apache 无法启动的主要内容,如果未能解决你的问题,请参考以下文章
在 ubuntu 13.10 上从 XAMPP 移动到 LAMP 后 htaccess 不起作用(在 apache linux 服务器中启用 htaccess)