DrKK's Definitive Guide to Installing OwnCloud in FreeNAS (or FreeBSD)

Status
Not open for further replies.

norskman

Contributor
Joined
Sep 28, 2012
Messages
149
many thanks, so I will just follow your notes - especially the one right at the start of this thread about doing a a compile of the package.

I wish we could have your notes on installation seperate from questions - that way, anyone wanting to install can follow how to do this - without trudging through tones of pages. I am not helping this at all, we are at 9 pages already....
 

okaenrique

Dabbler
Joined
Jul 22, 2015
Messages
48
hello thanks for the guide and video , i just flow your video in youtube but i get problem , when i login in my own cloud can't find SQLITE Only MySQL/MariaDB is available..

any help please ?
 

Attachments

  • 1.jpg
    1.jpg
    142.5 KB · Views: 463

INCSlayer

Contributor
Joined
Apr 4, 2015
Messages
197
hello thanks for the guide and video , i just flow your video in youtube but i get problem , when i login in my own cloud can't find SQLITE Only MySQL/MariaDB is available..

any help please ?
Try Reading the BIG RED text in the first post
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
Try Reading the BIG RED text in the first post
LOL. Saying exactly this was what I was going to say as soon as I sat down at the computer after I got home today. You beat me to it, sir ;)
 

okaenrique

Dabbler
Joined
Jul 22, 2015
Messages
48
Thanks , if any one want scan all file after moving from another Owncloud just write


sudo -u www php occ files:scan userid
 
Last edited:

Jonathan Rose

Dabbler
Joined
Feb 1, 2015
Messages
11
SOS?

My FreeNAS went bananas after a tree cutting service decided how fun it would be to cut down a tree and, as a bonus, my power and utility lines. Once everything was back up and running, I noticed my system acting weirder than normal (don't ask). So I did a fresh install, imported my volumes, and decided to make my jails/plugins from scratch. Owncloud seems to be the only thing giving me resistance. I tried the setup with lighttpd, but I kept getting issues between LDAP not connecting, HSTS not working properly, and other annoyances with OwnCloud 8.1 (previously using 8.04).

Trying to get a working setup with nginx and found https://forums.freenas.org/index.php?threads/how-to-owncloud-using-nginx-php-fpm-and-mysql.17786/ but have no frigging clue how to get the setup I want/need with SSL. Any input? BTW - I moved my SQL instance to another machine altogether, which seems to making things run smoother all around.
 

jerryjharrison

Explorer
Joined
Jan 15, 2014
Messages
99
Now that a new version of OwnCloud has been released, is there a good way to upgrade? Will repeating the install instructions above perform an upgrade?
 

DumDum

Dabbler
Joined
Feb 24, 2015
Messages
11
Now that a new version of OwnCloud has been released, is there a good way to upgrade? Will repeating the install instructions above perform an upgrade?

I used the Updater App that is on the Admin panel. The upgrade itself was smooth, but read the ownCloud 8.1 documentation prior so you can expect the new failures. Biggest issue I ran into was "Server has no Internet Connection" so I had issues with installing/updating apps. I manually installed the 8.1 versions of calendar and contacts before I found the so-called fix:
1)Download the zip installation and gather the /config/ca-bundle.crt
2)From the downloaded zip, copy the config/ca-bundle.crt into your config directory
 

jerryjharrison

Explorer
Joined
Jan 15, 2014
Messages
99
Ok, I gave up on getting the upgrade to work. New Jail, fresh install using lighttpd, MYSQL (yea!), and Owncloud 8.1.1). I have gotten everything corrected except the following three items:

Security & setup warnings
  • php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.
    Please check the installation documentation for php configuration notes and the php configuration of your server, especially when using php-fpm.
  • No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.
  • The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our security tips.
Please double check the installation guides ↗, and check for any errors or warnings in the log.

I have read all of the installation guide, and the only help is a recommendation to load a cache system called APCu, but PHP configuration is WAY over my head.

I basically used DRKK's guide all the way through, and just did a bit of MYSQL config on the back end. I know nothing about SQL, but the very limited configuration was pretty easy.

Any help on this PHP stuff would be greatly appreciated.
 

DumDum

Dabbler
Joined
Feb 24, 2015
Messages
11
Ok, I gave up on getting the upgrade to work. New Jail, fresh install using lighttpd, MYSQL (yea!), and Owncloud 8.1.1). I have gotten everything corrected except the following three items:

Security & setup warnings
  • php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.
    Please check the installation documentation for php configuration notes and the php configuration of your server, especially when using php-fpm.
  • No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.
  • The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our security tips.
