Martin Harrison
2011-Jun-03 18:14 UTC
[Icecast] Icecast authentication cant resolve address on Debian
Hi, I am trying to use the url authentication method but am having trouble getting icecast to work on a Debian installation on a VPS platform. I have logged in my VPS as root and installed icecast using apt-get install icecast2 setup the config file and then set ENABLE=true in /etc/init.d/icecast2 This initialy didn't work as it couldn't access log files and then had trouble with the graphics on the admin pages. I fixed this by copying the graphics from /usr/share/icecast2/web into /etc/icecast/web and by changing the log/web/admin paths from /var/log/icecast to /log and /usr/share/icecast2/web to /web. I also had to change the base dir fromto /usr/share/icecast2 to /etc/icecast as none of the linked xmls files could be read. At this point icecast will run, display the admin pages correctly, allow a source to conenct and users can listen. However when I enable the authentication it fails to resolve the address for the authentication script. The log files contain just two warnings that I don't understand the implications of/can't resolve. [2011-06-03 16:47:46] WARN stats/stats_event_conv No charset found for "ISO8859-1" [2011-06-03 16:55:11] WARN auth_url/url_add_listener auth to server http://www.***.co.uk/online/auth.php failed with Couldn't resolve host 'www.***.co.uk' running curl from the icecast2 account created during the installation works just fine returning * About to connect() to www.***.co.uk port 80 (#0) * Trying 178.250.***.***... connected * Connected to www.***.co.uk (178.250.***.***) port 80 (#0)> GET /online/auth.php HTTP/1.1 > User-Agent: curl/7.18.2 (x86_64-pc-linux-gnu) libcurl/7.18.2OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18> Host: www.***.co.uk > Accept: */* >< HTTP/1.1 200 OK < Date: Fri, 03 Jun 2011 17:22:35 GMT < Server: Apache < icecast-auth-user: 0 < icecast-auth-message: Invalid Stream Requested < Content-Length: 0 < Connection: close < Content-Type: text/html < * Closing connection #0 I am assuing that this is something to do with access rights but am no unix expert (I developed my authentication system with icecast on a windows box trouble free). The relevant sections of the config file are below. any help is really appreciated. <mount> <mount-name>/****.mp3</mount-name> <password>******</password> <intro>/intro.mp3</intro> <charset>ISO8859-1</charset> <public>0</public> <max-listeners>500</max-listeners> <stream-name>My Station</stream-name> <stream-description>Noise on my station</stream-description> <stream-url>http://www.***.co.uk</stream-url> <genre>Speech</genre> <bitrate>64</bitrate> <hidden>0</hidden> <burst-size>65536</burst-size> <authentication type="url"> <option name="listener_add" value="http://www.***.co.uk/online/auth.php"/> <option name="listener_remove" value="http://www.***.co.uk/online/auth.php"/> <option name="auth_header" value="icecast-auth-user: 1"/> <option name="timelimit_header" value="icecast-auth-timelimit:"/> </authentication> </mount> <fileserve>1</fileserve> <paths> <basedir>/etc/icecast2</basedir> <logdir>/log</logdir> <webroot>/web</webroot> <adminroot>/admin</adminroot> <alias source="/" dest="/status.xsl"/> </paths> <logging> <accesslog>access.log</accesslog> <errorlog>error.log</errorlog> <loglevel>3</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error --> <logsize>10000</logsize> <!-- Max size of a logfile --> </logging> <security> <chroot>1</chroot> <changeowner> <user>icecast2</user> <group>icecast</group> </changeowner> </security>
Karl Heyes
2011-Jun-03 18:44 UTC
[Icecast] Icecast authentication cant resolve address on Debian
On 03/06/11 19:14, Martin Harrison wrote:> Hi, > > I am trying to use the url authentication method but am having trouble > getting icecast to work on a Debian installation on a VPS platform. > > I have logged in my VPS as root and installed icecast using > > apt-get install icecast2 > setup the config file and then set ENABLE=true in /etc/init.d/icecast2 > > This initialy didn't work as it couldn't access log files and then had > trouble with the graphics on the admin pages. > I fixed this by copying the graphics from /usr/share/icecast2/web into > /etc/icecast/web and by changing the log/web/admin paths > from /var/log/icecast to /log and /usr/share/icecast2/web to /web. > I also had to change the base dir fromto /usr/share/icecast2 to > /etc/icecast as none of the linked xmls files could be read. > > At this point icecast will run, display the admin pages correctly, allow a > source to conenct and users can listen. > > However when I enable the authentication it fails to resolve the address > for the authentication script. The log files contain just two warnings > that I don't understand the implications of/can't resolve. > > [2011-06-03 16:47:46] WARN stats/stats_event_conv No charset found for > "ISO8859-1" > [2011-06-03 16:55:11] WARN auth_url/url_add_listener auth to server > http://www.***.co.uk/online/auth.php failed with Couldn't resolve host > 'www.***.co.uk'> I am assuing that this is something to do with access rights but am no > unix expert (I developed my authentication system with icecast on a > windows box trouble free). > > The relevant sections of the config file are below. any help is really > appreciated.> <paths> > <basedir>/etc/icecast2</basedir>> </paths>> <security> > <chroot>1</chroot>The distribution package makers should take more care in such cases. If you want to use DNS names then the mechanism for name lookups needs to be complete if you want to use a chroot jail. This means that the configuration files or libraries need to exist within the jail. The simplest change would be to use the IP address as that won't require the lookup or avoid the chroot to avoid the restricted directories (use full paths) but if you want the DNS lookup in a jail then the mechanism is basically /etc/nsswitch.conf read hosts: entry lib load of /lib/libnss_... (file, dns etc depending on the protocol) /lib/libnss_dns... reads /etc/resolv.conf karl.