Change port of owncloud

Hi!

I wanted to change the port of owncloud from 80/443 to another port, since they are occupied. In which configuration files should I change the port. I changed it in /etc/httpd/conf/httpd.conf in the Listen field, but I didn’t work. So I guess I have to change in other files aswell right?

Thanks!

Please create your OWN VIrtualhost with Listen 8888 parameter :slight_smile:

I suppose NethServer is not your gateway.
In this case I suggest to create a port forward from another port, example: from port 8080 of you gateway to port 80 of NS.

1 Like

You mean in the /etc/httpd/nethserver.d right?

Nope, you need to create custom template for

/etc/httpd/conf/httpd.conf

mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf

vi /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/80I_vhosts

Listen 8888
NameVirtualHost *:8888

<VirtualHost 0.0.0.0:8888>
            ServerAdmin nas@
            ServerName mail.artiko.ua
           <Directory /var/www/html/owncloud>
            AllowOverride All
            php_flag magic_quotes_gpc off
          </Directory>
</VirtualHost>

Than run

signal-event nethserver-httpd-update

DO not forget about firewall :slight_smile:

Please before digging into template-custom and changing the default httpd configuration, @craaaft share your environment configuration.

There is no reason to change the httpd port on NS if there isn’t another service running on port 80.

We have a router as default gateway and a server. Port 80/443 is already used by another server (Windows Server) that belongs to someone else. So I wanted to use Port 666 as the ownCloud port. I already configured Port Forwarding on the Router.

This is a very common scenario, you don’t need to change any port on NS.
Simply create a port forward with a different source port than 80/443.
Example:

  • gateway:8080 → ns:80
  • gateway:8443 → ns:443

Then you will be able to access ownCloud installation from you public IP on port 8080 and 8443.

Where can I do those configurations?

Oh I see now - didn’t have the firewall package installed.

You have to change the port forward into your router/gateway, not on NS.

Ok so I checked and you can’t do such a configuration on the router we have. I guess I will try out @Nas idea.

Are you sure there aren’t any advanced options available, it’s the rare, crappy router that doesn’t allow forwarding to alt ports.

You can also create port forward on nethserver itself.
external:8443 -> nethserver:8843 -> localhost:443

We should provide all possible solutions and then topic starter can choose which suits him most.

We should not criticize equipment; not all people can afford the hi-end equipment.

1 Like

Seriously?

Do you mean in the Port Forwarding register after installing the firewall?

Yes, actually it can be done with internal NS firewall.

The port forward chain looks like this at the moment
router:8843 -> nethserver:8843 -> localhost:443

OK, it works now - I just added the public ip to the trusted domains. It is pretty slow though - might be because of my slow internet connection. I will check it out later.