Antonio Ruiz's picture

Hi, i want to change the port where listen owncloud, 80 --> 8080

I did changes on ports.conf, sites-available and sites-enables, but no work.

Where is the problem?

Thanks very much.........

Forum: 
Jeremy Davis's picture

Apache needs to be restarted for config changes to be applied. So:

systemctl restart apache2

Also FWIW, the files in site-enabled should be simply symlinks to the relevant (same name) files in sites-available.

Antonio Ruiz's picture

First:   Thanks very much for answer me

/etc/apache2/ports.conf

Listen 8080

<IfModule ssl_module>
        Listen 443
</IfModule>

<IfModule mod_gnutls.c>
        Listen 443
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
Listen 12322

=============================================

etc/apache2/sites-avalaible

<VirtualHost *:8080>

==============================================

etc/apache2/owncloud.conf

ServerName localhost

<VirtualHost *:8085>
    UseCanonicalName Off
    ServerAdmin webmaster@localhost
    DocumentRoot /usr/share/owncloud/

    RewriteEngine On
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>

=======================================

etc/apahe2/sites-enabled

root@OnwCloud .../apache2/sites-enabled# ls -l
total 0
lrwxrwxrwx 1 root root 31 May 20 06:36 adminer.conf -> ../sites-available/adminer.conf
lrwxrwxrwx 1 root root 32 May 20 06:36 owncloud.conf -> ../sites-available/owncloud.conf

 

 

Antonio Ruiz's picture

where you see 8085 is 8080 excuse me

Jeremy Davis's picture

There is a rewrite rule that is redirecting to HTTPS (i.e. port 443). If you want to use port 8080 (without encryption - which is insecure under most circumstance). then you'll need to remove the 2 lines that cause the redirection. I.e. replace these 2 lines:

    RewriteEngine On
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

With this line:

    DocumentRoot /usr/share/owncloud/

Don't forget to restart Apache after making your changes!

Having said that, if you are using ownCloud via the internet without HTTPS and not behind a reverse proxy (which does have HTTPS), then access via plain HTTP is a REALLY BAD idea! Anyone could intercept the traffic, including your username and password (which would be transmitted in plain text if it isn't over HTTPS).

Regardless, you'll also need to add the new address that you plan to access ownCloud from in /usr/share/owncloud/config/config.php.

Antonio Ruiz's picture

Thanks very much Jeremy for you attention.

how you say is not secure. BUT .......

is possible that work on  port 8080 and https. ??

Note Sorry but i am a noob ......... Thank very very much for your patience.........

 

Jeremy Davis's picture

Great that it's working.

Re your question on HTTPS, yes it is possible to enable port 8080 to use HTTPS, but you need to ensure that you explicitly do that.

Also it's uncommon to do that via port 8080. Generally port 8080 is used as an alternate plain HTTP port (i.e. an alternate port to port 80). The most common alternate HTTPS port is 8443 (i.e. alternate to default HTTPS port 443). Unfortunately Apache doesn't have any way to handle wrong protocol, so trying to connect to a port that is using HTTPS via HTTP (or vice versa) will cause a web browser error.

Hopefully that makes sense?!

Add new comment