Owncloud on a headless Odroid XU4 ubuntu22.04

So far failure, apart from syntax errors, which are fairly easy to spot, I have followed quick_guides&ubuntu_22_04
All appears well until the section that start with

occ maintenance:install \
    --database "mysql" \
    --database-name "owncloud" \
    --database-user "owncloud" \
    --database-pass ${sec_db_pwd} \
    --data-dir "/var/www/owncloud/data" \
    --admin-user "admin" \
    --admin-pass ${sec_admin_pwd}

instances of this :-

root@odroid:/var/www/owncloud# ./occ config:system:set trusted_domains 1 --value="$my_ip"
Console has to be executed with the user that owns the file config/config.php
Current user: root
Owner of config.php: www-data
Try adding 'sudo -u www-data ' to the beginning of the command (without the single quotes)

when is root not root, ??? is there a guide to install that actually gets the required result without days of frustration
I realise when new to software its not easy , but when at the start it says install as root .

Hi Richard,

root is root but not the user providing the http service :slight_smile: The solution is written in the error output:

so change to your ownCloud installation directory and run occ with
sudo -u www-data php occ ....

I don’t think the quick guides in the ownCloud documentation are sophisticated. Especially the occ helper script brings more confusion than actual help.

Regarding installation documentation for Ubuntu 22.04 I prefer the detailed instructions:

In that documentation they are using the sudo variant calling occ.

Details on occ are found at Using the occ Command :: ownCloud Documentation

Hope that helps and you can get your cloud running.

Thanks for the quick response, the only problem being I tried that and the system wouldn’t let me do it, you say occ is a sudo variant, does that mean it can be used instead of sudo, I’ve been trying to install for 3 days now without success, thanks

then you got me wrong. occ ist the ownCloud command line script and must be called with sudo.

What happens when you enter your ownCloud installation directory and run the command below?
sudo -u www-data php occ

Hi at the moment I flushed the whole owncloud directory as I was sure something was very screwed on the installation to give so much hassle, I’ll try again if I can get help where it was getting difficult.

It only going to get used by 3 users, mainly my GF as her apple quota has been exceeded, and this is a better option , I;ll read the ifo you sent and have another go
Thanks

1 Like

Fine. Just use sudo -u www-data php occ everywhere you had only used occ before and I guess it will be working.
You are welcome to come with new information if you run into any difficulties.

Tried again all the way through the ubuntu22 preinstallation and the detailed instruction, and here we go again :frowning:

root@owncloud:/var/www# occ maintenance:install \
    --database "mysql" \
    --database-name "owncloud" \
    --database-user "owncloud" \
    --database-pass ${sec_db_pwd} \
    --data-dir "/var/www/owncloud/data" \
    --admin-user "admin" \
    --admin-pass ${sec_admin_pwd}
