Skip to content

2015

Memcached on CentOS 6

Memcached is free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load. Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering. In this documentation I will show how to install memcached using yum package manager with Atomicorp repository.


Install the latest Atomicorp repository from http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/

sudo rpm -Uvh atomic-release*rpm

Then install memcached sudo yum install memcached

Reference: http://pkgs.org/centos-6/atomic-x86_64/memcached-1.4.22-4.el6.art.x86_64.rpm.html

MongoDB on CentOS 6

MongoDB is the only database that harnesses the innovations of NoSQL (flexibility, scalability, performance) and builds on the foundation of relational databases (expressive query language, secondary indexes, strong consistency). In this documentation, I will show how to install MongoDB on CentOS 6.


Add MongoDB repository to yum

sudo vi /etc/yum.repos.d/mongodb.repo

[mongodb]
name=MongoDB Repository
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64/
gpgcheck=0
enabled=1

Install MongoDB

sudo yum install mongo-10gen mongo-10gen-server --exclude mongodb-org,mongodb-org-server

Add this to /etc/yum.conf to prevent MongoDB from being upgraded

sudo vi /etc/yum.conf

...
exclude=mongo-10gen,mongo-10gen-server

Start MongoDB service and configure it to start at boot

sudo service mongod start
sudo chkconfig mongod on

Reference: https://docs.mongodb.org/v2.4/tutorial/install-mongodb-on-red-hat-centos-or-fedora-linux/

Open Source Phusion Passenger Module for Nginx on CentOS 6

Phusion Passenger is a web server and application server for your web apps which built upon Ruby or NodeJS. In this documentation I will show how to install open source version of Phusion Passenger on CentOS 6.6 using Ruby gem installation.


Check your Ruby location

which ruby
/usr/local/rvm/rubies/ruby-2.1.5/bin/ruby

In this tutorial I assume your Ruby is installed using RVM Install passenger using gem command

gem install passenger -V

Install passenger module for nginx

rvmsudo passenger-install-nginx-module

Follow the installation steps and you can customize your nginx installation if you want Download init script for nginx and install

wget https://gist.githubusercontent.com/prasetiyohadi/90355ce4b02487261f58/raw/35319a9b63331a9503424c40489d7be27387584d/nginx
mv nginx /etc/init.d/nginx
sudo chmod +x /etc/init.d/nginx

Start nginx service

sudo chkconfig nginx on
sudo service nginx start
sudo service nginx status

Reference: https://www.phusionpassenger.com/documentation/Users%20guide%20Nginx.html#rubygems_generic_install https://www.digitalocean.com/community/tutorials/how-to-deploy-rails-apps-using-passenger-with-nginx-on-centos-6-5

Redis on CentOS 6

Redis is an open source, BSD licensed, advanced key-value cache and store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets, sorted sets, bitmaps and hyperloglogs. In this documentation, I will show how to install Redis on CentOS 6.


Install Development Tools

sudo yum groupinstall "Development Tools"

Download and extract latest Redis package from http://redis.io/ wget http://download.redis.io/releases/redis-2.8.19.tar.gz tar zxf redis-2.8.19.tar.gz Go to redis directory and run make

cd redis-2.8.19
make

it is a good idea to run make test

sudo yum install tcl
make test

Then run make install

sudo make install

Add /usr/local/bin and /usr/local/sbin to your secure_path in /etc/sudoers

Install as service

sudo ./utils/install-server.sh
Welcome to the redis service installer
This script will help you easily set up a running redis server

Please select the redis port for this instance: [6379]
Selecting default: 6379
Please select the redis config file name [/etc/redis/6379.conf]
Selected default - /etc/redis/6379.conf
Please select the redis log file name [/var/log/redis_6379.log]
Selected default - /var/log/redis_6379.log
Please select the data directory for this instance [/var/lib/redis/6379]
Selected default - /var/lib/redis/6379
Please select the redis executable path [/usr/local/bin/redis-server]
Selected config:
Port           : 6379
Config file    : /etc/redis/6379.conf
Log file       : /var/log/redis_6379.log
Data dir       : /var/lib/redis/6379
Executable     : /usr/local/bin/redis-server
Cli Executable : /usr/local/bin/redis-cli
Is this ok? Then press ENTER to go on or Ctrl-C to abort.
Copied /tmp/6379.conf => /etc/init.d/redis_6379
Installing service...
Successfully added to chkconfig!
Successfully added to runlevels 345!
Starting Redis server...
Installation successful!

Test your redis installation

redis-cli
127.0.0.1:6379>INFO

Reference: http://redis.io/download

RVM for Managing Ruby Version on CentOS 6

RVM is a command-line tool which allows you to easily install, manage, and work with multiple ruby environments from interpreters to sets of gems. In this documentation I will show how to install RVM on CentOS 6.6.


Install Development Tools

sudo yum groupinstall "Development Tools"

Install mpapis public key

sudo gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3

or if failed

curl -sSL https://rvm.io/mpapis.asc | sudo gpg2 --import -

Install RVM for multiuser installation

\curl -sSL https://get.rvm.io | sudo bash -s stable

Add your user to rvm group

sudo usermod -aG rvm <user>

Logout and login again then install Ruby

rvm install 2.1
rvm use --default 2.1

You have installed Ruby version 2.1 and set it as your default version of Ruby.

ruby -v
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]

Reference: https://rvm.io/rvm/install

Varnish 4 on CentOS 6

Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You install it in front of any server that speaks HTTP and configure it to cache the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 - 1000x, depending on your architecture. In this documentation, I will show how to install Varnish 4 on CentOS 6.


For first installation install Varnish repository

sudo rpm --nosignature -i https://repo.varnish-cache.org/redhat/varnish-4.0.el6.rpm

Then install Varnish

sudo yum install varnish

Start Varnish service and configure it to start at boot

sudo service varnish start
sudo chkconfig varnish on

Reference: https://www.varnish-cache.org/installation/redhat

Start Your Own Documentation Blog

I am trying to write again after some month was absent from touching any electronic notes (blogs). Actually I wanted to do it from a long time ago but I was afraid don't have any material with qualities to be written. In reality, I realized that I have been encountering events that I must write about. After so long trying to make up my mind and gather my courage, I finally be able to put some ideas into my writing, starting with this re-introduction.

This blog actually planned to be a place where I keep my documentation about thing that I have been thinkering with. But I think I was too strict. Why don't I write anything I want to write here? This is my personal blog after all. So, I think it is wiser to share any good things with folks from internet here. As a system administrator which also want to be a developer, I think having a blog to write about your project or anything you get in touch is essential. It keeps a record about your projects and also can be a source of help for someone working the same projects out there.

Okay, I think this is all from me now. We will catch up again real soon, I hope.