ownCloud 10.0.2 + Nginx does not start

Hello,

i have installed ownCloud 10.0.2 and i have several problems. I use a raspberry with the operating system "jessie lite".

With this command "sudo service nginx restart" i get the following messages:
Job for nginx.service failed. See 'systemctl status nginx.service' and 'journalctl -xn' for details.

If i enter this command "nginx -t", then i get the following error messages:
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permission denied)
2017/06/11 08:33:49 [warn] 1007#0: the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
2017/06/11 08:33:49 [emerg] 1007#0: "gzip" directive is duplicate in /etc/nginx/sites-enabled/owncloud:1
nginx: configuration file /etc/nginx/nginx.conf test failed

I have already tried a lot and will not go any further. Can someone help me? Sorry for my english, i live in germany. ;o)

Hi, have a look at this

https://doc.owncloud.com/server/10.0/admin_manual/installation/nginx_configuration.html?highlight=nginx

also - have you given your web user the right privileges?

chown -R www-data:www-data /var/www/owncloud/

Here is a useful script:

#!/bin/bash
ocpath='/var/www/owncloud'
ocdata='/var/www/owncloud/data'
htuser='www-data'
htgroup='www-data'
rootuser='root'

printf "Creating possible missing Directories\n"
mkdir -p $ocdata
mkdir -p $ocpath/assets
mkdir -p $ocpath/updater

printf "chmod Files and Directories\n"
find ${ocpath}/ -type f -print0 | xargs -0 chmod 0640
find ${ocpath}/ -type d -print0 | xargs -0 chmod 0750
find ${ocdata}/ -type f -print0 | xargs -0 chmod 0640
find ${ocdata}/ -type d -print0 | xargs -0 chmod 0750

printf "chown Directories\n"
chown -R ${rootuser}:${htgroup} ${ocpath}/
chown -R ${htuser}:${htgroup} ${ocpath}/apps/
chown -R ${htuser}:${htgroup} ${ocpath}/assets/
chown -R ${htuser}:${htgroup} ${ocpath}/config/
chown -R ${htuser}:${htgroup} ${ocdata}/
chown -R ${htuser}:${htgroup} ${ocpath}/themes/
chown -R ${htuser}:${htgroup} ${ocpath}/updater/

chmod +x ${ocpath}/occ

printf "chmod/chown .htaccess\n"
if [ -f ${ocpath}/.htaccess ]
 then
  chmod 0644 ${ocpath}/.htaccess
  chown ${rootuser}:${htgroup} ${ocpath}/.htaccess
fi
if [ -f ${ocdata}/.htaccess ]
 then
  chmod 0644 ${ocdata}/.htaccess
  chown ${rootuser}:${htgroup} ${ocdata}/.htaccess
fi

ref:
https://doc.owncloud.com/server/10.0/admin_manual/installation/installation_wizard.html#post-installation-steps

Hi,

thanks for your help! Yes, web user is right privileges, but under the following directory:
/var/www/html/owncloud

Thank you also for the script. There will be nothing left for me, so the script on weekends step by step go through. ;O)

Okay, is there a reason you use nginx over apache? You could have saved yourself a log of trouble with apache :slight_smile:

I also have an raspy, I can try to recreate your setup and see if I run in to the same error

I use nginx because it is more resource-friendly than apache. Would be great if you install the nginx with you on the raspy. I just do not know if the problem is solved here. I need to deal more with the error messages.
I'm back online next week Tuesday, as I am on the road.

The posted error messages looks more like issues in your nginx config. For that you probably need to ask some one from a nginx support forums to get help.

Thanks for your help. My cloud is working now. I have removed the line with the command "gzip off" in the configuration file. What does this command stand for?