PHP Warning:  PHP Startup: Unable to load dynamic library 'smbclient.so.' (tried: /usr/lib/php/20190902/smbclient.so. (/usr/lib/php/20190902/smbclient.so.: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/smbclient.so..so (/usr/lib/php/20190902/smbclient.so..so: cannot open shared object file: No such file or directory)) in Unknown on line 0

                                               
  The "--admin-pass" option requires a value.  
                                               

maintenance:install [--database DATABASE] [--database-connection-string DATABASE-CONNECTION-STRING] [--database-name DATABASE-NAME] [--database-host DATABASE-HOST] [--database-user DATABASE-USER] [--database-pass [DATABASE-PASS]] [--database-table-prefix [DATABASE-TABLE-PREFIX]] [--admin-user ADMIN-USER] [--admin-pass ADMIN-PASS] [--data-dir DATA-DIR]

root@owncloud:/var/www# 

I’ve copied and pasted so avoid typos, and it still is being a PITA
this section was completed much earlier

tsec_admin_pwd=$(openssl rand -base64 18)
echo $sec_admin_pwd > /etc/.sec_admin_pwd.txt

sec_db_pwd=$(openssl rand -base64 18)
echo $sec_db_pwd > /etc/.sec_db_pwd.txtype or paste code here

Hi again :wink:

You are running the process as another user where you set the environment variable for the passwords, so you will have to export them.
run your command with
export sec_db_pwd sec_admin_pwd; occ ...

You are only a few steps away :slight_smile:

A note to the PHP warning: It looks like you installed the package php7.4-smblient (assuming you are using the ondrej repo as described in the docs) but not the smbclient package itself.

If you are planning to use Samba Shares as external storage then you will have to install the smbclient package, if not you might remove it with e.g. apt purge php*smbclient

Ok, I’ve tried changing the mysql password and it throws it out every time insisting on a 41 character hash

MariaDB [(none)]> SET PASSWORD FOR 'root'@'localhost' = 'XD53xxxxxxv';
ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number
MariaDB [(none)]> SET PASSWORD = 'XD53xxxxyv'
    -> ;
ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number

Also purged smbclient and added the export line , just the same

root@owncloud:/var/www/owncloud# export sec_db_pwd sec_admin_pwd; occ maintenance:install     --database "mysql"     --database-name "owncloud"     --database-user "owncloud"     --database-pass ${sec_db_pwd}     --data-dir "/var/www/owncloud/data"     --admin-user "admin"     --admin-pass ${sec_admin_pwd}
PHP Warning:  PHP Startup: Unable to load dynamic library 'smbclient.so.' (tried: /usr/lib/php/20190902/smbclient.so. (/usr/lib/php/20190902/smbclient.so.: cannot open shared object file: No such file or directory), /usr/lib/php/20190902/smbclient.so..so (/usr/lib/php/20190902/smbclient.so..so: cannot open shared object file: No such file or directory)) in Unknown on line 0

                                               
  The "--admin-pass" option requires a value.  
                                               

maintenance:install [--database DATABASE] [--database-connection-string DATABASE-CONNECTION-STRING] [--database-name DATABASE-NAME] [--database-host DATABASE-HOST] [--database-user DATABASE-USER] [--database-pass [DATABASE-PASS]] [--database-table-prefix [DATABASE-TABLE-PREFIX]] [--admin-user ADMIN-USER] [--admin-pass ADMIN-PASS] [--data-dir DATA-DIR]


Can you clarify which smbclient should be installed I followed the instructions exactly please

Also its being stupid saying it cant find /usr/lib/php/20190902/smbclient.so as

root@owncloud:/var/www/owncloud# ls -l /usr/lib/php/20190902/|grep smbclient
-rw-r--r-- 1 root root   43292 Apr 21  2022 smbclient.so

SD card reflashed so a completely new clean install of ubuntu 22.04 on the 32 bit Odroid Xu4 which is headless, No errors given during install, warnings given on Pear update
on the internal lan its ip address is 192.168.1.82
from a Firefox browser on the laptop running Linux mint 21
http 192.168.1.82 brings up the Apache2 default page
http 192.168.1.82/owncloud gives error 404
this device is headless all connections to it are ssh, with no keyboard or mouse,
Default iptables are accept all
now 4 days trying to get this to work :frowning:

One thing very strange, on power up of the XU4 SBC

odroid@odroid:~$ ps ax|grep apache2
  733 ?        Ss     0:00 /usr/sbin/apache2 -k start
  913 ?        S      0:00 /usr/sbin/apache2 -k start
  914 ?        S      0:00 /usr/sbin/apache2 -k start
  915 ?        S      0:00 /usr/sbin/apache2 -k start
  916 ?        S      0:00 /usr/sbin/apache2 -k start
  917 ?        S      0:00 /usr/sbin/apache2 -k start
 6094 pts/0    S+     0:00 grep --color=auto apache2
type or paste code here

Why 6 instances of apache2 ?
checked systemctl status, and more

odroid@odroid:~$ systemctl status apache2
● apache2.service - The Apache HTTP Server
     Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2022-11-25 09:43:23 UTC; 34min ago
       Docs: https://httpd.apache.org/docs/2.4/
    Process: 637 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
   Main PID: 733 (apache2)
      Tasks: 7 (limit: 4442)
     Memory: 24.4M
        CPU: 699ms
     CGroup: /system.slice/apache2.service
             ├─ 733 /usr/sbin/apache2 -k start
             ├─ 913 /usr/sbin/apache2 -k start
             ├─ 914 /usr/sbin/apache2 -k start
             ├─ 915 /usr/sbin/apache2 -k start
             ├─ 916 /usr/sbin/apache2 -k start
             ├─ 917 /usr/sbin/apache2 -k start
             └─6095 /usr/sbin/apache2 -k start

Nov 25 09:43:22 odroid systemd[1]: Starting The Apache HTTP Server...
Nov 25 09:43:23 odroid apachectl[656]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to supp>
Nov 25 09:43:23 odroid systemd[1]: Started The Apache HTTP Server.

I’ve now set the server name to the ip address it will use… rebooted and still owncloud is not starting, and still 6 instances of apache2 running , anyone got some magic incantations that will make it work , please

Hi
Copied owncloud.conf to /etc/apache2/ and added a line in apache.conf

# Include list of ports to listen on
Include ports.conf
# Include owncloud .conf
Include owncloud.conf

http / owncloud now brings up the page with the message

Can't write into config directory!
This can usually be fixed by <a href="https://doc.owncloud.com/server/10.11/go.php?to=admin-dir_permissions" target="_blank" rel="noreferrer">giving the webserver write access to the config directory</a>

So if someone can help by saying where to add these lines , it should be up and running

If there is a prize for stupid questions, I’ll have it,
changing the owner of /var/www/owncloud to www-data fixed that

2 Likes