New domain but not working

Problem binding to port 80: Could not bind to IPv4 or IPv6.

My domain is: alama.eu | previously alamarp.tk

I ran this command: certbot certonly -d alama.eu

It produced this output:

Saving debug log to /var/log/letsencrypt/letsencrypt.log

How would you like to authenticate with the ACME CA?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press ‘c’ to cancel): 1
Plugins selected: Authenticator standalone, Installer None
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for alama.eu
Cleaning up challenges
Problem binding to port 80: Could not bind to IPv4 or IPv6.

My web server is (include version):Nginx

The operating system my web server runs on is (include version):Ubuntu 18.04

My hosting provider, if applicable, is: OmgServ | domain : ovh

I can login to a root shell on my machine (yes or no, or I don’t know): y

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):n

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):certbot 0.31.0

when i try to acces alama.eu it redirects to alamarp.tk

and btw this is my current nginx config :

 server {
     listen 80;
     server_name alama.eu;
 
     root /var/www/pterodactyl/public;
     index index.html index.htm panel.php;
     charset utf-8;
 
     location / {
         try_files $uri $uri/ /index.php?$query_string;
     }
 
     location = /favicon.ico { access_log off; log_not_found off; }
     location = /robots.txt  { access_log off; log_not_found off; }
 
     access_log off;
     error_log  /var/log/nginx/pterodactyl.app-error.log error;
 
     # allow larger file uploads and longer script runtimes
     client_max_body_size 100m;
     client_body_timeout 120s;
 
     sendfile off;
 
     location ~ \.php$ {
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
         fastcgi_pass unix:/run/php/php7.2-fpm.sock;
         fastcgi_index index.php;
         include fastcgi_params;
         fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_param HTTP_PROXY "";
         fastcgi_intercept_errors off;
         fastcgi_buffer_size 16k;
         fastcgi_buffers 4 16k;
         fastcgi_connect_timeout 300;
         fastcgi_send_timeout 300;
         fastcgi_read_timeout 300;
     }
 
     location ~ /\.ht {
         deny all;
     }
}

Hi @Maxime48,

Welcome to the community forum!

Running certbot in standalone mode as you have selected will attempt to bind to port 80 and you already have Nginx running which itself binds to port 80/443. You can verify this by running sudo netstat -plunt | grep -E '(80|443)'

What you can do instead is use the certbot nginx plugin and follow these instructions.

As for the domains, can you post ALL of the nginx vhost configuration? I see only one DNS A record for alama.eu and nothing for alamarp.tk

$ dig alamarp.tk +short

$ dig alama.eu +short
62.4.21.144

so with the netstat i have

tcp 0 0 62.4.21.144:7780 0.0.0.0:* LISTEN 6330/docker-proxy
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 8247/nginx: master
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN 847/node
udp 0 0 62.4.21.144:7780 0.0.0.0:* 6345/docker-proxy

and i used the nginx plugin and it said that everything is now ok but it still redirects me to alamarp.tk instead of http://alama.eu/

ps :
-this is my full config

and http://alama.eu/panel.php works

wait now it works , WHAT

edit :

Stop Webserver
Certbot need ports not in use

I’m glad it’s working now.

$ certs alama.eu | openssl x509 -noout -issuer -startdate -enddate
issuer=C = US, O = Let's Encrypt, CN = Let's Encrypt Authority X3
notBefore=Oct 29 14:32:15 2019 GMT
notAfter=Jan 27 14:32:15 2020 GMT

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.