[MYSQL] HOW-TO: 5 User XBMC

  Thread Rating:
  • 4 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
Ballistic Offline
Senior Member
Posts: 194
Joined: Nov 2009
Reputation: 4
Location: The low countries
Post: #16
Awesome! I can finally roll out XBMC with MySQL database to my friends!
Much appreciated!
find quote
kikinjo Offline
Junior Member
Posts: 47
Joined: Dec 2013
Reputation: 0
Post: #17
(2014-06-06 12:01)N4TH4N Wrote:  I will eventually document the setup procedure of my whole setup including proxy/webcache and will include a section on MySQL permissions.

Hi,

Can u in short words please say what are you using for proxy / webcache, and for what protocols ?
I spent lots of time trying to find good solution for local cache for clients since my Mysql DB is on remote server and i also use Music DB. Running 8 clients on windows and main storage / DB on linux server.

Tried squid proxy for windows, but its not good, since https caching is not possible. Any info would be good. Thanx.
find quote
N4TH4N Offline
Member
Posts: 79
Joined: Jul 2010
Reputation: 6
Location: Australia
Post: #18
(2014-06-06 23:02)kikinjo Wrote:  Can u in short words please say what are you using for proxy / webcache, and for what protocols ?
I spent lots of time trying to find good solution for local cache for clients since my Mysql DB is on remote server and i also use Music DB. Running 8 clients on windows and main storage / DB on linux server.

Tried squid proxy for windows, but its not good, since https caching is not possible. Any info would be good. Thanx.

Hey,

The proxy is used for caching posters, fanart, etc. Basically anything that needs scraping from the internet.

The reason im using it is because i was previously using local .nfo, .tbn and .jpg files which was causing unnecessary hard drive spin ups on my NAS.
XBMC Forum
Lime-Tech Forum

I always document my server setups so here is a quick exert from my evernote.

Install Squid Proxy Server
sudo apt-get install squid
sudo nano /etc/squid3/squid.conf
Find: http_access deny all
Change: http_access allow all
Find: # cache_dir ufs /var/spool/squid3 100 16 256
Change: cache_dir ufs /var/spool/squid3 5120 16 256
sudo service squid3 restart

Basically i just installed squid, allowed access to all, setup the cache directory to 5GB.

To check how big your cache folder is i use this simple command: sudo du -sh /var/spool/squid3

The following is from the squid manual which outlines cache_dir:

Code:
====  The ufs store type  ====

    "ufs" is the old well-known Squid storage format that has always
    been there.

    Usage:
        cache_dir ufs Directory-Name Mbytes L1 L2 [options]

    'Mbytes' is the amount of disk space (MB) to use under this
    directory.  The default is 100 MB.  Change this to suit your
    configuration.  Do NOT put the size of your disk drive here.
    Instead, if you want Squid to use the entire disk drive,
    subtract 20% and use that value.

    'L1' is the number of first-level subdirectories which
    will be created under the 'Directory'.  The default is 16.

    'L2' is the number of second-level subdirectories which
    will be created under each first-level directory.  The default
    is 256.

This is how i have my XBMC clients setup:
[Image: wk1o2.jpg]

Then if you wait a second and go to system info and it still says connected, you know it works.
[Image: xnsyg4.png]

I'm not sure if its the absolute best solution but it seems to work.

Check Out My 5 User XBMC Tutorial
If i have helped you please REP+
(This post was last modified: 2014-06-07 02:31 by N4TH4N.)
find quote
N4TH4N Offline
Member
Posts: 79
Joined: Jul 2010
Reputation: 6
Location: Australia
Post: #19
UPDATE: Now includes a server setup script and new client setup script that can setup 1-5 users. Just leave the names blank for users you don't wish to see on that client.

Check Out My 5 User XBMC Tutorial
If i have helped you please REP+
find quote
N4TH4N Offline
Member
Posts: 79
Joined: Jul 2010
Reputation: 6
Location: Australia
Post: #20
UPDATE: Now with Music database support

Check Out My 5 User XBMC Tutorial
If i have helped you please REP+
find quote
kikinjo Offline
Junior Member
Posts: 47
Joined: Dec 2013
Reputation: 0
Post: #21
Hi N4than,

Thanx for quick reply and provided info. I will try again with squid, but configuration should be much different since all mine DB and files are remote.

Well i think setting squid to cache only http for artwork and thumbnails from internet, and skip all caching for remote video / music files could work.

Any extra settings we could maybe define in advancedsettings.xml for internet / proxy connection ? It would be nice to have exclude option / list if proxy is enabled to specify some destinations we dont want xbmc to go thru proxy, but that just my wishes Smile
find quote
N4TH4N Offline
Member
Posts: 79
Joined: Jul 2010
Reputation: 6
Location: Australia
Post: #22
(2014-06-07 18:24)kikinjo Wrote:  Thanx for quick reply and provided info. I will try again with squid, but configuration should be much different since all mine DB and files are remote.

What protocol are you using to add your sources.

Check Out My 5 User XBMC Tutorial
If i have helped you please REP+
find quote
N4TH4N Offline
Member
Posts: 79
Joined: Jul 2010
Reputation: 6
Location: Australia
Post: #23
UPDATE: Now with Linux support.

