Hi, Im trying to generate a certficate to my website but I cant. Someone can help me? I dont know what is my webroot
I have a Java EE Application and my company uses Wix for your website (domain and subdomain)
My Java application is using Amazon EC2.
The subdomain(from wix) point to IP of the Java Application
PS:The application was developed on another computer
I ran this command:
./letsencrypt-auto certonly --webroot -d mysubdomain.domain.com.br -d www.mysubdomain.domain.com.br
It produced this output:
aving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mysubdomain.domain.com.br
http-01 challenge for www.mysubdomain.domain.com.br
Input the webroot for mysubdomain.domain.com.br: (Enter ‘c’ to cancel):
I dont know what is my webroot
My web server is (include version):
The operating system my web server runs on is (include version):
Debian 9
My hosting provider, if applicable, is:
I can login to a root shell on my machine (yes or no, or I don’t know):
Yes
I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
You can set whereever you want as webroot, just to make sure certbot has the correct permission to it.
-------- Take a look at @jared.m’s response, ignore my response (after this line) ---------
For example, you can set the webroot to : /var/certbot_webroot (Since certbot definitely can access /var/)
But, please avoid set the webroot to : /root/ (Since certbot might not able to access)
The be a bit more specific, the webroot directory is whichever directory serves files for your website. For instance, if your domain is www.example.com, your webroot is where you would put a file (say, index.html) to access it with www.example.com/index.html. Often it’s something like /var/www/html if you’re using Apache.
For some ways of running web applications you could also imagine that there is no webroot because all URLs are mapped directly into the application (for example we see this here with people setting a blanket nginx proxy_pass for all paths).
root@debian:~/certificado/letsencrypt# ./letsencrypt-auto certonly --webroot -d mysubdomain.mydomain.com.br -d www.mysubdomain.mydomain.com.br
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator webroot, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mysubdomain.mydomain.com.br
http-01 challenge for www.mysubdomain.mydomain.com.br
Input the webroot for mysubdomain.mydomain.com.br: (Enter ‘c’ to cancel): /opt
Select the webroot for www.mysubdomain.mydomain.com.br:
To fix these errors, please make sure that your domain name was
entered correctly and the DNS A/AAAA record(s) for that domain
contain(s) the right IP address.
So, the configuration of Glassfish either serves static files directly from the filesystem somehow, or doesn't do this. If it does, then you need to look at the Glassfish configuration to find out where they are served from. If it doesn't, then you need to configure Glassfish so that it does this.
As an alternative, you can also use the --standalone method instead of --webroot. This creates a temporary web server to pass the challenges. It would probably require stopping Glassfish temporarily and restarting it afterward.
(Se quiser, também falo português do Brasil, caso isso ajudar nessa conversa.)
Antes eu tentei com --standalone, mas me retornou o seguinte:
Problem binding to port 80: Could not bind to IPv4 or IPv6.
Eu tentei antes de parar e depois que eu parei
Então se eu usar a linha de comando do computador do ec2 deve dar certo, pois neste computador não tem o glassfish e nem a minha aplicação, o que você acha?
Agora acho que me confundi quanto aos vários servidores. Qual o servidor que já tem o Glassfish e onde está? Em qual servidor está pedindo o certificado com o Certbot?
Geralmente essa mensagem indica que já existe outro processo (tipo Apache, nginx, Glassfish, ou outro) aceitando conexões em porta 80. Tem certeza de já ter parado o Glassfish antes de usar certbot --standalone?
É possível que existe um processo nginx como proxy, por exemplo com proxy_pass, para repassar cada conexão ao Glassfish? Não sei qual a configuração mais comum com o Glassfish mas desenvolvidores de aplicações web em muitos outros ambientes usaram nginx dessa forma. (nginx aceita a conexão em porta 80 e/ou 443, e repassa para localhost em outra porta que contém o processo da aplicação web em si.)
Se não tem certeza, talvez pode determinar qual o outro processo já ocupando porta 80 com netstat -nta | grep :80 ou algo parecido.
Faria mais sentido pedí-lo diretamente no servidor da Amazon porque a autoridade certificadora precisa conectar-se ao servidor para confirmar que a entidade pedindo o certificado realmente tem controle sobre o domínio. O Certbot não tem opção muito conveniente para configurar um servidor remoto para esse procedimento de verificação.
É a segunda vez em que tentou fazê-lo com certbot --standalone? Esse processo Python parece uma tentativa prévia (!) com o Certbot, mas normalmente não continua ocupando a porta após o fim da execução do Certbot. Talvez deveria terminar o processo com kill 8739, mas não sei direito porque ele ainda existe.