Nginx and owncloud issues at /dev/sda1 /mnt/raid5/owncloud

Ask all your questions regarding OC 8.2 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
patrick0525
Beginner
Posts: 18
Joined: Sat Jan 02, 2016 10:00 pm
ownCloud version: 8.2.3
Database: MySQL
OS: Linux

Nginx and owncloud issues at /dev/sda1 /mnt/raid5/owncloud

Postby patrick0525 » Sun Jan 10, 2016 2:49 am

I decided to go Nginx and owncloud 8.2.2 on a ubuntu 14.04 server.
I used this link as a reference: http://www.htpcguides.com/install-owncl ... l-dropbox/

I am getting the following error in my web browser
10.59.11.xxx/owncloud:
Error
Can't create or write into the data directory /mnt/raid5/owncloud/data

changes made so far

/etc/fstab
UUID=55c24992-497a-46c6-90d6-36d25e312345 /mnt/raid5 ext4 uid=1000,gid=1000,umask=007 0 0


patrick@ubuntu:/mnt/raid5/media$ ls -al /mnt
total 12
drwxr-xr-x 3 root root 4096 Jan 8 18:28 .
drwxr-xr-x 22 root root 4096 Jan 7 21:06 ..
drwxrwx--- 5 patrick root 4096 Jan 8 20:09 raid5


patrick@ubuntu:/mnt/raid5/media$ ls -al /mnt/raid5
total 32
drwxrwx--- 5 patrick root 4096 Jan 8 20:09 .
drwxr-xr-x 3 root root 4096 Jan 8 18:28 ..
drwx------ 2 root root 16384 Dec 8 19:10 lost+found
drwxrwxrwx 3 root root 4096 Jan 9 19:22 media
drwxr-xr-x 4 www-data www-data 4096 Jan 8 21:32 owncloud


patrick@ubuntu:/mnt/raid5/media$ ls -al /mnt/raid5/owncloud
total 16
drwxr-xr-x 4 www-data www-data 4096 Jan 8 21:32 .
drwxrwx--- 5 patrick root 4096 Jan 8 20:09 ..
drwxrwxrwx 2 www-data www-data 4096 Jan 8 21:32 data
drwxrwxrwx 2 www-data www-data 4096 Jan 8 20:10 tmp


patrick@ubuntu:/mnt/raid5/media$ sudo cat /var/www/owncloud/config/config.php
<?php
$CONFIG = array (
'instanceid' => 'octill70hubx',
'datadirectory' => '/mnt/raid5/owncloud/data',
);

sudo nano /etc/php5/fpm/php.ini
Add these changes

default_charset = "UTF-8"
upload_max_filesize = 10G
post_max_size = 10G
upload_tmp_dir = /mnt/raid5/owncloud/tmp
max_input_time = 360000
#The maximum time in seconds a script is allowed to parse input data.
max_execution_time = 360000
memory_limit = 512M
extension=memcached.so
extension=memcache.so



/var/www/owncloud/data/owncloug.log

{"reqId":"KqT\/YQqH79aTM3YeC\/at","remoteAddr":"10.59.11.123","app":"no app in context","message":"Temporary directory \/mnt\/raid5\/owncloud\/tmp is not present or writable","level":2,"time":"2016-01-09T22:55:16+00:00"}
{"reqId":"KqT\/YQqH79aTM3YeC\/at","remoteAddr":"10.59.11.123","app":"PHP","message":"mkdir(): Permission denied at \/var\/www\/owncloud\/lib\/private\/setup.php#283","level":3,"time":"2016-01-09T22:55:16+00:00"}

patrick0525
Beginner
Posts: 18
Joined: Sat Jan 02, 2016 10:00 pm
ownCloud version: 8.2.3
Database: MySQL
OS: Linux

Re: Nginx and owncloud issues at /dev/sda1 /mnt/raid5/ownc

Postby patrick0525 » Sun Jan 10, 2016 2:54 am

the setup.php file line #283

