我正在尝试使用自签名证书为 SSL 设置一个 Apache 网站。我设置了,vhost
一切看起来都很好。但是该网站没有启动,服务器本身的端口443
没有监听。
VHOST 配置:
<VirtualHost *:443>
SSLEngine On
SSLCertificateFile /etc/pki/tls/certs/beta.jokefire.com.crt
SSLCertificateKeyFile /etc/pki/tls/private/beta.jokefire.com.key
#SSLCACertificateFile /etc/pki/tls/certs/root-certificate.crt #If using a self-signed certificate or a root certificate provided by ca-certificates, omit this line
ServerAdmin [email protected]
ServerName beta.jokefire.com
DocumentRoot /var/www/jf-beta
ErrorLog logs/jf_beta.jokefire.com_ssl_error_log
CustomLog logs/jf_beta.jokefire.com_ssl_access_log combine
</VirtualHost>
我正在监听端口80
,但没有监听端口443
:
[root@web1:~] #lsof -i :80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
httpd 14489 root 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14490 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14497 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14497 apache 27u IPv6 1575659779 0t0 TCP web1.jokefire.com:http->37.151.164.13.megaline.telecom.kz:54674 (ESTABLISHED)
httpd 14498 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14499 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14499 apache 27u IPv6 1575659460 0t0 TCP web1.jokefire.com:http->7.bl.bot.semrush.com:23728 (ESTABLISHED)
httpd 14501 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14502 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14525 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14541 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
httpd 14542 apache 4u IPv6 1575659387 0t0 TCP *:http (LISTEN)
[root@web1:~] #lsof -i :443
[root@web1:~] #
这是我的证书、密钥和目录:
[root@web1:~] #ls -lh /etc/pki/tls/certs/beta.jokefire.com.crt /etc/pki/tls/certs/beta.jokefire.com.crt
-rw-------. 1 root root 1.5K Oct 17 16:14 /etc/pki/tls/certs/beta.jokefire.com.crt
-rw-------. 1 root root 1.5K Oct 17 16:14 /etc/pki/tls/certs/beta.jokefire.com.crt
[root@web1:~] #ls -ld /etc/pki/tls/certs /etc/pki/tls/private/
drwx------. 2 root root 4096 Oct 17 16:20 /etc/pki/tls/certs
drwx------. 2 root root 4096 Oct 17 16:13 /etc/pki/tls/private/
并且我在 apache 中定义的 SSL 日志文件vhost
位于文件系统上,但它们是空的:
[root@web1:~] #ls -lh /var/log/httpd/jf_beta.jokefire.com_ssl_access_log /var/log/httpd/jf_beta.jokefire.com_ssl_error_log
-rw-r--r--. 1 root root 0 Oct 17 16:36 /var/log/httpd/jf_beta.jokefire.com_ssl_access_log
-rw-r--r--. 1 root root 0 Oct 17 16:36 /var/log/httpd/jf_beta.jokefire.com_ssl_error_log
我究竟做错了什么?