Sunday, November 18, 2012

Updating Drupal Core.

Updating Drupal Core always is a litte bit hardcore.
You need first delete most of the old code. Here is a step by step instruction for the update process.
 It is assumed that your custom modules and templates are in the sites/all folder.
Otherwise you get some more work to save the files. If you want to preserve your .htaccess robots.txt and favicon.ico save it before updating.
1. Backup of your Drupal instance.
2. Download the latest release of your current Drupal version.
3. Extract the [tar ball or zip] Drupal package.
4. Set your site on maintenance mode
5. Delete all the files & folders inside your original Drupal instance except for /sites folder and any custom files you added elsewhere.
6. Copy all the folders and files except /sites from inside the extracted Drupal package [tar ball or zip package] into your original Drupal instance.
7. If the update release includes changes to settings.php replace old settings.php in .../sites/default/ with the new one, and edit site-specific entries (eg database name, user, and password)
8. If you modified files such as .htaccess or robots.txt re-apply those changes to the new files.
9. Login to your site as administrator or as user no 1
10. Run update.php by navigating to http://...yoursitename/update.php
11. Follow the process to update your Drupal instance 12. Disable maintenance mode

Tuesday, November 13, 2012

Centos - Installing graphical X Window System (Boot Options, startx from command line)

Installing GUI

Installing the Graphical Window System (X.org-X11) and the Default Desktop Environment on CentOS 6

Performing the default "Minimal" install of CentOS 6 does not install the graphical subsystem (the X.org server) and the desktop environment (e.g. GNOME or KDE). Such OS install is nice for building an optimal system from scratch, setting up a headless server (no monitor, keyboard and mouse) and other purposes; but for one reason or another, you may still require a graphical user interface (GUI). This tutorial will show you how to install and start the graphical window system and the desktop environment of your choice.

To achieve the task, you will need to install the following package groups (groups of packages combined for a common purpose): "X Window System", "Desktop", "Fonts" and "General Purpose Desktop" (last two are optional). This will install about 500 additional packages on your system (~250MB download, or you may use the available OS installation DVD to retrieve packages).

Code:
yum -y groupinstall "X Window System" "Desktop" "Fonts" "General Purpose Desktop"
(Please enter this as is - package group names as well as package names are case sensitive).

Previous versions of RHEL and its derivatives provided a package group called "GNOME Desktop Environment", that was sufficient for a general purpose GNOME desktop. Currently, package group "Desktop" installs all critical components of GNOME, including gdm (the GNOME Display Manager), plus a few additional packages; enough to provide a minimalist GNOME desktop with mouse support, a graphical file manager, copy/paste functionality and the luxurious GNOME Terminal emulator - maybe just what you need. Thus, installing the "General Purpose Desktop" package group is optional, but will help you mimic the system you would probably get if you where to include the default graphical desktop during OS install. Alternatively, you can chose a single package group "KDE Desktop", for a general purpose KDE Software Compilation.

It is generally recommended to install the "Fonts" package group to improve usability of the GUI, no matter what desktop environment you choose to install.

You may view the complete list of available package groups by issuing:



Code:
yum grouplist
You may review the contents of each package group by entering:

Code:
yum groupinfo "Name of the Package Group"


Enabling booting into GUI - start GUI from command line

To boot directly into GUI, you will need to manually change the runlevel of the system from 3 (full multiuser environment with networking) to 5 (the same as mode 3 + X11), by changing the line "id:3:initdefault:" to "id:5:initdefault:" in /etc/inittab file. Or you can manually start X.org from console, by entering "startx" (without quotes).

Upon installation and subsequent reboot, you will be presented with the "Setup Agent" interface (even if you choose to stay in runlevel 3, you will see the text user interface of this tool - hence, the options provided will be different from the graphical variant). This is due to package "firstboot" being automatically installed by the "X Window System" package group and can be a handy way to setup a freshly installed system. All steps in "Setup Agent" are optional, so you can just skim through them, skipping any. Though, creating a new normal user on a freshly installed system is done best through this graphical tool, as it helps automatically create the new user and associate it with groups (such as the "video" group) appropriate for everyday use in a GUI environment . 


