AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • Início
  • system&network
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • Início
  • system&network
    • Recentes
    • Highest score
    • tags
  • Ubuntu
    • Recentes
    • Highest score
    • tags
  • Unix
    • Recentes
    • tags
  • DBA
    • Recentes
    • tags
  • Computer
    • Recentes
    • tags
  • Coding
    • Recentes
    • tags
Início / user-29205

therobyouknow's questions

Martin Hope
therobyouknow
Asked: 2025-03-22 06:15:12 +0800 CST

Por que o Apache está escutando na porta 80 do servidor habilitado para SSL?

  • 5

Configurei um vhost para um domínio na porta 80:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName thesolentmetropolitan.com
    DocumentRoot /var/www/10/thesolentmetropolitan.com/deployment_environments/live/docroot
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    <Directory "/var/www/thesolentmetropolitan.com/docroot">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
    </Directory>
</VirtualHost>

A visita ao site resulta em:

Pedido ruim

Seu navegador enviou uma solicitação que este servidor não conseguiu entender. Motivo: Você está falando HTTP simples para uma porta de servidor com SSL habilitado. Em vez disso, use o esquema HTTPS para acessar esta URL, por favor. Servidor Apache/2.4.58 (Ubuntu) em 127.0.1.1 Porta 80

Desabilitei todas as outras permutações de vhost https http, www e sem www.

Verifiquei o seguinte (não tenho certeza do que fazer com o seguinte):

sudo lsof -i -n | grep https
apache2   520640            root    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520645        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520662        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520705        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520706        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520707        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520708        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520741        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520743        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520981        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)
apache2   520982        www-data    6u  IPv6 4829014      0t0  TCP *:https (LISTEN)

e verifiquei outros vhosts.

root@server03:/etc/apache2/sites-available# apachectl -S
AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
VirtualHost configuration:
*:443                  is a NameVirtualHost
         default server drupalsolent.dev (/etc/apache2/sites-enabled/drupalsolent.dev-le-ssl.conf:2)
         port 443 namevhost drupalsolent.dev (/etc/apache2/sites-enabled/drupalsolent.dev-le-ssl.conf:2)
         port 443 namevhost www.drupalsolent.dev (/etc/apache2/sites-enabled/drupalsolent.dev-le-ssl.conf:21)
         port 443 namevhost eval1.labs.drupalsolent.dev (/etc/apache2/sites-enabled/eval1.labs.drupalsolent.dev-le-ssl.conf:2)
         port 443 namevhost internationalgospelchoir.uk (/etc/apache2/sites-enabled/internationalgospelchoir.uk-le-ssl.conf:2)
         port 443 namevhost staging.internationalgospelchoir.uk (/etc/apache2/sites-enabled/staging.internationalgospelchoir.uk-le-ssl.conf:2)
         port 443 namevhost www.internationalgospelchoir.uk (/etc/apache2/sites-enabled/www.internationalgospelchoir.uk-le-ssl.conf:2)
*:80                   is a NameVirtualHost
         default server drupalsolent.dev (/etc/apache2/sites-enabled/drupalsolent.dev.conf:1)
         port 80 namevhost drupalsolent.dev (/etc/apache2/sites-enabled/drupalsolent.dev.conf:1)
         port 80 namevhost eval1.labs.drupalsolent.dev (/etc/apache2/sites-enabled/eval1.labs.drupalsolent.dev.conf:1)
         port 80 namevhost internationalgospelchoir.uk (/etc/apache2/sites-enabled/internationalgospelchoir.uk.conf:1)
         port 80 namevhost staging.internationalgospelchoir.uk (/etc/apache2/sites-enabled/staging.internationalgospelchoir.uk.conf:1)
         port 80 namevhost thesolentmetropolitan.com (/etc/apache2/sites-enabled/thesolentmetropolitan.com.conf:1)
         port 80 namevhost www.drupalsolent.dev (/etc/apache2/sites-enabled/www.drupalsolent.dev.conf:1)
         port 80 namevhost www.internationalgospelchoir.uk (/etc/apache2/sites-enabled/www.internationalgospelchoir.uk.conf:1)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www/html"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling-refresh: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/run/apache2/" mechanism=default
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
root@server03:/etc/apache2/sites-available#

outras informações para análise:

root@server03:/etc/apache2/sites-available# cat drupalsolent.dev.conf
<VirtualHost *:80>
  ServerName drupalsolent.dev
  RedirectPermanent / https://drupalsolent.dev/
</VirtualHost>

Tentei o domínio em diferentes redes: fixa e móvel, o mesmo erro, então acho que deve ser algo no servidor.

O que poderia ser?

Preciso resolver esse problema porque me conecto na porta 80 para que o LetsEncrypt forneça um certificado https.

Obrigado pela ajuda.

Eu dei uma olhada em Servir a porta 443 por http cria o erro 400 Bad Request em vez de redirecionar, que tem algumas semelhanças, mas não é bem o que estou procurando.

apache-2.4
  • 1 respostas
  • 108 Views

Sidebar

Stats

  • Perguntas 205573
  • respostas 270741
  • best respostas 135370
  • utilizador 68524
  • Highest score
  • respostas
  • Marko Smith

    Você pode passar usuário/passar para autenticação básica HTTP em parâmetros de URL?

    • 5 respostas
  • Marko Smith

    Ping uma porta específica

    • 18 respostas
  • Marko Smith

    Verifique se a porta está aberta ou fechada em um servidor Linux?

    • 7 respostas
  • Marko Smith

    Como automatizar o login SSH com senha?

    • 10 respostas
  • Marko Smith

    Como posso dizer ao Git para Windows onde encontrar minha chave RSA privada?

    • 30 respostas
  • Marko Smith

    Qual é o nome de usuário/senha de superusuário padrão para postgres após uma nova instalação?

    • 5 respostas
  • Marko Smith

    Qual porta o SFTP usa?

    • 6 respostas
  • Marko Smith

    Linha de comando para listar usuários em um grupo do Windows Active Directory?

    • 9 respostas
  • Marko Smith

    O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL?

    • 3 respostas
  • Marko Smith

    Como determinar se uma variável bash está vazia?

    • 15 respostas
  • Martin Hope
    Davie Ping uma porta específica 2009-10-09 01:57:50 +0800 CST
  • Martin Hope
    kernel O scp pode copiar diretórios recursivamente? 2011-04-29 20:24:45 +0800 CST
  • Martin Hope
    Robert ssh retorna "Proprietário incorreto ou permissões em ~/.ssh/config" 2011-03-30 10:15:48 +0800 CST
  • Martin Hope
    Eonil Como automatizar o login SSH com senha? 2011-03-02 03:07:12 +0800 CST
  • Martin Hope
    gunwin Como lidar com um servidor comprometido? 2011-01-03 13:31:27 +0800 CST
  • Martin Hope
    Tom Feiner Como posso classificar a saída du -h por tamanho 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich O que é um arquivo Pem e como ele difere de outros formatos de arquivo de chave gerada pelo OpenSSL? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent Como determinar se uma variável bash está vazia? 2009-05-13 09:54:48 +0800 CST

Hot tag

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • Início
  • Perguntas
    • Recentes
    • Highest score
  • tag
  • help

Footer

AskOverflow.Dev

About Us

  • About Us
  • Contact Us

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve