Issues after moving Owncloud 9.1.6

Hi There,

I have moved my Owncloud install from Ubuntu to CentOS 7.

moved the install directory from: /var/www/owncloud to /var/www/html/

I copied all the files including Config directory & /data directory. The IP of the server also changed from
our internal server http://192.168.10.153 to http://192.168.7.192

When I go to the web interface and try loading the login page, I get the following error. I am sure its probably an easy fix. I have made the changes already in the config.php with the new directory paths and new ip addresses.

Not Found

The requested URL /192.168.10.153/owncloud was not found on this server.

the URL bar has the following: http://192.168.7.192/192.168.10.153/owncloud

I already changed the ‘overwrite.cli.url’ => ‘http://192.168.10.192/’,

Any help would be appreciateed

Thanks

Yogesh

Have a look at your system log files, especially the apache error log should be helpful. You should be able to find this somewhere in /var/log.
Make sure to also check your SELinux settings in CentOS and the labels on the files with ls - alZ /var/www/html

1 Like

This is what it looks like in that Directory:

drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 3rdparty
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 apps
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 assets
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 AUTHORS
drwxrwxrwx. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 config
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 console.php
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 COPYING-AGPL
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 core
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 cron.php
drwxr-x—. apache apache unconfined_u:object_r:user_home_t:s0 data
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 db_structure.xml
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 etc
-rw-r–r--. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 .htaccess
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 index.html
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 index.php
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 info.php
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 l10n
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 lib
-rwxr-x–x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 occ
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 ocs
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 ocs-provider
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 public.php
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 remote.php
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 resources
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 robots.txt
-rwxr-x–x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 script.sh
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 settings
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 status.php
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 themes
drwxr-x—. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 updater
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 .user.ini
-rw-r-----. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 version.php

Just to add more context…

the site starts to load, I can see the page header change to the name of our owncloud, then it redirects to

http://192.168.7.192/192.168.10.153/owncloud

Hope that helps…

Yogesh

Hi Yogesh,
Something is rewriting your URL incorrectly.

So you need to double check your Apache configuration, the .htaccess file in the owncloud path, and double check that your ownCloud isn’t set up to rewrite the URL in your config.php.

There are a bunch of settings like overwrite.cli.url, you can read about them in the config.sample.php
Cheers,
Erik

1 Like

Sorry but this is not readable. Can you paste it enclosed in triple backticks (`)?

1 Like

Let me try again

‘’’<?php
$CONFIG = array (
‘maintenance’ => false,
‘updatechecker’ => true,
‘instanceid’ => ‘oc0ai9dzo6n2’,
‘passwordsalt’ => ‘dsi1uRwiu5RV14R+U7V8b2mhrVjQX6’,
‘secret’ => ‘S3p2KOCFnDyMofwMCHaSLwK4baNr6/uaMyI9VLM4Amr30RxD’,
‘trusted_domains’ =>
array (
0 => ‘192.168.7.192’,
1 => ‘owncloud.sl’,
),
‘datadirectory’ => ‘/var/www/html/data’,
‘overwrite.cli.url’ => ‘/’,
‘dbtype’ => ‘mysql’,
‘version’ => ‘9.1.6.2’,
‘dbname’ => ‘sl_owncloud’,
‘dbhost’ => ‘localhost’,
‘dbtableprefix’ => ‘oc_’,
‘dbuser’ => ‘oc_sl-admin’,
‘dbpassword’ => ‘**********’,
‘logtimezone’ => ‘UTC’,
‘installed’ => true,
‘ldapIgnoreNamingRules’ => false,
‘mail_smtpmode’ => ‘smtp’,
‘mail_smtphost’ => ‘’,
‘mail_from_address’ => ‘’,
‘mail_domain’ => ‘’,
‘mail_smtpport’ => ‘25’,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_smtpauth’ => 1,
‘mail_smtpname’ => ‘’,
‘mail_smtppassword’ => ‘’,
);’’’

Here’s the .htaccess.

.htaccess.txt (225 Bytes)

Thinking about this a little more I think the problem is that apache is not allowed via SELinux to write to the .htaccess file, therefore you will have to change the label on it.

You can quickly confirm this by setting your SELinux to permissive, restarting the server and double check if the problem persists.

1 Like

Great thanks,

Will do that now…

Yogesh

Still a no go…could it be getting something from the DB by any chance? I am not sure where else I can check for that redirect

Yogesh

Did you check your apache configuration files? Is there any mention of the old IP?

grep -R 'ip.add.re.ss' /path/to/apache-configuration-folder
1 Like

the only place I found anything is the following.

grep -R ‘ip.add.re.ss’ /etc/
/etc/php-fpm.d/www.conf:; ‘ip.add.re.ss:port’ - to listen on a TCP socket to a specific address on

You should replace your old (now incorrect) IP address with ip.add.re.ss (you might have to escape the dots)

Great I got it figured out…

Turns out to be a stupid redirect in the index.html not sure how that got there.

Now the issue is that the page loads blank. Is there a way to turn on some debugging to see why?

Thanks for all you help on that issue,…I really appreciate it.

Yogesh

When I check the status of owncloud by going to: http://192.168.7.192/status.php

it says: Data directory (/var/www/html/data) is invalid

Please check that the data directory contains a file “.ocdata” in its root.

however I have checked and there is an .ocdata file in the root however its empty

Thanks

Yogesh

Hey,

i think this is strongly related to the following post as you need to do manual modifications within the ownCloud database when moving the data directory to a new location:

1 Like

I walked through the database changes in that document, only had to make one edit however the server is still showing a blank page when trying to go to the address.

Any help would be much appreciated

Yogesh

Tom,

I just wanted to say thank you for that last bit of help. I got it up and running now.

I really appreciate it

Thanks

Yogesh

1 Like