我无法在本地主机测试机上使用 https。我无法自己解决问题,所以这就是我所做的:
我将以下内容添加到 site-available 中的文件中:000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel debug
CustomLog ${APACHE_LOG_DIR}/access.log combined
默认-ssl.conf
[default-ssl.conf Pastebin Link][1]
cd /etc/apache2/mods-enabled
sudo ln -s ../mods-available/rewrite.load 重写.load
sudo /etc/init.d/apache2 restart
a2ensite 默认 ssl
但是,当尝试使用 https 时,我建议
错误代码:ERR_CONNECTION_REFUSED
端口.conf:
Listen 80
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
使用openssl s_client -connect localhost:443 </dev/null
给了我:
connect: 连接被拒绝 connect:errno=111 那么 APache 没有监听 443,但它应该基于 ports.conf?
一个建议?如果您需要更多信息,请告诉我。
更新:
[Mon Mar 09 12:01:55.092346 2015] [ssl:info] [pid 7091] AH02200: Loading certificate & private key of SSL-aware server '127.0.1.1:443'
[Mon Mar 09 12:01:55.092520 2015] [ssl:debug] [pid 7091] ssl_engine_pphrase.c(506): AH02249: unencrypted RSA private key - pass phrase not required
[Mon Mar 09 12:01:55.092532 2015] [ssl:debug] [pid 7091] ssl_engine_pphrase.c(181): AH02199: SSL not enabled on vhost 127.0.1.1:80, skipping SSL setup
[Mon Mar 09 12:01:55.092546 2015] [ssl:info] [pid 7091] AH01914: Configuring server 127.0.1.1:443 for SSL protocol
[Mon Mar 09 12:01:55.092658 2015] [ssl:debug] [pid 7091] ssl_engine_init.c(328): AH01893: Configuring TLS extension handling
[Mon Mar 09 12:01:55.092661 2015] [ssl:debug] [pid 7091] ssl_engine_init.c(836): AH02232: Configuring RSA server certificate
[Mon Mar 09 12:01:55.092705 2015] [ssl:warn] [pid 7091] AH01906: RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Mon Mar 09 12:01:55.092731 2015] [ssl:debug] [pid 7091] ssl_util_ssl.c(407): AH02412: [127.0.1.1:443] Cert does not match for name '127.0.1.1' [subject: emailAddress=asd,CN=asd,OU=asd,O=asd,L=ads,ST=asd,C=DE / issuer: emailAddress=asd,C$
[Mon Mar 09 12:01:55.092734 2015] [ssl:warn] [pid 7091] AH01909: RSA certificate configured for 127.0.1.1:443 does NOT include an ID which matches the server name
[Mon Mar 09 12:01:55.092736 2015] [ssl:debug] [pid 7091] ssl_engine_init.c(891): AH02236: Configuring RSA server private key