Change port 443 and 80

#1

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:

#2

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

#3

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

#4

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?

Nextcloud install - port 80 blocked by bitwarden
#5

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

2 Likes
#6

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
3 Likes