// validate the data directory
if (
(!is_dir($dataDir) and !mkdir($dataDir)) or
!is_writable($dataDir)
) {
$error[] = $l->t("Can't create or write into the data directory %s", array($dataDir));
}

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: Nginx and owncloud issues at /dev/sda1 /mnt/raid5/ownc

Postby RealRancor » Sun Jan 10, 2016 3:21 am

Your webserver very unlikely running as user patrick or is in the group root so how should it be able to access /mnt/raid5 with that permissions you're currently showing?
*gone*

patrick0525
Beginner
Posts: 18
Joined: Sat Jan 02, 2016 10:00 pm
ownCloud version: 8.2.3
Database: MySQL
OS: Linux

Re: Nginx and owncloud issues at /dev/sda1 /mnt/raid5/ownc

Postby patrick0525 » Sun Jan 10, 2016 4:05 am

patrick@ubuntu:/mnt/raid5/media$ ls -al /usr/sbin/nginx
-rwxr-xr-x 1 root root 873176 Jul 29 20:08 /usr/sbin/nginx

What do you suggest I change?

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: Nginx and owncloud issues at /dev/sda1 /mnt/raid5/ownc

Postby tflidd » Sun Jan 10, 2016 12:48 pm

On ubuntu the webserver-user is www-data. Now it depends how you have configured php, if you are running php-fpm, you can run this process on any username you want, in most cases it will be www-data as well.

I would use chmod 755 for /mnt/raid5 (corresponds to umask=002 in your /etc/fstab). For the owncloud-folder (/mnt/raid5/owncloud), I would keep the permissions but choose chmod 750 (not all users on the system should be able to read it).

I'm not sure what you have on /mnt/raid5/media and what you use it for, but chmod 777 let's everybody do whatever he wants and is no good idea in general.

patrick0525
Beginner
Posts: 18
Joined: Sat Jan 02, 2016 10:00 pm
ownCloud version: 8.2.3
Database: MySQL
OS: Linux

Re: Nginx and owncloud issues at /dev/sda1 /mnt/raid5/ownc

Postby patrick0525 » Sun Jan 10, 2016 3:28 pm

tflidd,
Thank you. Thank you. Owncloud now connects to my 8Tb raid5 as a mount /mnt/raid5/owncloud using nginx. No apache

I changed the permissions that u suggested.
Three days to get it working. I see the default Paris.jpg in my webrowser. I didn't make any ay php5 or nginx changes.

Can you explain again what happened?

I did do a sudo touch /mnt/raid5/owncloud/data/.ocdata

changed /etc/fstab
UUID=55c24992-497a-46c6-90d6-36d25e312345 /mnt/raid5 ext4 auto uid=33,gid=33,umask=002 0 0

33 is www-data

ls -al /
drwxr-xr-x 3 root root 4096 Jan 8 18:28 mnt

ls -al /mnt/
drwxr-xr-x 5 patrick root 4096 Jan 8 20:09 raid5

ls-al /mnt/raid5
drwxrwxrwx 3 root root 4096 Jan 9 19:22 media
drwxr-x--- 4 www-data www-data 4096 Jan 8 21:32 owncloud

ls -al /mnt/raid5/owncloud
drwxr-x--- 4 www-data www-data 4096 Jan 10 08:09 data
drwxrwxrwx 2 www-data www-data 4096 Jan 8 20:10 tmp

ls -al /mnt/raid5/owncloud/data
-rw-r--r-- 1 www-data www-data 0 Jan 10 08:09 .ocdata

patrick@ubuntu:~$ ls -al /mnt/raid5/owncloud/data/owncloud/files/Photos/
total 676
drwxr-xr-x 2 www-data www-data 4096 Jan 10 08:09 .
drwxr-xr-x 4 www-data www-data 4096 Jan 10 08:09 ..
-rw-r--r-- 1 www-data www-data 228761 Jan 10 08:09 Paris.jpg
-rw-r--r-- 1 www-data www-data 216071 Jan 10 08:09 San Francisco.jpg
-rw-r--r-- 1 www-data www-data 233724 Jan 10 08:09 Squirrel.jpg


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.2”

Who is online

Users browsing this forum: No registered users and 2 guests