If you have installed the X Window System but are not seeing a graphical desktop environment once you log into your Red Hat Enterprise Linux system, you can start the X Window System graphical interface using the command startx.
Once you enter this command and press Enter, the graphical desktop environment is displayed.
Note, however, that this is just a one-time fix and does not change the log in process for future log ins.
To set up your system so that you can log in at a graphical login screen, you must edit one file,/etc/inittab, by changing just one number in the runlevel section. When you are finished, reboot the computer. The next time you log in, you are presented with a graphical login prompt.
Open a shell prompt. If you are in your user account, become root by typing the su command.
Now, type gedit /etc/inittab to edit the file with gedit. The file /etc/inittab opens. Within the first screen, a section of the file which looks like the following appears:
# Default runlevel. The runlevels used by RHS are: 
#   0 - halt (Do NOT set initdefault to this) 
#   1 - Single user mode 
#   2 - Multiuser, without NFS (The same as 3, if you do not have networking) 
#   3 - Full multiuser mode 
#   4 - unused 
#   5 - X11 
#   6 - reboot (Do NOT set initdefault to this) 
#  id:3:initdefault:
To change from a console to a graphical login, you should change the number in the lineid:3:initdefault: from a 3 to a 5.

Warning

Change only the number of the default runlevel from 3 to 5.
Your changed line should look like the following:
  id:5:initdefault: 
When you are satisfied with your change, save and exit the file using the Ctrl-Q keys. A window appears and asks if you would like to save the changes. Click Save.

Sunday, August 19, 2012

Install and run NTP on Centos

Having an accurate clock on your system is usually important. It ensures the time stamps in emails sent from the machine are correct, and it is especially helpful when you need to look at the logs from a particular time of day.

Network time protocol

That's where the network time protocol (NTP) comes in. NTP lets you automatically sync your system time with a remote server. Setting up an NTP server to regularly adjust your machine's clock is pretty easy by default. It's also possible to make it a bit more complicated if you need your clock accurate down to the millisecond instead of just to the second.

Install

The first thing to do is install the NTP server.
Grab the package by running:
sudo yum install ntp

Once it's installed you can ensure the service will run at boot time by running:
sudo /sbin/chkconfig ntpd on

Start the service
To make sure the NTP service starts after installing it, run:
sudo /etc/init.d/ntpd start

As is usual for Linux services, you can stop or restart the NTP service by running the above command with "stop" or "restart" sent as the argument instead of "start".
Your system time is now served by NTP.

Fine Tuning

The ntp.conf file.The NTP configuration file can be found at:

/etc/ntp.conf

There are a few settings that can be changed in there, but for most people the only settings of interest would be any "server" entries.
The default for CentOS looks like:

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
server 0.centos.pool.ntp.org
server 1.centos.pool.ntp.org
server 2.centos.pool.ntp.org

With more than one "server" entry your NTP server will query all servers and only select a time that a majority of the polled servers will agree on. This basically means that with three or more servers your clock will be more accurate than if it just uses one. If you add the "iburst" option after the server address it can speed up the NTP time sync by a bit. It's usually a good idea to use it, but not essential.

Further Reading:
ntp.org

Sunday, July 29, 2012

Encoding video with encoding.com

Encoding can be a hard job. Why not outsource it? Encoding.com takes your video, encodes it and sends it back to you. For small consumers and testing purposes there is a free package available. 
There are different methods to send your video. 
Desktop Application — An Adobe Air application available on both Windows and OSX platforms enables complete upload and management of your encoding projects directly from your desktop. 
Web Interface — The client interface has a section entitled Add Media. This tool will allow you to quickly and easily encode individual videos in to one or more formats through your browser (via upload from hard drive, FTP, SFTP, S3, CloudFiles).
Watch Folder — Also in the client interface, the Watch Folder allows you to specify an FTP/SFTP/S3/CloudFiles directory for encoding.com to "watch" at any frequency for new videos. After each watch interval all new videos added to this folder will be processed using the encoding setting you selected. You can have as many watch folders as you like, making it possible to encode a large video library with little or no setup or integration work. Please see our collection of articles about the Watch Folder for more details. 
XML API is the most flexible method. Custom file naming, multiple output formats and real time encoding status updates are important features available via our API. 


Uploading the file via web interface

Drag and drop uploading via the Desktop Application



After uploading your video you can start encoding.
Basic encoding settings are 
Audio Codec, Bitrate, Destination Locations, File Size, Framerate, Notifications, Output Type, Source Video Locations and Thumbnails.

Choose your encoding task



Task overview

