HTTPS funktioniert nur auf localhost
Ich versuche, https auf einer meiner EC2-Instanzen einzurichten. Ich habe das schon oft gemacht, aber aus irgendeinem Grund funktioniert es in diesem Fall nicht.
Proble
Wenn ich über die lokale IP-Adresse eine Verbindung zur Domain herstelle, funktioniert https einwandfrei. Wenn ich über die öffentliche IP-Adresse eine Verbindung zur Domain herstelle, wird dashttps funktioniert nicht und die Browser-Antwort lautet "ERR CONNECTION REFUSED"
Wenn ich manchmal neu lade, kann man sehen, dass es das https akzeptiert und es dann sofort blockiert, fast so, als gäbe es eine Firewall-Regel, aber es gibt keine.
normal http funktioniert zu 100% lokal und öffentlich.
Ich blockiere derzeit keine Ports über Sicherheitsgruppen auf amazon. Ich habe keine Regeln für IP-Tabellen und ich habe ufw deaktiviert.
Ich habe SSL für Apache aktiviert und die Testschlüssel funktionieren lokal einwandfrei.
Dies ist die Ausgabe von sudo netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 937/sshd
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1060/mysqld
tcp6 0 0 :::22 :::* LISTEN 937/sshd
tcp6 0 0 :::443 :::* LISTEN 2798/apache2
tcp6 0 0 :::80 :::* LISTEN 2798/apache2
Dies ist meine /etc/apache2/ports.conf Datei:
Listen 80
Listen 443
Ich habe die Standard-SSL-Site ohne Fehler aktiviert.
Dies ist meine / etc / hosts-Datei:
127.0.0.1 localhost
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
Ich habe auch versucht, 0.0.0.0 anstelle von 127.0.0.0 zu verwenden, und es hat nichts getan.
Dies ist die Conf-Datei meiner Website für Apache (ich habe aus Sicherheitsgründen meinen echten Site-Namen durch "mysite.com" ersetzt):
<VirtualHost *:80>
DocumentRoot /var/www/html/mysite.com
ServerName mysite.com
ServerAlias www.mysite.com
<Directory /var/www/html/mysite.com>
AllowOverride All
RewriteEngine On
Require all granted
Options -Indexes +FollowSymLinks
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
<VirtualHost *:443>
DocumentRoot /var/www/html/mysite.com
ServerName mysite.com
ServerAlias www.mysite.com
SSLEngine on
SSLCertificateFile /usr/local/ssl/public.crt
SSLCertificateKeyFile /usr/local/ssl/private/private.key
SSLCACertificateFile /usr/local/ssl/intermediate.crt
</VirtualHost>
Diese genau gleiche conf-Datei hat auf einer anderen Instanz funktioniert, was darauf hinweist, dass das Problem nicht bei dieser Datei liegt.
Was vermisse ich ? Hilfe bitte. Danke im Vorau
BEARBEITEHier sind meine geladenen Module für Apache:
sudo apache2ctl -M
Loaded Modules:
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_prefork_module (shared)
negotiation_module (shared)
php5_module (shared)
rewrite_module (shared)
setenvif_module (shared)
socache_shmcb_module (shared)
ssl_module (shared)
status_module (shared)
wsgi_module (shared)
EDIT 2Einige interessante apache error.log-Einträge, nicht, wenn ich den Dienst neu gestartet habe, nur zufällig ein paar Minuten zuvor (könnte dies die Ursache für die Probleme sein?):
[Wed Feb 17 21:04:48.478106 2016] [ssl:warn] [pid 3629] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Wed Feb 17 21:04:48.507277 2016] [ssl:warn] [pid 3630] AH02292: Init: Name-based SSL virtual hosts only work for clients with TLS server name indication support (RFC 4366)
[Wed Feb 17 21:04:48.507324 2016] [:warn] [pid 3630] mod_wsgi: Compiled for Python/3.4.0.
[Wed Feb 17 21:04:48.507329 2016] [:warn] [pid 3630] mod_wsgi: Runtime using Python/3.4.3.
[Wed Feb 17 21:04:48.509502 2016] [mpm_prefork:notice] [pid 3630] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.14 OpenSSL/1.0.1f mod_wsgi/3.4 Python/3.4.3 configured -- resuming normal operations
[Wed Feb 17 21:04:48.509517 2016] [core:notice] [pid 3630] AH00094: Command line: '/usr/sbin/apache2'
Ich habe das wsgi-Modul deaktiviert, um sicherzustellen, dass dies nicht mein Problem ist, und den Apache-Dienst neu gestartet. Trotzdem kein Glück, dasselbe Problem.
EDIT 3Ich gebe einige meiner phpinfo () aus, um weitere Informationen anzuzeigen. SSL ist auf YES gesetzt. Ich habe keine Ahnung, was los ist :
EDIT 4Ich denke, dass ich möglicherweise das SSL-Zertifikat auf dem Load Balancer hinzufügen muss, damit dies überhaupt funktioniert. Ich versuche das jetzt, lass es alle wissen ...