Cannot make the client to work under Apache

213 views
Skip to first unread message

Michael

unread,
May 3, 2011, 8:57:42 AM5/3/11
to Client175
Hi,

I did everything according to the http://code.google.com/p/client175/wiki/BehindApache
The server starts up with no apparent errors (both the site.log and
apache log).
When I try to reach the page , it comes blank (source is completely
empty).
I am running on FC10 under apache 2.2.14 with mod_python 3.3.1 and
python 2.6.
The weird thing is that there are no error messages when I try to go
the page.
At once point I was getting an unrecoverable error (connection lost
while connecting to mpd) but not anymore.
Tried both in Firefox 4.0 and Opera 11.01

There are a few things I am not sure about in the configs.
First , do I really need to specify an additional listening port while
running under apache? (Tried both with and without).
Second what about serversocket and serverport settings in the
site.conf , are these required when running under Apache? (I believe I
tried all combinations with either one of them or both enabled/
disabled).
Attached is the webserver config :
Listen 7777
<Location "/client175">
PythonPath "sys.path+['/var/www/html/client175', '/var/www/html/
client175/cherrypy']"
SetHandler python-program
PythonHandler cherrypy._cpmodpy::handler
PythonOption cherrypy.setup server::serverless
PythonDebug On
</Location>

/var/www/html/ is the server docRoot.

Just to clarify , server works just fine as standalone

Chris Seickel

unread,
May 3, 2011, 9:14:47 AM5/3/11
to clie...@googlegroups.com
Did you also edit the server_root variable in site.conf?  As it ships, it is already set to "/client175" but it is commented out with a semi-colon, you would just need to delete that semi-colon at the beginning of the line.

The host and port variables in server.conf will be ignored when used with mod_python.

Michael

unread,
May 3, 2011, 9:17:36 AM5/3/11
to Client175
Surely did.

I actually used the distro folder after I made it work using the
standalone server.
So I just copied it from there into webroot and made the adjustments.

Michael

unread,
May 3, 2011, 9:21:07 AM5/3/11
to Client175
Sorry forgot to mention that it points to :
/var/www/html/client175 just as the Location directive in the apache
config.

Chris Seickel

unread,
May 3, 2011, 9:28:45 AM5/3/11
to clie...@googlegroups.com
The server_root is a relative path to the root of the web server, so if your location tag looks like this:
<Location "/client175">

Then the server_root option should be this:
server_root = "/client175"

Michael

unread,
May 3, 2011, 9:39:22 AM5/3/11
to Client175
Ok thanks, there is a progress now :)
Back to the unrecoverable error connection lost while reading mpd
hello.
After a few restarts and reloads of the browser it kinda works but
gives an error message about being unable to load list of tags.
The music folder is world readable.

Michael

unread,
May 3, 2011, 9:49:08 AM5/3/11
to Client175
Ok it works (kinda).

The page sometimes starts jerking as if it has trouble updating
itself.
Volume change sometimes gives either mpd connection lost on
unrecoverable error in the gui popup message.
I tried changing ip of the mpd to real ip and back to localhost.
Localhost host seems to be a little bit more stable (not great).

Chris Seickel

unread,
May 3, 2011, 9:49:27 AM5/3/11
to clie...@googlegroups.com
Those errors are all a result of not being able to connect to mpd.  I'm not sure why that would be if it worked using the built-in server....  here are the things I would check:

Are you using other clients at the same time?  There is an option max connections in mpd.conf that i have had to change before.

Does the apache user have permission to create a telnet connection to mpd?

If you were relying on MPD_HOST and MPD_PORT variables when starting it using the built-in server, those variables may not be present for the apache user.  This would only matter if mpd was not listeningt on localhost:6600.

What version of MPD are you using?

Michael

unread,
May 3, 2011, 10:23:22 AM5/3/11
to Client175
Ok I changed max connections to 100 and increased other connection
parameters for the mpd.
Now no more messages while changing the volume.
However there is this thing that sometimes the screen starts jerking
and (song being played start jumping back and forth while the cpu is
up to 50% , volume slider sta).
This happens in Opera and Firefox when trying to change volume.

Michael

unread,
May 3, 2011, 10:24:29 AM5/3/11
to Client175
Sorry here is the mpd version
0.14.2

Michael

unread,
May 3, 2011, 10:44:28 AM5/3/11
to Client175
Sorry , here is some more info.
The site.log gives the following :
[03/May/2011:17:20:56] HTTP Traceback (most recent call last):
File "/var/www/html/client175/cherrypy/_cprequest.py", line 606, in
respond
cherrypy.response.body = self.handler()
File "/var/www/html/client175/cherrypy/_cpdispatch.py", line 25, in
__call__
return self.callable(*self.args, **self.kwargs)
File "/var/www/html/client175/server.py", line 402, in
playlistinfoext
data = mpd.playlistinfo('%d:%d' % (start, end))
File "/client175/mpd.py", line 189, in <lambda>
return lambda *args: self._execute_safe(attr, args, retval)
File "/client175/mpd.py", line 194, in _execute_safe
return self._execute(command, args, retval)
File "/client175/mpd.py", line 212, in _execute
return retval()
File "/client175/mpd.py", line 346, in _fetch_songs
return map(extend_file, self._read_songs())
File "/client175/mpd.py", line 326, in _read_songs
line = read_line()
File "/client175/mpd.py", line 233, in _read_line
raise CommandError(error)
CommandError: [2@0] {playlistinfo} need a positive integer

Chris Seickel

unread,
May 3, 2011, 11:20:46 AM5/3/11
to clie...@googlegroups.com

It has been a while since I tested in firefox, and I haven't done so at all using the apache configuration.

I will have to test it tonight to make sure ther is not a compatability problem.

Michael

unread,
May 3, 2011, 11:29:01 AM5/3/11
to Client175
I dont think it is.
First it takes place both in Firefox and Opera.
Secondly , everything works 100% when run as standalone.
I guess the problem is somewhere in the way the code runs under
mod_python.


On May 3, 6:20 pm, Chris Seickel <cseic...@gmail.com> wrote:
> It has been a while since I tested in firefox, and I haven't done so at all
> using the apache configuration.
>
> I will have to test it tonight to make sure ther is not a compatability
> problem.

Michael

unread,
May 3, 2011, 11:30:22 AM5/3/11
to Client175
Just to clarify, this message (the one I pasted above from the
site.log) is being added about 3 per second in the logs even when the
app is not open in the browser.

On May 3, 6:20 pm, Chris Seickel <cseic...@gmail.com> wrote:
> It has been a while since I tested in firefox, and I haven't done so at all
> using the apache configuration.
>
> I will have to test it tonight to make sure ther is not a compatability
> problem.

Chris Seickel

unread,
May 4, 2011, 4:30:02 PM5/4/11
to clie...@googlegroups.com
I don't why I didn't catch this earlier.  The problem is that MPD version 0.14.2 is not supported.  You'll need to upgrade to 0.15+ to use this client.

0.15 added support for specifying ranges when reading the playlist, as opposed to always loading the entire playlist at once.  You might not have noticed the problem in your initial tests without Apache if you didn't have a large enough playlist to trigger paging.  There are probably other problems that you will have, there were a few upgrades to the protocol in 0.15 that I am taking advantage of.

Michael

unread,
May 5, 2011, 8:26:47 AM5/5/11
to Client175
Thanks, it works perfectly now.
Could be a good idea to add the min version required to system
reqs ;-)
Reply all
Reply to author
Forward
0 new messages