我在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 [email protected]
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 [email protected]
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?
最佳答案
我知道了。我的证书路径错误
这是我的虚拟主机现在的样子
<VirtualHost *:443>
DocumentRoot "F:/xampp/htdocs/proj1"
ServerAdmin [email protected]
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>
关于windows - 为XAMPP启用SSL后,Apache无法启动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32233979/