Check Out My 5 User XBMC Tutorial
If i have helped you please REP+
find quote
Steini Offline
Senior Member
Posts: 138
Joined: Mar 2010
Reputation: 0
Post: #24
Great tutorial

I have been wanting to implement this for my setup since I hate double scans!

I have a split setup: Multiple clients in house and one at my parents place.

Local clients: Samba + mysql
My parents client: Webdav+ sqlite

This setup works but scanning over webdav is irritating

My first step would be to use your guide to make them a mysql db but I wanted to see if you had any ideas of how I map the filenames?

I could use pathsubstitution for samba>webdav conversion which works but I would love to hear your ideas, maybe a fresh perspective on the whole idea Smile

Thanks
(This post was last modified: 2014-06-07 19:42 by Steini.)
find quote
N4TH4N Offline
Member
Posts: 79
Joined: Jul 2010
Reputation: 6
Location: Australia
Post: #25
(2014-06-07 19:28)Steini Wrote:  Great tutorial

I have been wanting to implement this for my setup since I hate double scans!

I have a split setup: Multiple clients in house and one at my parents place.

Local clients: Samba + mysql
My parents client: Webdav+ sqlite

This setup works but scanning over webdav is irritating

My first step would be to use your guide to make them a mysql db but I wanted to see if you had any ideas of how I map the filenames?

I could use pathsubstitution for samba>webdav conversion which works but I would love to hear your ideas, maybe a fresh perspective on the whole idea Smile

Thanks

Hey,

After putting my thinking cap on. The only thing i could think of is having 2 MySQL servers, one at your place and one at your parents.

It may be possible to clone your MySQL server to your parents with a trigger set to change the path of files.

It would need to adjust 'a78'.'path' from smb://INTERNAL_IP/ to dav://EXTERNAL_IP/

I have not ever used webdav with XBMC, do you know how it stores data in the 'path' table ?

Also what is your upload speed, I'm guessing its quite high to be able to transfer media over webdav.

Check Out My 5 User XBMC Tutorial
If i have helped you please REP+
(This post was last modified: 2014-06-07 20:04 by N4TH4N.)
find quote
Steini Offline
Senior Member
Posts: 138
Joined: Mar 2010
Reputation: 0
Post: #26
Since he only has a openelec box I was hoping to skip the mysql server there.

What I will try is to use pathsubstitution since that is only a few lines of xml which I know works.

Then I will try to open the mysql server over the internet (with some security tweaks like only listen to my parents IP addres

The Webdav works fine, but we are both on 50mb/s links which is more than enough
find quote
N4TH4N Offline
Member
Posts: 79
Joined: Jul 2010
Reputation: 6
Location: Australia
Post: #27
(2014-06-07 20:52)Steini Wrote:  Since he only has a openelec box I was hoping to skip the mysql server there.

What I will try is to use pathsubstitution since that is only a few lines of xml which I know works.

Then I will try to open the mysql server over the internet (with some security tweaks like only listen to my parents IP addres

The Webdav works fine, but we are both on 50mb/s links which is more than enough

It will be interesting to see how the MySQL database holds up over the internet rather then local.

Also pathsubs are probably the easiest solution if using the single MySQL database.

Check Out My 5 User XBMC Tutorial
If i have helped you please REP+
find quote
nickr Offline
Team-Kodi Member
Posts: 18,044
Joined: May 2009
Reputation: 363
Location: Christchurch NZ
Post: #28
(2014-06-07 20:52)Steini Wrote:  Since he only has a openelec box I was hoping to skip the mysql server there.

What I will try is to use pathsubstitution since that is only a few lines of xml which I know works.

Then I will try to open the mysql server over the internet (with some security tweaks like only listen to my parents IP addres

The Webdav works fine, but we are both on 50mb/s links which is more than enough

You would be far better to use an SSH tunnel or vpn for MySQL. Far more secure.

If I have helped you or increased your knowledge, click the 'thank user' button to give thanks :) (People with less than 20 posts won't see the "Thank you" button.)
(This post was last modified: 2014-06-07 22:17 by nickr.)
find quote
kikinjo Offline
Junior Member
Posts: 47
Joined: Dec 2013
Reputation: 0
Post: #29
(2014-06-07 18:39)N4TH4N Wrote:  
(2014-06-07 18:24)kikinjo Wrote:  Thanx for quick reply and provided info. I will try again with squid, but configuration should be much different since all mine DB and files are remote.

What protocol are you using to add your sources.

Video files = https, music = ftp. ftps isnt working fro me at all, and sftp works on main scraping xbmc but not on clients...
find quote
N4TH4N Offline
Member
Posts: 79
Joined: Jul 2010
Reputation: 6
Location: Australia
Post: #30
(2014-06-08 11:24)kikinjo Wrote:  Video files = https, music = ftp. ftps isnt working fro me at all, and sftp works on main scraping xbmc but not on clients...

So you are trying to cache the actual media. If so you cannot cache https data at all since its encrypted point to point. Its just not possible.

If you can access the media over http rather then https you could set squid to save the data, you would just have to increase the overall cache size and allow for files that large, i think by default squid only saves 4mb files, or something quite small.

You would be better off creating a separate thread about setting up a proxy as you will get some better responses there.

Check Out My 5 User XBMC Tutorial
If i have helped you please REP+
find quote
Post Reply