Howto: change owncloud base directory/url [Ubuntu/Apache]

Old FAQs for EOL ownCloud versions.
Ian Lewis
Newbie
Posts: 6
Joined: Fri Apr 17, 2015 1:59 pm
ownCloud version: 8.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: PHP Version 5.5.9-1u

Howto: change owncloud base directory/url [Ubuntu/Apache]

Postby Ian Lewis » Sat Apr 18, 2015 12:59 pm

Here's how to change both the base directory and the web url for users accessing your Ubuntu/Apache2 owncloud server*:

On Ubuntu the default install of owncloud server 8.0.2 is to '/var/www/owncloud', and users access the web pages via (http/s) <servername>/owncloud, and also put this into their desktop client settings.

If you want to change this, e.g. you want users to access <servername>/cloud, here's what worked for me:

1) rename the /var/www/owncloud directory (This will break updates through the package manager!!!):

Code: Select all

sudo mv /var/www/owncloud /var/www/cloud


2) edit the /etc/apache2/conf-available/owncloud.conf file that maps incoming users to that directory, and replace two references to 'owncloud' with new name (e.g. 'cloud'):

Code: Select all

sudo nano /etc/apache2/conf-available/owncloud.conf

'Ctrl-X' to quit, 'y' to confirm changes, 'enter' to confirm save file name. File should now look like:

Code: Select all

Alias /cloud "/var/www/cloud/"
<Directory "/var/www/cloud">
    Options +FollowSymLinks
    AllowOverride All
</Directory>


3) edit the /var/www/cloud/config/config.php file to correct the previous references to /var/www/owncloud:

Code: Select all

sudo nano /var/www/cloud/config/config.php

Change the 'datadirectory':

Code: Select all

 'datadirectory' => '/var/www/cloud/data',

and if you have it, change the 'overwrite.cli.url':

Code: Select all

'overwrite.cli.url' => 'https://<your server name>/cloud',


4) Restart Apache:

Code: Select all

sudo service apache2 restart


At this point you should be good to go, visit <your server>/cloud in your favorite browser.

Note that any existing desktop client sync references to <your server>/owncloud will break at this point, so you will have to re-create those using your new url. Hence this change only really makes sense after a relatively new install, before you've deployed this stuff to thousands of users...

* hope this helps... I only wrote it because it took me several days to work this out and the existing web posts are incomplete and misleading...

RyeGuy
Newbie
Posts: 8
Joined: Tue Jul 14, 2015 12:37 am
ownCloud version: 8.0.5
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.4

Re: Howto: change owncloud base directory/url [Ubuntu/Apache

Postby RyeGuy » Tue Jul 14, 2015 2:37 am

I am trying to accomplish the same thing you are here but without a subfolder. For example, instead of owncloud.domain.com/owncloud, I want the base URL to be owncloud.domain.com.
I followed the steps that were listed here but changing the subfolder to /var/www but it didn't work, it would just give an empty file listing.
I went through the steps a few times but no good. Does anything need to be different if I want to use a subfolder? In case it matters, I am using SSL as well.
Thanks,

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: Howto: change owncloud base directory/url [Ubuntu/Apache

Postby tflidd » Tue Jul 14, 2015 10:18 am

In your case you have to set the DocumentRoot from /var/www to /var/www/owncloud. You can remove the Alias /cloud "/var/www/owncloud/".
In your config.php you only need to change the overwrite cli.url:

Code: Select all

'overwrite.cli.url' => 'https://<your server name>/',

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Howto: change owncloud base directory/url [Ubuntu/Apache

Postby RealRancor » Fri Aug 07, 2015 5:21 pm

Just a warning:

This tutorial suggests to rename /var/www/owncloud to /var/www/cloud

This will break updates through the package manager!!!
*gone*

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: Howto: change owncloud base directory/url [Ubuntu/Apache

Postby tflidd » Fri Aug 07, 2015 5:34 pm

Can't we do the same by just putting

Code: Select all

Alias /cloud "/var/www/owncloud/"

in the apache-config and modifying the overwrite.cli.url? The other paths stay the same.

IvanAK
Beginner
Posts: 11
Joined: Wed Dec 03, 2014 1:37 pm
ownCloud version: 7.0.3
Webserver: Apache
Database: SQLite
OS: Linux
PHP version: 5.4.16

Re: Howto: change owncloud base directory/url [Ubuntu/Apache

Postby IvanAK » Wed Oct 14, 2015 4:37 pm

How can i change the URL to be just the IP address of the Machine. I have done this but have problems with the apps, like Documents, not working after changer the DocumentRoot in the ssl.conf file.

Any hints about this ?

macasavage007
Newbie
Posts: 4
Joined: Mon May 09, 2016 5:10 am
PHP version: 5.5

Re: Howto: change owncloud base directory/url [Ubuntu/Apache]

Postby macasavage007 » Mon May 09, 2016 5:20 am

Ian Lewis wrote:Here's how to change both the base directory and the web url for users accessing your Ubuntu/Apache2 owncloud server*:

On Ubuntu the default install of owncloud server 8.0.2 is to '/var/www/owncloud', and users access the web pages via (http/s) <servername>/owncloud, and also put this into their desktop client settings.




How do i remove the whole /*/ entirely?
So instead of

Code: Select all

example.com/owncloud
i just want to have my owncloud installation under the main root

Code: Select all

example.com
?


I am using the "Packages for auto updates" for Ubuntu 14.04
found here https://download.owncloud.org/download/ ... /owncloud/


Thanks

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: Howto: change owncloud base directory/url [Ubuntu/Apache]

Postby tflidd » Mon May 09, 2016 10:04 am

In OC 9.0+, you will probably need to change your /var/www/owncloud/.htaccess as well:
https://github.com/owncloud/core/issues ... -216814100

whgandalf
Newbie
Posts: 1
Joined: Sun Jul 10, 2016 7:35 pm
ownCloud version: 9.0.2
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 7

Re: Howto: change owncloud base directory/url [Ubuntu/Apache]

Postby whgandalf » Sun Jul 10, 2016 7:40 pm

edit the /var/www/cloud/config/config.php file to correct the previous references to /var/www/owncloud:


following the steps in my server I found there was no owncloud file at:

Code: Select all

sudo nano /etc/apache2/conf-available/owncloud.conf


Actually the proper location of the file in my Ubuntu 16.04 install is :

Code: Select all

sudo nano /etc/apache2/sites-available/owncloud.conf

RealRancor
ownCloud master
Posts: 17381
Joined: Sat May 26, 2012 3:00 pm
ownCloud version: 9.0.2
Webserver: nginx
Database: MySQL
OS: Linux
PHP version: 7.0.x

Re: Howto: change owncloud base directory/url [Ubuntu/Apache]

Postby RealRancor » Sun Jul 10, 2016 8:04 pm

Moved in here as this tutorial is known to break a lot of stuff. With the next rebuild of the documentation there will be a howto in the docs:

https://github.com/owncloud/documentati ... 2489/files
*gone*


  • Similar Topics
    Replies
    Views
    Last post

Return to “Historic FAQs”

Who is online

Users browsing this forum: No registered users and 0 guests