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.