When the task is finished encoding.com sends the file to the  Network of choice: S3, CloudFiles, FTP, or most commonly, directly to your Content Delivery ce (Akamai, EdgeCast, Highwinds, CloudFront, Level 3, Limelight, CDNetworks, NetDNA, etc.) or you can download it manually.
Possible Third Party integrations are:
Amazon S3 Cloud Storage, CMS Systems (Drupal, etc.), Content Delivery Networks (CDN), Flash Players, Rackspace Cloud Files and Video Platforms can be linked to encoding.com.

Link to encoding.com

Saturday, June 9, 2012

Wowza and Red5 same server

Sometimes it is useful to have  Wowza and Red5 on the same server. As both use the same ports, you have to change them in one applicattion.

Wowza default ports:

The following ports are used by default by Wowza Media Server 3 for streaming. You will need to open up these ports on your firewall to enable streaming. 

  • TCP 1935: RTMP (all variants), RTSP, Smooth and Cupertino Streaming
  • UDP 6970-9999: RTP UDP Streaming
  • TCP 8084-8085: JMX/JConsole Monitoring and Administration
  • TCP 8086: HTTP Administration

Red5 default ports:
  • RTMP: 1935
  • RTMPT: 8088
  • HTTP servlet engine port: 5080
  • Debug proxy port: 1936





Here is how to do change ports in Red5:



The first file we need to modify is the server properties file located in the conf directory:
red5/conf/red5.properties
  • Locate the http.port key and change it to 80 (or whatever you want)instead of 5080
  • Locate the proxy.source_port an change it to 1937 (or whatever you need)
  • Do not change the rtmpt.port entry, it should be 8088
  • Save and close the file
  • If you have any webapps do not forget to modify the ports in the red5/webapps/yourapp/config.xml
  • restart Red5





Tuesday, March 20, 2012

Install Kaltura from SVN


Pre-Installation Considerations:


PHP:

  • The current version of the Kaltura CE supports both PHP 5.3 and PHP 5.2.
  • Both php and php-cli must be present.
  • The following php extensions should be included and enabled: Gd, Curl, Memcache, Mysql, Mysqli, Exif, ftp, iconv, json, Session, apc, spl, DOM, SimpleXML, xml, xsl, ctype; 
  • Verify that the following settings within the php.ini file on each server: 
  • For PHP 5.3: Verify that request_order parameter includes C, G and P (recommended: "CGP") 
  • For PHP 5.2: Verify that variables_order parameter in php.ini includes C, G and P Please verify that date.timezone parameter was set to the right timezone.

minimal Hardware specifications:

1GB RAM, 2 CPUs


Apache:

Apache 2.2 or higher with following modules enabled: rewrite, headers, expires, filter, deflate, file_cache, env, proxy


MySQL:

MySQL 5.1.37 or higher.
Verify that mysql server character set is UTF8.
The following lines should be added to the MySQL my.cnf file:
lower_case_table_names = 1
thread_stack = 262144
open_files_limit = 20000
MySQL should be restarted after this adjustment is made
(Plesk will not allow lower_case_table_names = 1)


curl: Should be installed

memcached:  Should be installed

ImageMagick: Should be installed


32-bit packages required on 64-bit servers:

Some of the binaries that are in use by the Kaltura Platform are available in a 32-bit compiled version only. to enable these binaries
the following packages (or equivalents per Linus Distribution) may be required on a 64-bit server:  
Ubuntu:
a32-libs, lib32asound2, lib32gcc1, lib32ncurses5, lib32stdc++6, lib32z1,  libc6-i386
CentOS:
glibc.i686 , ncurses-libs,  zlib-1.2.x ,  freetype , bzip2-libs




Java:
JRE 1.6.x:Required for the video analytics module


Pentaho 3.2:


This is an open source data integration package, required for the video analytics module The data-integration package should be downloaded and installed within the /usr/local/pentaho/pdi directory
i.e.
- Create the /usr/local/pentaho/ directory
- Download and extract the pentaho data-integration package into the /usr/local/pentaho/ - package is available at: http://sourceforge.net/projects/pentaho/files/Data%20Integration/3.2.0-stable/pdi-ce-3.2.0-stable.tar.gz/download
- Rename the data-integration root directory of the downloaded package into the pdi directory




mail server:


A mail server is needed for managing outgoing emails as part of the kaltura platform workflow. Suggested packages: Sendmail, postfix


selinux:


Disabled SELinux (When applicable on server)
Within the /etc/sysconfig/selinux file (if exists on your server) set: SELINUX=disabled
The server should be restarted after this adjustment is made


