How to access media on windows network share

Windows related discussion about netjukebox
Locked
simonmason
User
Posts: 16
Joined: Sun Apr 12, 2009 4:15 pm

How to access media on windows network share

Post by simonmason »

My media is stored on a different PC than my web server. Both are running WinXP. I have a drive mapped to the media directory X: mapped to \\media\MP3\. "X:/MP3/" doesn't work for the media_dir. I tried replacing this with the share name: //media/MP3/" and this didn't work either. The directory is shared with full rights so there shouldn't be an issue with permissions. I could add a symbolic (winbolic) link to the directory but I would prefer not to as these get tricky. Any thoughts? Thanks.
jeremy
User
Posts: 36
Joined: Sun Apr 27, 2008 9:15 am

Re: How to access media on windows network share

Post by jeremy »

I access all my media on a samba share, mapped as a network drive (O:). The solution to your problem that most people suggest is to change the username of the apache service you're running to one with network privileges. By default the apache service runs under the "Local System" account, which has very limited access to the network for security reasons. You want to go into your services manager (start -> run -> services.msc) and change the login for your apache server to your username or another with network access.

Reboot, and that should work. However, for me, for whatever reason, it doesn't. I've never been able to get that to work for any services. They always fail to access the network. My solution has been to run Apache / MYSql as regular user programs, not services. This means they don't launch at startup, and they require me to start them manually on reboot, but at least it works. I run XAMPP, which makes this process pretty straightforward.

Once you do one of these solutions, "X:/MP3/" should work just fine.

Good luck!
Jeremy
simonmason
User
Posts: 16
Joined: Sun Apr 12, 2009 4:15 pm

Re: How to access media on windows network share

Post by simonmason »

Thanks, I tried changing the user login for the service and it didn't work. I am not using XAMPP. How do it stop these two applications loading as services and place them in the Windows Startup folder instead? Thanks.
jeremy
User
Posts: 36
Joined: Sun Apr 27, 2008 9:15 am

Re: How to access media on windows network share

Post by jeremy »

What apache package are you using? XAMPP gives you the option of running apache & mysql as services or as manually executed programs (also comes with filezilla FTP server, which must run as a service). I'd suggest trying XAMPP if you can't get it sorted on whatever you're using.
simonmason
User
Posts: 16
Joined: Sun Apr 12, 2009 4:15 pm

Re: How to access media on windows network share

Post by simonmason »

I installed Apache myself. I am running version 2.2.6. I also installed MySQL myself. I am hesitant to go with XAMPP because I have other applications using Apache and MySQL and I don't want to screw them up. Can I install just the XAMPP interface with an existing Apache and MySQL installation? If not, any pointers on changing the loading of these services to applications? Thanks.
DaOctavio
User
Posts: 1
Joined: Sun Apr 19, 2009 1:49 am

Re: How to access media on windows network share

Post by DaOctavio »

I am also running netjukebox on a box seperate from my main computer. Do I NEED to have write privaleges enabled on my library for it to work. I would like to avoid doing so but if it cannot be helped than so be it. What exactly does it even write?
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: How to access media on windows network share

Post by wbartels »

This is how I have setup the server to play music on a remote (LAN) computer with Winamp + httpQ plugin.
This is of course not the only way how you can setup the server, but I think this is the easiest way.
I hope the pictures will make it easier to understand.

If you have the web server and Winamp + httpQ plugin on the same computer there is no need to create a network share.
For streaming you only need a media player, so there is no need to create a network share or a Winamp httpQ plugin.

Configuration of the config.inc.php file:
Image

Make a network share:
Image

Only read access is needed on the network share:
Image

Create or edit an existing player profile:
If you access the web page from a LAN IP range (192.168.x.x or 10.x.x.x) from the client computer where Winamp + httpQ is running on you can use "Auto detect > Client".

In this example I have the following setup:
192.168.1.1 is the local IP address from my network share (and web server)
SERVER02 is the name of the client computer where Winamp + httpQ is running on.
Image
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: How to access media on windows network share

Post by wbartels »

