The program apache2 (process ID 31582) is already listening on TCP
port 80. This will prevent us from binding to that port. Please stop
the apache2 program temporarily and then try again.
I had to stop Apache, run LE, and start Apache again. This isn't acceptable in a production environment.
If there's another method I can use to generate the certificates, it should be the default behaviour.
You could use the docker version and change your apache configuration to proxy the verification requests to the webserver running in the docker container.
Also take a look at the webroot and manual modes in the documentation
webroot: (âwebroot-path should be pointed to your public_html) you specify a directory where the files for verification are added by the client without starting a webserver at all
manual: (-a manual) Requires to copy and paste commands into a new terminal session. Allows to run client on machine different than target webserver, e.g. your laptop.
@letâs encrypt dev-team:
why not using a less essential port (e.g. 81 or 82) to provide the challenge code?
Sure this will need some firewall and routing config, but in that case we could use the well-working standalone client for cert renewal while keeping our e.g. apache running for ports 80 and 443.
Just generated my first cert and this is really intrusive, it doesnât bind to a single IP either so if you have multiple webservers bound to different IPs then it forces you to close those too.
Having the ability to bind to another port would be a great idea.
Note: you may want to change 9999 to a different value
make sure apache modules mod_proxy and mod_proxy_http are enabled
a2enmod proxy proxy_http
add the following to the mod_proxy config file (usually /etc/apache2/mods-enabled/proxy.conf)
<IfModule mod_proxy.c> ProxyPass "/.well-known/acme-challenge/" "http://127.0.0.1:9999/.well-known/acme-challenge/" retry=1 ProxyPassReverse "/.well-known/acme-challenge/" "http://127.0.0.1:9999/.well-known/acme-challenge/" <Location "/.well-known/acme-challenge/"> ProxyPreserveHost On Order allow,deny Allow from all Require all granted </Location> </IfModule>
if you have a local firewall running: make sure it won't block access from localhost to localhost:9999
run letsencrypt-auto with the http port set to 9999
That way your standard apache will recognize the request from the letsencrypt server and forward it to the letsencrypt client if it's running.
Note: if the letsencrypt client is not running your local apache will recognize that during the proxy call and re-try to contact the local letsencrypt client only after a timeout of a minute. You can find a corresponding error message in the log. So if you try to "test" the setup using your browser make sure to wait a minute before actually running the letsencrypt client.
Again: If you manually call an url beginning with /.well-known/acme-challenge/ without having a letsencrypt client running at that moment and you then do not wait for a minute afterward => then the letsencrypt server may not be able to contact the letsencrypt client.
So just don't manually try to load an url beginning with /.well-known/acme-challenge/ and apache won't block the request from the letsencrypt server.
Added parameter retry=1 so this should not be an issue anymore
Thank you for your help.
But in my case, I have to use 2 servers because LE is not supported by my nas so.
My nas (syno) has a reverse proxy and redirects http requests on the port 9999 of my second server (ubuntu)
On this server, I execute LE with your paramaters.
But it doesnât work and failed with :
âFailed authorization procedure. www.domaine.fr (http-01): connection :: The server could not connect to the client for DV :: Could not connect to http://www.domaine.fr/.well-known/acme-challenge/Ktk5ca5PLu7IZi2Uh4Duo1grTt9_0P8g406b7gTnx48â
[quote=âc0ba, post:13, topic:2739â]
Itâs very inconvinient that you have to stop your web server to use acme.
[/quote] thatâs why i use webroot authentication plugin
For letsencrypt clientâs webroot authentication plugin see
After following this, LE stops complaining about port 80 but still complains about 443. How can this be improved, so that I can use LE without stopping apache on port 80/443?
guys.
this is meant as an howto so that people can easily find out how to go on if they receive the error message âLE client needs to bind to port 80, which Iâm already usingâ
youâre now writing about totally different things but thatâs just not fair for other users.
they will have a hard time now to find the guide above in this thread now.
if you have questions, ask them publicly on a new thread.
if you want to have a private chat, i propose to start one with each other.
you may want to delete your messages above to clean up this.
thanks.