У меня работает apache2.Я также запустил:
sudo a2enmod ssl
Я не могу загрузить свой веб-сайт, используя https, но это нормально с обычным http.В Firefox:
SSL_ERROR_RX_RECORD_TOO_LONG
В Chrome:
ERR_SSL_PROTOCOL_ERROR
netstat -lp:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 *:ssh *:* LISTEN 168/sshd
tcp6 0 0 [::]:http [::]:* LISTEN 2021/apache2
tcp6 0 0 [::]:ssh [::]:* LISTEN 168/sshd
tcp6 0 0 [::]:https [::]:* LISTEN 2021/apache2
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 139167163 1/init /run/systemd/private
unix 2 [ ACC ] SEQPACKET LISTENING 139167175 1/init /run/udev/control
unix 2 [ ACC ] STREAM LISTENING 139167182 1/init /run/systemd/journal/stdout
/ etc / apache2 / sites-available / 000-default.conf
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/example-dot-com/build
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Redirect permanent / https://example.com/
</VirtualHost>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
/ etc / apache2 / sites-available / default-ssl.conf:
<IfModule mod_ssl.c>
<VirtualHost _default_:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html/example-dot-com/build
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /var/www/website_ssl_files/example.com.crt
SSLCertificateKeyFile /var/www/website_ssl_files/example.com.key
SSLCertificateChainFile /var/www/website_ssl_files/example.com-starfield.crt
<FilesMatch "\.(cgi|shtml|phtml|php)$">
SSLOptions +StdEnvVars
</FilesMatch>
<Directory /usr/lib/cgi-bin>
SSLOptions +StdEnvVars
</Directory>
</VirtualHost>
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
apachectl -S:
VirtualHost configuration:
*:80 server.example.com (/etc/apache2/sites-enabled/000-default.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
Mutex watchdog-callback: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33
netstat -lntp:
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 168/sshd
tcp6 0 0 :::80 :::* LISTEN 2446/apache2
tcp6 0 0 :::22 :::* LISTEN 168/sshd
tcp6 0 0 :::443 :::* LISTEN 2446/apache2
tcp6 0 0 :::443 :::* LISTEN 2446/apache2
tcp6 0 0 :::443 :::* LISTEN 2446/apache2
Я использую Linux VSP с использованием Ubuntu 16.04 Версия сервера: Apache / 2.4.18 (Ubuntu)