Please double check the installation guides ↗, and check for any errors or warnings in the log.

I have read all of the installation guide, and the only help is a recommendation to load a cache system called APCu, but PHP configuration is WAY over my head.

I basically used DRKK's guide all the way through, and just did a bit of MYSQL config on the back end. I know nothing about SQL, but the very limited configuration was pretty easy.

Any help on this PHP stuff would be greatly appreciated.

Of your three problems:
1)getenv("PATH") empty response
2)memcache
3)HSTS

#1 is probably the only weird one that isn't as straight forward as the other two in the owncloud documents (yes, I have faith you too can fix #2 & #3 by doing a little reading). I didn't have your #1 issue, but I think it can be tracked down in your php-fpm.conf file. Look for "env[PATH]" as you probably just need to "un-comment" it.
 

jerryjharrison

Explorer
Joined
Jan 15, 2014
Messages
99
Dum,

Thanks for the response, and I appreciate your confidence in my finding solutions... LOL

I have remove the comments in the php-fpm.conf file, but no changes resulted, and I am still getting the same error in the Owncloud admin page. I searched the php.ini and php.conf files to see where the php-fpm was included, but there is no reference to php-fpm in either of those two files. Any clues as to where the php-fpm.conf might be referenced?

I am still working on the other two issues, and will post results here when done.
 

Messlow

Dabbler
Joined
Jan 12, 2015
Messages
10
Ok, I gave up on getting the upgrade to work. New Jail, fresh install using lighttpd, MYSQL (yea!), and Owncloud 8.1.1). I have gotten everything corrected except the following three items:

Security & setup warnings
  • php does not seem to be setup properly to query system environment variables. The test with getenv("PATH") only returns an empty response.
    Please check the installation documentation for php configuration notes and the php configuration of your server, especially when using php-fpm.
  • No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our documentation.
  • The "Strict-Transport-Security" HTTP header is not configured to least "15768000" seconds. For enhanced security we recommend enabling HSTS as described in our security tips.
Please double check the installation guides ↗, and check for any errors or warnings in the log.

I have read all of the installation guide, and the only help is a recommendation to load a cache system called APCu, but PHP configuration is WAY over my head.

I basically used DRKK's guide all the way through, and just did a bit of MYSQL config on the back end. I know nothing about SQL, but the very limited configuration was pretty easy.

Any help on this PHP stuff would be greatly appreciated.

Had the exact same warnings as you. I managed to solve them with a bit of searching on Google (I'm a total noob on these matters, but with proper guidance, it proved to be quite a piece of cake).
Here is the solution for every warning :

1) I couldn't get a proper solution here, because of the lack of info on CGI. Seems to be pretty outdated. I switched to fastCGI instead, using DrKK's guide (just copied its fastcgi.conf). Worked for me (I tweaked the php-fpm beforehand, so I don't know if those steps are useful or not, but I assume it wasn't).

2) You need to install a memcacher :
Code:
pkg install devel/pecl-APCu

Then go in your owncloud config.php and add the line
Code:
'memcache.local' => '\OC\Memcache\APCu',

(for more info on memory caching, see https://owncloud.org/blog/making-owncloud-faster-through-caching/)

3) Go in your lighttpd conf and add these lines at the end :
Code:
server.modules += ( "mod_setenv" )
$HTTP["scheme"] == "https" {
setenv.add-response-header = ( "Strict-Transport-Security" => "max-age=63072000; includeSubdomains; preload")
}