Required info during installation



  • The full pathname to your Apache apachectl script: For a standard XAMPP configuration the apachectl is usually located at: /opt/lampp/bin/apachectl For a standard LAMP configuration the apachectl may be available at one of the following paths: /usr/bin/apachectl /usr/bin/apache2ctl 
  • The full pathname to your PHP binary file: For a standard XAMPP configuration the php binary is usually located at: /opt/lampp/bin/php For a standard LAMP configuration the php binary is usually available at the following path: /usr/bin/php 
  • The full target directory path for the Kaltura application: example /opt/kaltura 
  • Database information: Datatabase hostname, port, root user, root password 
  • Your primary system administrator email address 
  • A password to set for admin console administrator 
  • The URL to your xymon - system monitoring - service (optional) 
  • The name of the domain name/virtual hostname you will use for your kaltura CE server: e.g. kaltura.myhost.com, myhost.com 
  • Your permission to send system data for improving Kaltura CE (optional) Choose your installation folder. 


Install from SVN:



Keep in mind that all media files will be stored there and you enough space there. In this example Kaltura is located in the /opt Directory. Linux is Centos 64 bit and you install the latest svn from kaltura.


mkdir /opt/kaltura
cd /opt/kaltura
svn checkout http://www.kaltura.org/kalorg/kalturaCE/trunk/
mkdir bin
cd bin
svn checkout http://www.kaltura.org/kalorg/kalturaCEBinaries/branches/linux64/bin/




Running the Kaltura CE installation script:

From the base directory of your extracted kaltura CE package run the "php install.php" command.
- Follow installation instructions and provide the required information. 
- When installation completes, follow the post-installation instructions below

At the end of a successful installation you should be prompted with your login credentials to the Kaltura Administration Console (as provided by you during installation). You will need these login credentials to start working with the Kaltura CE. Assuming your mail server is up and running during installation you will receive these credentials to your mail box as well.




For further installation advice visit the Kaltura install site at http://www.kaltura.org/kaltura-ce-v40-generic-installation-package and read http://www.kaltura.org/kalorg/kalturaCE/tags/KalturaCE_v5.0.0/INSTALLATION.txt




To start using Kaltura, please complete the following steps:
1. Add the following line to your /etc/hosts file:
127.0.0.1 video.yoursite.com  (==> if you are faced with php 500 error on admin console try real ip instead of 127.0.0.1)
2. Add the following line to your Apache configurations file (Usually called httpd.conf or apache2.conf):
Include /opt/kaltura/app/configurations/apache/my_kaltura.conf
3. Restart apache
4. Browse to your Kaltura start page at: http://video.yoursite.com/start


This and that:



To uninstall kaltura,
1.remove entry in the hosts file and httpd.conf file
2.remove the kaltura* tables from your database
3. (Careful with this one!) rm -rf yourkalturainstallfolder


KMC media list corrupted -
This is the script you need to run if Sphinx becomes a pain in your sphinxter and happens to drop your entry list in the KMC: /opt/kaltura/app/scripts/utils/updatePartnerEntries2Sphinx.php


Modify /start/index.php:
the path to the start page is /kaltura/app/start/index.php

Use Wowza media server instead of Red5:

most of the integration is similiar to red5
explanation is here http://blog.kaltura.org/rtmp-vod-and-live-streaming-using-red5-and-kaltura-ce-4

this thing are special:

rtmp address for streaming: rtmp://yourserver/vod
rtmp address for for live broadcast rtmp://yourserver/live

symlink:

ln -s /opt/kaltura/web/content /usr/local/WowzaMediaServer/content and
ln -s /opt/kaltura/web/content /opt/kaltura/web/content/webcam

Tuesday, January 31, 2012

Install memcached on Centos 6.x

Install Memcached package on
Fedora 16/15/14/13/12, CentOS/Red Hat (RHEL) 6.2/6.1/6

yum install memcached

Configure memcached
Most important value to configure is CACHESIZE, which is cache size on Megabytes. On all systems, particularly 32-bit, ensure that you leave enough room for both memcached application in addition to the memory setting. For example, if you have a dedicated memcached host with 4GB of RAM, do not set the memory size above 3500MB. Failure to do this may cause either a crash or severe performance issues. Example Following configuration use 3072 Mb memory for Memcached:

vi /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="3072"
OPTIONS=""

Start Memcached
# Set Memcached to start automatically on boot
chkconfig memcached on
# Start Memcached
/etc/init.d/memcached start
## OR ##
service memcached start

Check that Memcached is Running and Working
echo stats | nc localhost 11211

