Question

Apache Continually Resetting To Port 443

I’ve encountered an issue with my website that I can’t seem to find a solution for, after multiple days of searching. In order to run the website, ports 80 and 443 need to be free. Apache uses those ports as a default, so that creates a conflict that causes the website to not go up. I’ve gotten Apache to switch ports from 80 to 8081, but when I try the same thing with port 443 (switching to port 9090), it continually resets back to 443. It’s driving me up the wall!

I’m very much a beginner with Linux and website code as a whole, so please be patient with me- if it comes down to it, I can try to make the website itself listen to a different port, but that’s a process I don’t even know how to begin. Both ports should be open and functional- port 8081 is for certain.

I don’t know what logs would be relevant here, but I’d be happy to fetch whatever’s needed. Currently, it’s running on Debian 9. This whole issue started when ACME v1 was shut down and I updated to ACME v2- beforehand I barely had to touch the code on my site at all, as it was a fork of a now-abandoned project. Which does mean I don’t know it as well as I likely should… Whoops.

Thank you so much for taking the time to look at my question, and apologies in advance if I miss something obvious! Any advice at all is greatly appreciated


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @novabee,

First, let me know why do you want Apache to listen on other ports rather than 80 and 443. I mean don’t your websites use Apache or you are using NodeJS or something different?

Regarding Apache and listening port 443 and 80:

Replace the Listen directives in your apache config. The config should contain line like

Listen 80
Listen 443

Apache will listen on the ports defined with these configuration options. Replace them, and Apache will listen on a different port.

However, you still need to tell Apache what to serve on the ports above. Suppose you want Apache to start listening on port 8080 (plain), and 4433 (ssl). Then you need to replace the Listen directives to

Listen 8080
Listen 4433

After this if you have any VirtualHosts for your domains you need to edit them as well. Go to /etc/apache2/sites-enabled/ and in each file edit the lines where it says it’s listening on the old ports. Save the configurations and restart Apache.