Ruby on Rails and rubygems install on CentOS
Ruby on Rails install on CentOS
Once you have the development tools package installed. You can go ahead and install Ruby on Rails. The main ruby packages and dependencies will be installed using the ‘yum’ package manager, but rubygems will be installed from source. Rubygems is not readily available through the repositories in yum.
Install ruby.
Main Ruby on Rails packages can be installed using the below method.
sudo yum install ruby ruby-devel ruby-irb ruby-rdoc ruby-ri
Once done, we can have a look at the Ruby version.
$ ruby -v
ruby 1.8.8dev (2010-02-11) [i686-linux]
Installing rubygems for Rails installation.
Download from: http://rubyforge.org/projects/rubygems/
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
Now unpack it and move into the newly created folder.
Now we can go through the simple process of compiling it:
Once done, we can check the gem version with a:
NOTE:
http://rubygems.org is now the default source for downloading gems.
* `gem` commands
* `gem install` and `gem fetch` now report alternate platforms when a matching one couldn’t be found.
Interacting with Screen
Screen is a terminal multiplexer that allows you to manage many processes through one physical terminal. Each process gets its own virtual window, and you can bounce between virtual windows interacting with each process. The processes managed by screen continue to run when their window is not active.
Before actually running screen, it’s important to understand how to interact with it. Screen sends all entered text to the current window, with the exception of the command character. The default command character is Ctrl-A (press the Ctrl and the A key at the same time).
With screen, a simple Ctrl-A C will create a new screen window with a new shell process.
An example of this is Ctrl-A C and Ctrl-A Ctrl-C to create a window.
You can delete a window manually with the kill command (default Ctrl-A K). When you exit all of the screen windows, screen exits. You also can tell screen to exit and kill all of your windows by issuing the quit command (Ctrl-A \).
You can re-attach to the session in a few ways. You can give a session name explicitly with screen -r sessionname.
You can detach from your session using Ctrl-A D.
You can enter copy mode with Ctrl-A [
If you are using copy mode for scrollback only, it can be exited at any time with the Esc key.
To copy text, maneuver the cursor to the beginning of the desired text, and press the spacebar to mark it. Then position the cursor over the end of the text you'd like and press the spacebar again to mark it. When you mark the end, the text is copied into screen's internal copy buffer, and copy mode is exited. You can paste the text in your copy buffer into the active window with Ctrl-A ].
CentOS - Development Tools Install
CentOS has some handy meta-packages that include a set of pre-defined programs needed for a single purpose. yum is an interactive, automated update program which can be used for maintaining systems using rpm
So instead of installing a dozen different package names, you can install just one meta-package. One such package is called ‘Development Tools’. Issue the command.
sudo yum groupinstall ‘Development Tools’
Notice the programs that are to be installed include gcc, make, patch and so on. All these are needed for many other programs to install properly. A neat system indeed.
Other Yum Options:
groupinstall group1 [group2] [...]
groupupdate group1 [group2] [...]
grouplist [hidden]
groupremove group1 [group2] [...]
groupinfo group1 [...]
Advantages of PAM
Pluggable Authentication Modules (PAM) is a way of allowing the system administrator to set an authentication policy without having to recompile authentication programs. With PAM, you control how particular authentication modules are plugged into a program by editing that program’s PAM configuration file in /etc/pam.d
When used correctly, PAM provides many advantages for a system administrator, such as the following:
*A common authentication scheme that can be used with a wide variety of applications.
*PAM can be implemented with various applications without having to recompile the applications to specifically support PAM.
*Great flexibility and control over authentication for the administrator and application developer.
*Application developers do not need to develop their program to use a particular authentication scheme. Instead, they can focus purely on the details of their program.
Using sysctl
The sysctl command can make viewing, setting, and automating special kernel settings very easy.
sysctl - configure kernel parameters at runtime, sysctl is used to modify kernel parameters at runtime. The parameters available are those listed under /proc/sys/. Procfs is required for sysctl support in Linux. You can use sysctl to both read and write sysctl data.
To get a quick overview of all settings configurable in the /proc/sys directory, type the sysctl -a command as root. This will create a large, comprehensive list, a small portion of which looks something like this:
root@dell:~# sysctl -a
kernel.sched_min_granularity_ns = 4000000
kernel.sched_latency_ns = 20000000
kernel.sched_wakeup_granularity_ns = 5000000
kernel.sched_shares_ratelimit = 250000
kernel.sched_child_runs_first = 1
kernel.sched_features = 7935
You can manually assign values to writable files by echoing the value to the file.
The sysctl command is able to do the same thing by typing the sysctl -w [file]=”[new-value]“ command. For example, to activate the System Request Key, the following command is required:
root@dell# sysctl -w kernel.sysrq=”1″
kernel.sysrq = 1
To preserve the settings that you like to make permanently to your kernel, add them to the /etc/sysctl.conf file.
Any values added to /etc/sysctl.conf will take effect right after the system boots with no need to reconfigure and rebuild the kernel to incorporate the change.