Server OS and Third Party Software Setup
How to setup the server including OS installation, third party software and components installations.
Contents
Requirements
Needed to install Variations:
- Linux server with root access
- 2 or 3 static IP addresses - This is to avoid a conflict on port 80. One address is for the Darwin Streaming Server and one for the Apache webserver. A third IP address can be used to refer to the server in general and for RMI traffic. The following directions assume three static IP addresses have been created and will be used in the manner specified above.
OS and 3rd-Party Software Installation
Note | ||
---|---|---|
| ||
Perform the following installation steps as root or sudo |
Linux
- Install your choice of Linux distribution.
Indiana University currently runs Variations on Red Hat Enterprise Linux 6 (RHEL 6). Derivatives of it such as Centos or White Box will be very similar, but for other distributions, the filenames and/or procedures may be different. The instructions below are tailored to RHEL6.- Select "Software Development Workstation" when asked about selecting a software set.
- When creating the first user, this can be the "dmlserv" user that is required further on in the installation. ( Variations Administration User Account Creation )
- Set up your RedHat Network subscription, and update to latest release:
yum update - Install needed packages
yum install gd-devel gdbm-devel policycoreutils-python - Ensure that hostname -ireturns the numeric IP address and not the host name.
- If hostname -i returns the IP and 127.0.0.1, edit /etc/hosts so that the ::1 entry has only the values localhost6.localdomain6 and localhost6.
If hostname -i returns the host name, edit /etc/hoststo put the IP and hostname in a separate line entry.
Code Block title Example /etc/hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost 129.12.345.67 taishan.dlib.indiana.edu taishan ::1 localhost6.localdomain6 localhost6
Network Alias Devices
- Create Network Alias Devices
- These IP addresses will be used for the Variations webserver and Darwin streaming server. They must be on the same network as the machine's address. The NETMASK and BROADCAST variables below will be the same as their counterparts in /etc/sysconfig/network-scripts/ifcfg-eth0.
Create an Network Device for the webserver by creating /etc/sysconfig/network-scripts/ifcfg-eth0:0with this content:
No Format DEVICE=eth0:0 IPADDR=Variations webserver IP address NETMASK=Variations webserver netmask BROADCAST=Variations webserver broadcast address ONBOOT=yes BOOTPROTO=static
Create a Network Device for the streaming server by creating /etc/sysconfig/network-scripts/ifcfg-eth0:1with this content:
No Format DEVICE=eth0:1 IPADDR=_Darwin streaming IP address NETMASK=Darwin streaming netmask BROADCAST=Darwin streaming broadcast address ONBOOT=yes BOOTPROTO=static
- Bring up the new devices to verify they are configured correctly:
ifup eth0:0
ifup eth0:1
You will need to do this only once, since they will be brought up when the machine is rebooted.
Firewall
Variations uses the following ports:
- eth0 - TCP 139 and 445 (Samba), 1099 (RMI Registry), 1100 (UI Logging Server), 49930 and 49931 (Variations RMI Server)
- eth0:0 (Apache) - TCP 80, 443
- eth0:1 (Darwin Streaming Server) - TCP 80, 554 and UDP 6970-6999
- Configure the firewall by running System->Administration->Firewall.
- Under trusted services, check SSH, Samba (if using Samba for derivative uploads), Secure WWW, and WWW.
- Under other ports, add 554, 1099, and 1100 (all TCP).
- Then add the following "User Defined" ports:
- 6970-6999 UDP (for Darwin Streaming Server)
- Add this as the range '6970-6999'
- 49930 and 49931 (for RMI servers, i.e., Variations server and lease manager). These RMI port numbers are configurable, and can be set in the file: dml/conf/server/dmlserver.xml .
- 6970-6999 UDP (for Darwin Streaming Server)
Java
- Install Java:
yum install java-1.6.0-sun-devel Create /etc/profile.d/java.shwith this content:
No Format export JAVA_HOME=/etc/alternatives/java_sdk export PATH=$JAVA_HOME/bin:$PATH
Note Check that your JAVA_HOME location and version matches your installation
Modify the file $JAVA_HOME/jre/lib/security/java.policy by adding the lines listed below to the grant block. Modify the IP addresses and machine names to those of the machine for your Variations server.These additions are necessary to get the Variations servers to work. For example:
Example IP
Server
Example DNS Name
129.79.184.181
Variations Webserver (device eth0:0)
129.79.184.188
host machine (device eth0)
Server1.dlib.indiana.edu
No Format permission java.net.SocketPermission "129.79.184.181:80", "connect,resolve"; permission java.net.SocketPermission "Server1.dlib.indiana.edu", "resolve"; permission java.net.SocketPermission "129.79.184.188:1024-", "connect,accept,resolve"; permission java.util.PropertyPermission "dml.client.url.userguidebase", "read"; permission java.util.PropertyPermission "dml.leaseManager.*", "read"; permission java.util.PropertyPermission "dml.login.loginHandler", "read"; permission java.util.PropertyPermission "user.dir", "read"; permission java.util.PropertyPermission "variations2.dir", "read"; permission java.io.FilePermission "<<ALL FILES>>", "read,execute"; permission java.io.FilePermission "/home/dmlserv/content/-", "read,execute,delete"; permission java.io.FilePermission "/home/dmlserv/log/*", "delete,write"; permission java.io.FilePermission "/home/dmlserv/app/public_html/score-leases/-", "read,execute,delete"; permission java.lang.RuntimePermission "setFactory";
Apache
- Install Apache HTTP Server. http://httpd.apache.org/Install version 2.2 or later. Certain parts of Variations require a web server to handle html web pages and cgi-bin scripts.
- The Apache HTTP Server should have been installed with RHEL, check for installation:
yum list httpd - If needed, install apache:
yum install httpd
- The Apache HTTP Server should have been installed with RHEL, check for installation:
Append the following lines to your apache configuration file /etc/httpd/conf/httpd.conf:
No Format # # Variations specific configuration # ScriptAlias /variations/cgi-bin/ "${VARIATIONS_HOME}/app/public_html/cgi-bin/" <Directory "${VARIATIONS_HOME}/app/public_html/cgi-bin"> AllowOverride All Options FollowSymLinks Order allow,deny Allow from all SetEnv VARIATIONS_HOME ${VARIATIONS_HOME} </Directory> Alias /variations/ "${VARIATIONS_HOME}/app/public_html/" <Directory "${VARIATIONS_HOME}/app/public_html"> AllowOverride All Options FollowSymLinks Order allow,deny Allow from all SetEnv VARIATIONS_HOME ${VARIATIONS_HOME} </Directory>
Set the webserver to listen to the network alias.
In the file /etc/httpd/conf/httpd.conf, change the line:No Format Listen 80
to the line:
Panel Listen your-Variations-webserver-IP-address:80
where your-Variations-webserver-IP-address is the IP you assigned to eth0:0.
- Set the webserver to start automatically at boot:
chkconfig httpd on Start the server now:
service httpd startNote Note that Apache is still listening to :443 on all hosts with this configuration.
- SELinux settings for Apache
If SELinux is present and in enforcing mode (default for RHEL), make the following boolean settings to allow browser access to cgi and user (dmlserv) home directores.
setsebool -P httpd_enable_cgi=1
setsebool -P httpd_enable_homedirs=1
setsebool -P httpd_read_user_content=1
- Finally, edit /etc/sysconfig/httpd by adding the following line:
source /etc/profile.d/variations.sh
MySQL
Variations uses two databases for Metadata and Access Management. Currently Variations is configured to work with MySQL and will require that you set up these databases in the configuration of the Variations server. Linux distributions such as RedHat Enterprise 6 already come with the appropriate version of Mysql. If you are using another Linux distribution you may want to check that it has a compatible version of MySQL or download a more current version. For more information on the Variations database see the Databases page
- Check to see if mysql is already installed:
yum list mysql mysql-server - If needed, install mysql:
yum install mysql mysql-server
- Check to see if mysql is already installed:
MySql has internal parameters specifying how long to keep a stale connection before dropping it. For interactive logons this is interactive_timeout and for non-interactive it is wait_timeout. Note that wait_timeout is set from interactive_timeout when the login is interactive. The default setting for these parameters is 8 hours (specified in seconds). After this time, the connection is dropped and cannot be reestablished without restarting the server. To fix this problem set both wait_timeout and interactive_timeout to 24 hours (86,400 seconds) in the MySql configuration file /etc/my.cnf under both the mysqld and mysqld_safesections.
No Format wait_timeout=86400 interactive_timeout=86400 character_set_client=utf8 character_set_server=utf8 default-storage-engine=INNODB
The default minimum length for words used in fulltext indexes is 4. This means that searches for words less than 4 characters will fail (e.g., "U2" or "Yes"). It is probably a good idea to reset this to 1 in the /etc/my.cnf file under both the mysqld and mysqld_safe sections. Also, MySQL has a default stopword file that excludes certain words from the text index, and it may exclude words that users might reasonably want to search on. Therefore, it may be best to turn this off by setting ft_stopword_file to "". For a list of MySQL default stop words, see http://dev.mysql.com/doc/refman/5.1/en/fulltext-stopwords.html. One can also set ft_stopword_fileto the name of a file that contains a custom list of stop words.
No Format ft_min_word_len=1 ft_stopword_file=""
- Set mysql to start automatically at boot:
chkconfig mysqld on - Start the server now:
service mysqld start - Download MySQL Connector/J database driverfor Java (version 5.1 or later).
- Expand the archive and put the file mysql-connector-java-5.1.16-bin.jar in the location _/usr/local/lib/_you can put this file in another location but will need to update the configuration file later.
Perl
- Install Perl
- Check to see if perl is already installed:
yum list perl - If needed, install perl:
yum install perl
- Check to see if perl is already installed:
Install other needed modules and packages
Note Note that cpan is an online repository for perl modules and that installing modules from it may occasionally fail due to failed tests. In these situations, you can pass a flag to the cpan command that forces the installation. Your command should then look like
cpan -fi module
. Note when you do this so that you can be on the lookout for any issues that may arise as a result of these potentially buggy perl modules. You can update the perl modules when a new version is released by running the install command again. Many modules will require dependency modules so make sure to answer yes to the prompts to include them in the build/install process.- Configure and update CPAN:
cpan -i Bundle::CPAN Answer 'yes' to the automatic configuration question. - Install the GD module:
cpan -i GD - Install the GD::Graph module:
cpan -i GD::Graph - Install the CGI module:
cpan -i CGI - Install the LWP module:
cpan -i LWP - Install the Time::Local module:
cpan -i Time::Local - Install the DateTime module:
cpan -i DateTime - Install the XML::LibXML module:
yum install libxml2-devel
cpan -i XML::LibXML
- Install the XML::LibXSLT module:
yum install libxslt-devel
cpan -i XML::LibXSLT
Darwin
- About
The Darwin Streaming Server is an open-source RTP/RTSP server originally developed by Apple as the Quicktime Streaming Server. Darwin is capable of serving MOV and MP4 files that have been hinted for streaming. Variations will use this server to stream audio to the end users. For more information on how Variations' audio streaming works visit the Audio Streaming page. For more information about running Darwin see the Administrator's Guide.
- Darwin Installation Instructions
- Prerequisites
- If installing on a 64-bit system, make sure that 32-bit libraries have been installed:
yum list glibc.i686 libstdc++.i686 - If needed, install them:
yum install glibc.i686 libstdc++.i686
- If installing on a 64-bit system, make sure that 32-bit libraries have been installed:
- Download and Install
- Download Linux Package (for Fedora Core 4 or later, that's us) from:
http://dss.macosforge.org/
At that site, scroll down to Related Links at the bottom, and follow Previous releases.
At the Previous Releases page, under Linux installer (v5.5.5), follow Streaming Server.
At this point an Apple ID login or account creation, and license agreement is required before the download is started. Download to any tidy location. The download will install into proper standard locations. Warning Version 5.5.5 of Darwin Streaming Server is the last version to have a binary build for Linux. Therefore we strongly encourage you to use this version. If you need to install version 6.0.3, then try the instructions here: http://backtogeek.com/2011/09/13/dss-darwin-streaming-server-centos-installer/
- Once downloaded, unpack it:
tar -xzf DarwinStreamingSrvr5.5.5-Linux.tar.gz - Change location into the unpacked directory and invoke the installation script:
./Install- You will be prompted for an administrator user name and password.
- If you get errors from /usr/local/bin/qtpasswd make sure that you have the required i686 libraries then rerun the installation script:
yum install glibc.i686 libstdc++.i686; ./Install
- Make the Darwin log path readable for Variations statistics scripts:
chmod a+rx /var/streaming /var/streaming/logs
- Download Linux Package (for Fedora Core 4 or later, that's us) from:
- Installing Darwin as a Service
To make Darwin start on boot and be accessible as a service in /etc/init.d/follow these steps:- Download the init.d script to /etc/init.d/
- Set permissions on the script:
chmod 755 /etc/init.d/dss - Set dss to run as a service on boot:
chkconfig dss on Darwin Streaming Service is started automatically during the Install.sh script but, if necessary, you can start dss manually by running:
/etc/init.d/dss start
The dss script has five possible actions:
/etc/init.d/dss optionOption
Action
start
Starts the server
stop
Stops the server
status
Provides current running status for streaminaadminserver and DarwinStreamingServer
restart
Does a stop and then a start
condrestart
If Darwin is running, does a stop and then a start
reload
Forces Darwin to reread configuration files without disconnecting users
Configuring Darwin
First, edit /etc/streaming/streamingserver.xmlto bind the streaming server to its assigned IP address:Code Block xml xml <PREF NAME="bind_ip_addr" >your streaming IP address</PREF>
You will need to restart the Darwin Streaming Servers for this change to take effect.
/etc/init.d/dss restart
Point your browser to http://localhost:1220/to access the Darwin management tool.Note If you do not have terminal access to this machine and port 1220 is not open, you can try forwarding an X connection through SSH:
ssh -Y hostname
. This approach requires that X11 is installed on both the server and client of the the SSH connection. Once connected launch the browser of your choice, ie: firefox localhost:1220.The only settings that need to be changed for Variations are:
- Prerequisites
- the Media Directory
/home/dmlserv/content/streaming - enabling Port 80 streaming
Port 80 streaming should be turned on as a fall back for the Variations client in case firewalls or NAT devices prevent it from receiving RTSP (TCP and UDP) traffic properly.
Variations Administration User Account Creation
If the dmlserv user was created during the first boot process, then also
- Change the permissions on dmlserv's home directory:
chmod a+rx /home/dmlserv
If the dmlserv user was not created during the first boot process, then
- Create dmlserv account.
Set up dmlserv account on the server, with home directory of /home/dmlserv.- Create the account:
/usr/sbin/useradd -c "DML Server Account" dmlserv - Set the password:
passwd dmlserv - Change the permissions on dmlserv's home directory:
chmod a+rx /home/dmlserv
- Create the account:
Create /etc/profile.d/variations.sh with this content:
No Format |
---|
export VARIATIONS_HOME=/home/dmlserv export PATH=$VARIATIONS_HOME/app/bin:$PATH |
Note |
---|
Check that your VARIATIONS_HOME matches your install location |
Once VARIATIONS_HOME has been set log out and then back in again and check with echo $VARIATIONS_HOME
. When VARIATIONS_HOME is set properly run the following as root to let SELinux know the proper file contexts for Variations files. Whenever the system performs a relabeling SELinux will use these rules to set the contexts instead of using a default context which would make Variations be blocked by the SELinux policy. You can manually force a relabel using the restorecon command: restorecon -R -v ${VARIATIONS_HOME
}
Code Block |
---|
semanage fcontext -a -t httpd_sys_content_t "${VARIATIONS_HOME}" semanage fcontext -a -t httpd_sys_content_t "${VARIATIONS_HOME}/content(/.*)?" semanage fcontext -a -t httpd_sys_content_t "${VARIATIONS_HOME}/Variations-[^/]*/conf(/.*)?" semanage fcontext -a -t httpd_sys_content_t "${VARIATIONS_HOME}/Variations-[^/]*/data(/.*)?" semanage fcontext -a -t httpd_sys_content_t "${VARIATIONS_HOME}/Variations-[^/]*/public_html(/.*)?" semanage fcontext -a -t httpd_sys_script_exec_t "${VARIATIONS_HOME}/Variations-[^/]*/public_html/cgi-bin(/.*)?" |
Next Steps
You have just finished installing the all of the components needed to install and run the Variations server software. Proceed to the next step and install the Variations Server Software.
Back to the Administrators Guide Home Page