Lychee Photo Hosting?

Lychee Photo Hosting?

Postby andjohn » Fri Apr 13, 2018 5:30 pm

Hello All,
Any chance we could get someone to build Lychee for our lovely nas's? It is fast for sharing pictures with people, etc; and I'd like to see how it works on my big5n2...

https://github.com/electerious/Lychee/b ... llation.md
andjohn
Donator VIP
Donator VIP
 
Posts: 49
Joined: Sun Dec 13, 2015 6:00 pm

Re: Lychee Photo Hosting?

Postby Jocko » Sat Apr 14, 2018 7:15 am

HI andjhon,

You should be able to install it yourself as all required php extensions are already available but I go to look at this apps.

I also notice the recommanded RAM size is 256MB which is big even for a 5big2. I know why. Previously, we had had the same issue with web-explorer. Php (gd extension) needs much memory to create a thumbnail as it decompresses an image file (jpeg) on the RAM before generating the thumbnail. With a small image (low resolution) it is not an issue but not with a file from a camera.

Please to note even with a 5big2,to load a page will take a long time (at least the first time, to generate the thumbnails) and you will have a CPU usage almost 100%
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Lychee Photo Hosting?

Postby Jocko » Sat Apr 14, 2018 9:22 am

Hi

After checking, you can not install yourself lychee : mysql extension is missing.

Need to check why mysql extension is not available
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France

Re: Lychee Photo Hosting?

Postby andjohn » Sat Apr 14, 2018 2:25 pm

Ah yes. I was thinking it was going to be pretty heavy. There's another one called Cherealot or something that might be lighter.
andjohn
Donator VIP
Donator VIP
 
Posts: 49
Joined: Sun Dec 13, 2015 6:00 pm

Re: Lychee Photo Hosting?

Postby Jocko » Sun Apr 15, 2018 10:24 am

Hi andjohn,

Indeed lychee is a nice feature and handy. About memory resource, only when you upload or import new files requires to use much RAM. So set 256MB may be done if there are not many uploads and when you do it users do not request via other servers like resilio; samba exchanges...

With 256MB, you should be able to load pic files with a resolution 20MB pixels (and you need 384MB if resolution is 80MB pixels)

How to install it :
Note: I assume you stores all attached files in fvdw share
Before installing, I advice to select the "High" level of the option "Memory size allocated to the Web server" (from the setup menu, Web server tab).
Indeed this option allows to the apache server to have a better behaviour. If you select it later, some custom php init options will be overwritten !

- install mysqli php extension
Open a shell terminal, and do the command :
Code: Select all
tar -xf /direct-usb/fvdw/fvdw-sl-17-0_PHP-5-6-6_mysqli.tar.gz -C /

Important: You need to repeat this task at each time you upgrade the firmware. But if later we update php version you will need an another mysqli version

- install mysqli addons
Follow the howto of the topic https://plugout.net/viewtopic.php?f=15&t=1324
Some additionnal information, to make a clean start of myspl daemon, use this command
Code: Select all
nohup /usr/local/libexec/mysqld --user=root > /dev/null 2>&1 &
Like this, the daemon is not stopped when you close the terminal.
later I will explain how to start it on nas booting
If you want to set a password for the root mysql user (please to note root mysql user is NOT the root linux account), do this command
Code: Select all
/usr/local/bin/mysqladmin -u root password 'YOUR-PASSWORD'

- install Lychee file
Create a new share (eg. Lychee), I assume on the addons volume (where you have fvdw share), and do this command
Code: Select all
tar -xf /direct-usb/fvdw/Lychee_3.1.6_15apr2018.tar.gz -C /direct-usb/Lychee
Create a share is required because Lychee stores the uploaded files in a subfolder. So you can not install its files on a system partition (no enough space). But also because at each firmware upgrade, you would lose your uploaded files!

Note: do not change Linux permissions and owner on these files.
Note2: if you have set a password on the mysql root account, you need to edit the file data/config.php and to declare the password in this line
Code: Select all
$dbPassword = ''; // Password of the database
. You should not change any other lines.

- define the required php options
IMPORTANT: I assume you did not try to edit php.ini file previously and set these options! If you do it you need to removes them.
on a shell terminal, do
Code: Select all
echo -e "extension=mysqli.so\nmax_file_uploads = 1\n" >>/etc/php.ini
(Be careful uses double '>'!)
And update some existing options
Code: Select all
sed -ie '/max_execution_time.*=/c max_execution_time = 300' /etc/php.ini
sed -ie '/memory_limit.*=/c memory_limit = 256M' /etc/php.ini

Then restart gracefully apache server to load the new values
Code: Select all
/usr/bin/httpd -f httpd.conf -d /etc -k graceful

Note:
1) I did not set the recommanded value for the option "max_file_uploads", 20 simultaneous uploads will overload the NAS, upload files one by one is enough
2) I did not set upload_max_filesize as web-explorer requires to load bigger file size than 20MB! (with web-explorer you can upload upto 1GB file size !)
3) I did not set post_max_size for the same issue
4) upload_max_size is not a init php option ! (so an error of the Lychee developers!)

- last step, link the lychee files in the web root directory
Code: Select all
ln -s /direct-usb/Lychee /usr/htdocs/lychee
Then Lychee app will be available on the url http://nasname/lychee, you can set easily another url by changing the symlink name on the previous command (/usr/htdocs/yourlycheeword)

Now you need to ensure all changes will be restored on NAS rebooting.
- Go to Bootjobs menu, and Set up the feature
- unzip start-lychee file in the folder direct-usb/fvdw/cron-boot (then you should have a file start-lychee.sh)
- Go again to Bootjobs menu (or reload it), select the shell script ("at Next booting" column) and save your change
- Then enable Boot Jobs feature
Note : update these lines if you use other values
Code: Select all
# url word used to load Lychee app
LINK_LYCH=/usr/htdocs/lychee
# lychee share path
SHR_LYCH=/direct-usb/Lychee
# php RAM limit
MEM_LIMIT=256

Then in boot.log file, you will be able to check if Lychee environment is restored at each booting
You do not have the required permissions to view the files attached to this post.
Jocko
Site Admin - expert
 
Posts: 11529
Joined: Tue Apr 12, 2011 4:48 pm
Location: Orleans, France


Return to Development

Who is online

Users browsing this forum: Bing Bot and 20 guests