DaOctavio wrote:I am also running netjukebox on a box seperate from my main computer. Do I NEED to have write privaleges enabled on my library for it to work. I would like to avoid doing so but if it cannot be helped than so be it.
See previous post.
DaOctavio wrote:What exactly does it even write?
netjukebox writes a id per album like: b7308dfvtt.id
This way netjukebox recognizes the album even after renaming the album or artist directory.

The tracks are recognized by the album id in combination with the filesize and a 5kB hash (fingerprint) from the media file.
So even when renaming a track the favorites should still work, of course after a full update.
simonmason
User
Posts: 16
Joined: Sun Apr 12, 2009 4:15 pm

Re: How to access media on windows network share

Post by simonmason »

Thank you for the screen shots. I don't think however that this addresses the issue? In the example you provided it appears that the media is stored on the same computer as Netjukebox and Apache. In my case the media is stored on a media server. Netjukebox is stored on the web server. I do not want to install a web server on my media server because it is open only to my internal network. When I configure Netjukebox to point to the media server directory in order to access the files it returns the error that it can't open the directory. In my case this is X:\MP3. On the web server, X:\MP3 is mapped to a share on another computer. I have tried putting it in as \\computer\mp3\ and this doesn't work either. If I point Netjukebox to a local directory on the web server it works fine.

Based on the posts of one of the other users it appears to be the rights of either the Apache server (or possibly MySQL) to access this directory. I tried changing the startup user for Apache to use an admin account but this did not work.

Is there a debug mode in the scripts that can show me exactly where it is failing so I could diagnose where it is failing to read this directory and why? Thanks.
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: How to access media on windows network share

Post by wbartels »

simonmason wrote:Is there a debug mode in the scripts that can show me exactly where it is failing so I could diagnose where it is failing to read this directory and why? Thanks.
On the bottom of the config.inc.php file:

Code: Select all

$cfg['debug_message']               = true;
simonmason
User
Posts: 16
Joined: Sun Apr 12, 2009 4:15 pm

Re: How to access media on windows network share

Post by simonmason »

I turned on debug and it was failing at the opendir command on line 1377 of update.php. I tried adding a couple of things to the code, including mapping the network share from within the code to see if that would work but nothing seems to prevent this error. This is a very common problem - I have had this issue with numerous other applications on my web server - the only resolution that I know works is creating a symbolic link to the network share, but this introduces a while set of other problems. So I gave up and made a copy of my media onto the web server - which is not a bad thing as it creates a nice backup.
jeremy
User
Posts: 36
Joined: Sun Apr 27, 2008 9:15 am

Re: How to access media on windows network share

Post by jeremy »

Sorry you didn't get it sorted. I share your pain. Like I said, I've never gotten login permissions to solve this issue with several services, including apache. You could always install a copy of xampp along side your current Apache install (new directory, obviously) just to see if running Apache/MySQL as non-services would fix it like it did for me. I don't mean to pimp it, but XAMPP is extremely simple to install. Might be worth a shot just to see if that is indeed the issue.

Here are some threads that may also offer some clues/solutions:
http://social.msdn.microsoft.com/Forums ... c18749e2ff
http://bytes.com/groups/net-c/256844-wi ... ng-network
http://support.microsoft.com/kb/149984
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: How to access media on windows network share

Post by wbartels »

Took me some time to find this related topic from a few years ago.
Back then I had apache successfully running as a service with network access.

Network share as media folder

The user that runs the apache service must also be on the computer with the network share, and with the same password!
Hope this will help.
simonmason
User
Posts: 16
Joined: Sun Apr 12, 2009 4:15 pm

Re: How to access media on windows network share

Post by simonmason »

I did try this, moving the Apache service to another user and it didn't work. I am curious about your comment about the "same" password. Same password as what? The user that Apache was originally using to load with? Thanks.
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Re: How to access media on windows network share

Post by wbartels »

Apache computer
Create a local user for example apache_user.
Run the apache service with apache_user.

Network share computer
Also create apache_user on this computer.
On the network share add apache_user to permissions.

The apace_user must have the same password on both computers.
Locked