(see https://raymii.org/s/tutorials/HTTP_Strict_Transport_Security_for_Apache_NGINX_and_Lighttpd.html for more info).

Hope that works for you.

EDIT : I now have another problem I can't seem to solve. Whenever I try to upload files greater than 1MB, I get the "Request Entity Too Large" error. I specified both the "post_max_size" and "upload_max_filesize" big enough (4000M) in php.ini, .htaccess and .user.ini. Just to be safe. But that still didn't help (In Owncloud's WebGUI options, the upload limit appears to be 4GB). I also tried to upload in HTTP and HTTPS, same result. I guess it has to come from Lighttpd. I verified the upload directory, even set the persmissions to 777 just to be sure, doesn't give any better results. I'm really out of ideas here, if anyone could help I'd be grateful.
 
Last edited:

jerryjharrison

Explorer
Joined
Jan 15, 2014
Messages
99
Meslow,

Thanks for the help. You definitely got me pointed in the right direction on issues 2 and 3. As far as issue number 1 goes, I am running plain old CGI per DrKK's video. I tried to convert to FastCGI, but after correcting modules.conf, regardless of how I configure fastcgi.conf, I cannot get past the Forbidden 403 error. I have tried using the straight version from DrKK's guide, as well as the sample corrected for a few things. I am now back on plain old CGI, and just the one remaining error.

I will keep researching the issue.
 

jerryjharrison

Explorer
Joined
Jan 15, 2014
Messages
99
Ok, I may have celebrated a bit too early. I am seeing an issue with my OwnCloud installation, and a new error (beyond issue number 1 referenced above).

Issue #1 - when I attempt to upload a 13KB file, I am getting an error "Request Entity Too Large". There is no entry in the owncloud.log that corresponds to this error, and if I attempt to sync that file from the desktop, it disconnects the desktop Owncloud from the server until I remove that file from the local directory. I get the error msg of "Request Entity Too Large" when I upload through the browser. It is worth noting that my .htaccess and .user.ini files have all been modified to allow 8G file to be uploaded, and both "post_max_size" and "upload_max_filesize" accurately show their respective values when I run phpinfo.php. When I hover a mouse over the upload button on the browser version of Owncloud it reflects a 7.9G limit on uploads. All of my research on the web points to changing these parameters, but I don't think that my issue is from these parameters.

It is important to note that many files uploaded and sync'd without error prior to the error appearing. The same error is showing in red on the desktop client, and it will not connect to the server.

New Error: After getting the other two errors cleared up, I have a new one: Your web server is not yet set up properly to allow file synchronization because the WebDAV interface seems to be broken."
 

Messlow

Dabbler
Joined
Jan 12, 2015
Messages
10
Seems like the "Request Entity Too Large" might come from the same issue I'm facing. Still no luck for me in trying to solve that.
By the way, I just realised I haven't even thank you DrKK for this guide, so please accept both my apologies and my thanks for this really nice guide. This got me to try and learn and a bit more about php and http servers, which I never fully understood before. So thanks again for that.

EDIT : This is due to a number of file descriptors problem. To be able to upload larger files, increase max-fds in lighttpd configuration. However, there is a Lighttpd bug, causing the same problem for files greater than 4MB (see this link). The bug is fixed, but the revision is not yet released. I'm gonna try to apply the modification in the source and make lighttpd again, I'll keep you informed.

EDIT 2 : Ok, it's fixed now. Well kinda. Here is the fix :
Fetch and extract lighttpd port :
Code:
 portsnap update
cd /usr/ports/www/lighttpd
make fetch
make extract
nano ./work/lighttpd-1.4.36/src/chunk.c

Then change the file according to this link.
Then compile
Code:
 make reinstall clean

Restart lighttpd, and you're good to go.
Btw, have a look at lighttpd error log if you have other problems, it will give you further details than "Request entity too large".

However, I had another issue after that, an error in mod_fastcgi.c whenever i upload a big file. I switched back to plain CGI, thus having the issue #1 mentioned above (php can't query system environment variables). I'll have a deeper look into that when I have more time, but it shouldn't be much of a problem).
 
Last edited:

jerryjharrison

Explorer
Joined
Jan 15, 2014
Messages
99
Messlow,

Thanks for the information. I followed instructions, but am still getting the Request entity too large error. I am able to follow your instructions, but have no knowledge of the workings of PHP. If you will point me to where the error log might reside, I will have a look at it.
 

Messlow

Dabbler
Joined
Jan 12, 2015
Messages
10
Lighttpd's log is in /var/log/lighttpd/error.log.
The fix I explained above aims at correcting the "Too many open files" error in "chunk.c". However, if you have a different error, I won't be of much help.

EDIT : I also fixed the PATH environment variable issue with CGI by adding this line in lighttpd.conf:
Code:
setenv.add-environment = ( "PATH" => env.PATH)

Make sure mod_setenv is enable in your modules.conf.
 
Last edited:

jerryjharrison

Explorer
Joined
Jan 15, 2014
Messages
99
Messlow,

I appreciate all of the help. I went and looked at the error log, and the fix you suggested above took care of the error we were working on. Your subsequent suggestion on the environment variables fixed that issue as well. A final check of the error log revealed that lighttpd could not locate the upload directory I had indicated to use, so I went back to the default of /var/tmp and all is now working perfectly.

I REALLY appreciate your, and DrKK's (who assisted on the initial install) assistance. Hope I can contribute back as effectively.
 
Status
Not open for further replies.
Top