Open Memcached Port (11211) on Iptables Firewall (If the Memcached will also be used other local servers)
Edit /etc/sysconfig/iptables file:
nano -w /etc/sysconfig/iptables
Add following line before COMMIT:
-A INPUT -m state --state NEW -m tcp -p tcp --dport 11211 -j ACCEPT
Restart Iptables Firewall:
service iptables restart
## OR ##
/etc/init.d/iptables restart
Test remote connection:
echo stats | nc memcache_host_name_or_ip 11211


appendix:

To flush all the data from Memcached using command line:


echo "flush_all" | nc 127.0.0.1 11211

Saturday, January 14, 2012

Howto Install Wowza Media Server on Centos 6.2

Setup Java:
It is suggested to deploy Wowza Media Server 3 under the most recent 64-bit version of either the Java Development Kit (JDK) or Java Runtime Environment (JRE) available on your platform running under a 64-bit OS.  On the Windows platform the Java Runtime Environment does not include the server runtime environment (which is explained in the tuning instructions).  This environment is included with the Java Development Kit.  For this reason when running on Windows, installing the JDK is suggested.

Sign up for a license:
For development use  the free Wowza Media Server 3 Developer Edition license for access to the server and all premium AddOns is free. You can have up to 10 Connections with this license. 
If you need more you have to buy a license.


Wowza Server Install:
wget http://www.wowza.com/uploads/installers/WowzaMediaServer-3.0.3.rpm.bin
sudo chmod +x WowzaMediaServer-3.0.3.rpm.bin
sudo ./WowzaMediaServer-3.0.3.rpm.bin

Do you agree to the above license terms? [yes or no]
yes
...              ########################################### [100%]
   1:WowzaMediaServer       ########################################### [100%]

Install Location:
  /usr/local/WowzaMediaServer
To enter license key:
  cd /usr/local/WowzaMediaServer/bin
  ./startup.sh

To uninstall:
sudo rpm –e WowzaMediaServer-3.0.3

Install the Wowza Examples: 
cd /usr/local/WowzaMediaServer/examples
./installall.sh








Sunday, January 8, 2012

Install and use Drush for Drupal

Drush (DRUpal SHell) is a command-line shell and scripting interface for Drupal designed to make life easier for those of us who spend some of our working hours hacking away at the command prompt.
This instruction should work for Debian, Ubuntu, CentOS:

Install Drush


sudo wget --quiet -O - http://ftp.drupal.org/files/projects/drush-All-Versions-HEAD.tar.gz | tar -zxf - -C /usr/local/share


sudo ln -s /usr/local/share/drush/drush /usr/local/bin/drush


sudo drush



Use Drush
  1. Change into your Web server's root directory (cd /var/www).
  2. Run drush dl drupal-7.0. This downloads Drupal 7.0 from drupal.org and extracts the files into /var/www/drupal-7.0.
  3. Change into the newly created directory (cd /var/www/drupal-7.0) and run thesite-install command:
    drush site-install --db-url=mysql://root:secret@localhost/drupal
    
Answer “y” to the following prompt, and in a few short moments, you'll have a working Drupal install (using the “drupal” database on localhost). To verify, you can browse to http://localhost/drupal-7.0/ and log in using admin/admin as the user name/password, respectively. The site-install command has several additional options; run drush help site-install for full details.

For those of you who work on several Drupal sites across various versions and installations, Drush provides an “alias” mechanism to define the common parameters. To create an alias for this example site here, you can create a file ~/.drush/aliases.drushrc.php containing the following PHP code:
$aliases['example'] = array(
  'root' => '/var/www/example/drupal',
  'uri' => 'example.com',
);


Now you can run drush commands for your example site from any directory usingdrush @example  (for example, drush @example status). To make things even better, aliases can reference remote sites (accessible via SSH) by including the remote-host and remote-user options. See the example.aliases.drushrc.php file from the examples folder in your Drush install directory for full details.




Wednesday, January 4, 2012

Amazon Web Services: Object Expiration to S3 Files

The management of temporary files, logs, media files, etc. at AWS will be easier. Amazon has just added object expiration, which allows developers set up rules for the automated deletion of files stored in S3.
Object Expiration allows the scheduled removal of objects after a defined time period.
Developers can add rules for deleting files with a specific prefix (like logs/ or photos/) and set the expiration period (in days) for objects.
Version-enabled can't have object expiration. For more information, check out the specific S3 developer guide on the AWS Documentation site.