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.
Directories in /proc
Every /proc directory contains quite a few directories named with a number. A listing of them starts off like this
These directories are called process directories, as they refer to a process’s ID and contain information specific to that process. The owner and group of each process directory is set to the user running the process. When the process is terminated, its /proc process directory vanishes. However, while the process is running, a great deal of information specific to that process is contained in the process directory’s various files.
# ls -l /proc
total 0
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 1
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 10
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 1066
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 11
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 12
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 13
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 14
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 15
dr-xr-xr-x 7 root root 0 2010-07-02 21:37 16
Common groups of information concerning the kernel is grouped into directories and sub-directories within /proc.
Each of the process directories contains the following files:
cmdline — Contains the command line arguments that started the process.
cwd — A link to the current working directory for the process.
cpu — Provides specific information about the utilization of each of the system’s CPUs.
environ — Gives a list of the environment variables for the process.
exe — A link to the executable of this process.
fd — A directory containing all of the file descriptors for a particular process.
maps — Contains memory maps to the various executables and library files associated with this process.
mem — The memory held by the process.
root — A link to the root directory of the process.
stat — A status of the process.
statm — A status of the memory in use by the process.
status — Provides the status of the process in a form that is much more readable than stat or statm.
Apache configuration on Ubuntu
Apache Default Timeout
Timeout: The number of seconds before receives and sends time out.
This sets (in simple terms) the maximum time, in seconds, to wait for a request, action it and the response to the request.
The default is deliberately set high to allow for varied situations. You can reduce this to something more sane, to 30 seconds or even lower. A decrease may also help in reducing the effects of a DOS attack.
KeepAlive: Whether or not to allow persistent connections (more than one request per connection).
You should generally have KeepAlive “On” as it allows for persistent connections to a client so each file, image, etc. that gets requested. Without keepalives, the apache server and web client will need to establish new connections for every element needed to display a web page. Keeping a single connection going that the client can reuse allows your server to manage clients more efficiently.
MaxKeepAliveRequests
MaxKeepAliveRequests: The maximum number of requests to allow during a persistent connection. Set to 0 to allow an unlimited amount. We recommend you leave this number high, for maximum performance.
Since we have our persistent connection, set the maximum number of requests per connection. Keep this high for maximum performance. You might want to experiment with this setting a bit, but if you have a site with lots of images, javascript, etc, try increasing MaxKeepAliveRequests to as much as 500.