Compiling Darwin Streaming Server for Centos 5 x86-64

Darwin Streaming Server works well on Linux, and on my preferred platform CentOS 5, but not without compiling it yourself. Linux is not a supported platform in the code provided by Apple, but fortunately a patched version of the source has been provided by a member of the DSS community.

To use Darwin Streaming Server on CentOS 5, follow these steps:

1) Get and install RPM building tools and the source RPM:

yum install rpm-build gcc make gcc-c++ perl-Net-SSLeay
rpm -i DarwinStreamingServer-6.0.3-2.src.rpm

2) Build the source RPM:

cd /usr/src/redhat/SPECS/
rpmbuild -bb DarwinStreamingServer.spec

3) Install the built RPM:

cd /usr/src/redhat/RPMS/x86_64/
rpm -U DarwinStreamingServer*

4) The install will hang after warning you to change the password with qtpasswd (you certainly should do so), resolve it by killing the DSS daemon from another shell session:

killall -9 DarwinStreamingServer

And that’s it. There are plenty of resources out there for using and configuring DSS that can take you from here, but you can find the config at /etc/dss/streamingserver.xml, the logs are at /var/log/dss/ and the video files are at /var/dss/movies. By loading rstp://<yourserver>:554/sample_100kbit.mp4 you can verify everything is working.

Resolving PHP-MySQL Connection Issues

I ran into an interesting issue when installing WordPress on my re-installed server, I could not get a database connection during installation. I added some debugging and discovered that I had a “Can’t connect to MySQL server on” error returned after the call to mysql_connect() in PHP.

To check the source of the issue I then tried to connect on the command-line using the mysql client, which occurred successfully, confirming that I was using the correct credentials and host address (this was a remote MySQL server).

I next created a test PHP script with a simple mysql_connect() call, and executed it with “php test.php” from the command-line, which was also successful.

Finally I accessed test.php through a browser, where again the connection failed.

So I was dealing with a situation where it was Apache in particular that was unable to connect to the remote MySQL server. Thanks to Wez Furlong‘s ideas I was able to narrow this down to SELinux blocking outgoing communications by Apache.

So, if you’re having issues with Apache and specifically connecting out, you may want to disable SELinux for Apache.