Change port 443 and 80

Hi!
I need to change port 80 and 443 to something else for Nextcloud (Apache) and I just need to have my own solution confirmed or corrected.

  1. I change port 443 to 8443 in /etc/apache2/sites-available/default-ssl.conf
  2. I change port 80 to 880 in /etc/apache2/sites-available/000-default.conf
  3. I change to ‘overwrite.cli.url’ => https://exampel.ddns.com:8443/nextcloud in /var/www/nextcloud/config/config.php
  4. Open port 880 and 8443 in my router

My address to my Nextcloud will then be https://exampel.ddns.com:8443/nextcloud

Does this looks right? I know this really is a question about Apache aside from the “‘overwrite.cli.url’ =>”-bit but I hope you could confirm or correct my thinking if I’m very nice :slight_smile:

1 Like

you will have to change the port in apache.conf as well
listen 8443

Thank you for your answer!
But the rest looks right?

I could not understand exactly where I should add the port number in apache. I have a apache2.conf but dont know where to set the port number. Maybe at the end of “ServerName example.ddns.com” to “ServerName example.ddns.com:8443”?

In the apche2.conf there are referrals “ports.conf” and in that conf are port 80 and 443 set. Perhaps I need to change in ports.conf instead of apache2.conf?

I guess having your own cloud is not something for newbes. Read this how you will. i will stop asking questions here…

2 Likes

Unfortunately this is a forum supported in large by the community, so SLAs on responses can’t be offered :frowning:

What you’re asking isn’t a Nextcloud question, it’s help with Apache. That said:

  1. Edit /etc/apache2/ports.conf
    a. Change the port numbers as required or add new
  2. Edit /etc/apache2/sites-available/yournextcloud.conf
    a. Change 80/443 there to the ports in <VirtualHost *:80> (or 443) to what you specified in 1a.
  3. Restart Apache: sudo service apache2 restart
6 Likes

Hi!
to change port 80 and 443 to Nextcloud (Apache) and you need to

  1. I change port 443 to 8443 in /etc/apache2/sites-available/default-ssl.conf
  2. I change port 80 to 880 in /etc/apache2/sites-available/000-default.conf
    3.I change port 80 to 880 in /etc/apache2/sites-enabled/nextcloud.conf
    4.I change port 443 to 8443 in /etc/apache2/sites-enabled/nextcloud.conf
  3. service apache2 restart

to work

1 Like

both @JasonBayton and @Cp_Gunny steps need to be followed for this to work, i partly did some of these changes in the winadmin “apache webserver”

some of us dont just want to run nextcloud, or have more than one apache service running on our network, its a waste of resources,

feedback to nextcloud devs, please higher the amount of login attempts for winadmin, 2 and then a ban that lasts one whole hour isn’t very helpful when youre trying to set all this up