Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >System Management


    

Blue Forest http://www.lslnet.com at 3:18 p.m. on August 18, 2006


Linux configuration and optimization of the "switch"

Source : Author : Zhang Wensheng article http://www.swm.com.cn/

Linux as a free operating system similar to UNIX are gaining in importance. As a Linux lovers out of the study, compared the issue of supporting a variety of Linux software, the installation of various Linux software supporting the issue, but each time they complete the installation, configuration and optimization of a large number of writers spent a lot of time and was very easy to miss some of the details. RedHat 6.1 to install and use this as an example, the reference to the /usr/doc/HOWTO/Config-HOWTO files, in conjunction with our own experience of working on some of their own practices. Following the issuance liunx basically a suitable supporting software.

First, on the Hard Disk
An 装Linux on how to set up disk, the exchange of regional problems and has gone beyond the scope of this paper, but my experience is that when security 装Linux must establish a separate area for the storage of user's private data and can be used for backup system configuration files (like the domain name server, Samba configuration files, etc.) facilitate later deployment.

Second, document editing /etc/inittab
Most Linux software supporting the issuance of the six founding Virtual Console, in fact three have adequate and can save valuable memory space. Editor /etc/inittab documents in the front three rows below with #.
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6
Q init before implementation, the system re-read /etc/inittab paper closed tty4, tty5, tty6 Virtual Console. If no consideration is the safety of the system, you can use Virtual Console fourth to check information systems, document editors /etc/syslog.conf, joined in the last line :
/dev/tty4 Indicators shown as *.*
Finally, the implementation of killall -HUP Syslog.

Third, the creation or editing /etc/inputrc, /etc/profile, /etc/bashrc documents
Although the trend of recent years, personal computers have command line mode to graphics mode, using the mouse to operate, but Shell still has a strong vitality in Linux. Shell has several main bash, ksh, tcsh, zsh, ash, and most of the bash. As long as document editing /etc/inputrc install INPUTRC environment variables, using full-function Tab键 fill orders, we can achieve similar to the MSDOS DOSKEY function. Contents of this document and the various operational, the same ease and rapidity. (Report /etc/inputrc)
__________________________________________________________________
Not specified set bell-style none # 't beep
# Allow adder input on set meta-flag
Convert-meta not specified set off # 't strip characters lookahead
# Output-meta on display characters correctly set lookahead
On # scroll long command lines set horizontal-scroll-mode
Set show-all-if-ambiguous On # after TAB is pressed

"\e[1~" Beginning-of-line # home :
"\e[2~" Insert-last-argument # insert :
"\e[3~" Delete-char # delete :
"\e[4~" : # End end-of-line
"\e[5~" Backward-kill-word # page up :
"\e[6~" Kill-word # page down :

# Define F7 F8 like msdos doskey
"\e[18~" History-search-forward # F7 :
"\e[19~" History-search-backward # F8 :
__________________________________________________________________

Editor /etc/profile paper insert in its tail :
_________________________________________________
# Add by zws
# Customize less
#LESS= '-MQr'
PS1= "[\u@\h \w]\\$"
INPUTRC=/etc/inputrc
LESS= '-Mr' # 1s | r less support for color.
LESSEDIT= "%E ?lt+%lt. %f "
LESSOPEN= "| lesspipe.sh %s"
LESSCHARSET=latin1
PAGER=less
Export LESS LESSEDIT LESSOPEN LESSCHARSET INPUTRC
_________________________________________________

/usr/bin/lesspipe.sh Founding document, which reads as follows :
__________________________________________________________________________
#!/bin/sh
# This is a preprocessor for 'less'. It is used when this environment
# Variable is set : LESSOPEN= "|lesspipe.sh %s"
Lesspipe () (
Case "$ 1" in
*.tar.bz2) Bzip2 cd $ $ 2>;/dev/null | tar tvvf - are;
*.tar) $ 2>;/dev/null quake; to # tar contents of View. Tar and. Tgz files
*.tgz|*.tar.gz|*.tar.Z|*.tar.z) Tar ztf $ 2>;/dev/null are;
*.Z|*.z|*.gz) Gzip-dc $ 1; to # View compressed files correctly 2>;/dev/null
*.zip) Unzip archives View # l $ 2>;/dev/null are;
*.arj) Unarj l; to $ 2>;/dev/null
*.rpm) Rpm -qpil $ 2>;/dev/null are;
*.cpio) Cpio --list F; to $ 2>;/dev/null
*.bz2) Bzip2-dc $ 1; to # View compressed files correctly 2>;/dev/null
*.1|*.2|*.3|*.4|*.5|*.6|*.7|*.8|*.9|*.n|*.l|*.man) FILE=`file L $ 1`
FILE=`echo $FILE | cut-d '' - f 2`
If [ "$FILE" = "troff"] then
Groff - p-s-t-e -Tascii -mandoc $ 1
Fi are;
*) Text file $ 1 | grep "; /dev/null;
If $? = [1]; # then it 's not some kind of text
Strings $ 1
Fi are;
Esac
}
Lesspipe $ 1
POPs can be used to do more than document format information and less access content.
Chmod 755 /usr/bin/lesspipe.sh attention to the use of enforceable order to set up this document!
/etc/bashrc Document examples :
____________________________________________
# /etc/bashrc

# System wide functions and aliases
# Environment stuff goes in /etc/profile

# For some unknown reason bash refuses to inherit
# PS1 in some circumstances that I can 't figure out.
# Putting PS1 here ensures that it gets loaded every time.
# PS1= "[\u@\h \w]\\$"

Eval `dircolors -b`
Ls= alias' 1s --color=yes F N '# 1s color support
Alias l = 'N 1s --color=yes l F' # 1
Cp= alias' cp -i '
Mv= alias' mv -i '
Rm= alias' rm -i '
Alias = 'df-h'
Ln= alias' ln -i '
Lrpm () # list information on an. Rpm file
{
> [0] then if $# rpm -qilf `which $ 1` fi | less;
}
Lsrpm () # list information on an. Rpm file
{
> [0] then if $# rpm -qif `which $ 1` fi | less;
}
Set noclobber # -o avoid coverage and rewriting papers
____________________________________________

Fourth, edit documents /etc/rc.local
If customize their login information, to amend /etc/rc.d/rc.local documents, because each time /etc/rc.d/rc.local documents, and have to be revised /etc/issue /etc/issue.net document annotation can swap these orders Editor /etc/issue own customized document to guide the process to accelerate Linux, and add the following :
Echo "base=0xd8000000 size=0x800000 type=write-combining" ";>; /proc/mtrr
# Enable NumLock
Do for tty in /dev/tty[1-3];
Setleds D +num "$tty
Done
Note : On the first trip orders look /usr/src/linux/Documentation/mtrr.txt documents.

5 vim thalamotomy customized environment
In the Linux environment, there are many editorial mainly emacs, and vim thalamotomy, Joe, for not using Unix or Linux, my suggestion is the best way to get several of the reference books to understand the use of these Editor, Linux installed, Some editors and look at the distribution of the paper, not a state of perplexity. Vi particular, a very difficult start, the best start to be a master's instructions, once handcuffed, it is like driving a Mercedes to the high-speed racing, beginners can ftp://ftp.cs.pdx.edu/pub/elvis or http : //www.vim.org download the corresponding version, which provides support for MSDOS, Windows 98 and other operating systems versions decompression after learning in their own environment and the use vi.
Following is /usr/share/vim/vimrc examples :
___________________________________________________________
"" (For Chinese)
"Set file encoding format as' prc 'for Simplified Chinese
"Valid values for the 'set fe=' is 安, japan, korea, prc, taiwan
"We set fe to prc for default, if you need single-byte editing.
"Just type ': set fe=ansi' will do the work.

Set fe=prc

"" (For Chinese)
"" Set ruler on, you must set this to ensure
"" Functionality of the Chinese gvim
Set ru

"" For syntax color
If &term== "xterm"
Set term=rxvt
Set t_Co=8
Set t_Sb=^[4%dm
Set t_Sf=^[3%dm
Endif
Syntax on

"" Set visual bell and disable screen flash
"Vb t_vb= set :

Set bs=2

"" Toggle on/off highlightsearch
Map "set hls!<bar>;set hls?<cr>; F8>; :

"" Toggle mode on/off Property
Map "set paste!<bar>;set paste?<cr>; F9>; :

"" You can toggle this command with the syntax on/off
If has ( "syntax_items") | syntax off syntax on | | | else endif
Map "has F7>; : if (" syntax_items ")" Bar>; syntax off "Bar>; else" Bar>; syntax on the "Bar>; endif" CR>;

"" Set non-compatible with vi
Set nocompatible

"" Set back-extension
"Set back -
"Set backupext=.bak

"Add by zws
Set autoindent
Set ignorecase
Set shiftwidth=4
Set showmode
Set tabstop=4
Set nowrap
"If &t_Co"; 1
"Syntax on
"Endif
"" Map for parenthesis matched
Map \%
"" English word search
Map "F3>;" Esc>;:set keywordprg=/usr/local/bin/cdict<Esc>;K<Esc>;:set keyword=man<CR>;
Map "F6>;" Esc>;:set keywordprg=man<Esc>;K
"Backspace
Map "BS>; X
___________________________________________________________

6, editing documents /etc/mtools.conf
Under normal circumstances, in their machines with Windows 98 installed two Linux operating system, through the installation of mtools package, it is not necessary to install the corresponding documentation system, allowing MSDOS, Windows 98 and Linux file system between the files of reading, writing, movement, display operation. Assuming Windows 98 installed on /dev/hda1, /dev/hda5 district, amending /etc/mstools.conf document include the following :
File= drive c : "/dev/hda1"
D : drive file= "/dev/hda5"
This can be implemented, such as c : mdir orders.

7, the distribution of copies of various documents
According to the use of machinery, corresponding copy editing configuration files, such as : samba configuration files /etc/smb.conf, domain name server configuration files, DHCP configuration files /etc/dhcpd.conf other documents, under normal circumstances, if the distribution of these documents, rarely changes. This can save a lot of time, the configuration file must pay attention to the original backup, changes that have taken place in the configuration file backup!

8 compiler Linux kernel
General various Linux kernel supporting software installed, the machines are suitable for the majority, but the drawback is that large, they did not have many modules include modules. Only on the basis of their demands and machine hardware configuration to achieve optimal allocation of kernel configuration. Attention to the compiler core, we must have a comprehensive understanding of their machines, so be aware.

Following is a brief translation core steps : (redhat6.1 illustrate)
1. Enter /usr/src/linux editor Makefile文件 revised EXTRAVERSION= -xx, xx said an edited version of its best figures, and more than the original values.
2. According to their machines hardware configuration, kernel configuration options corresponding to the option.
#make Menuconfig
3. Interdependence among all the documents, the goal of cleaning up the previously generated documents and other documents.
#make Clean; make dep
4. Kernel and compiler installation, and installation of modules.
#make BzImage
#make Modules; make modules_install
5. Installation kernel.
# Cp arch/i386/boot/bzImage /boot/vmlinuz-yyyy-xx
/boot Catalog system to be core complex, said Linux Version to run yyyy No. xx expressed its translated version.
# Cp System.map /boot/System.map-yyyy-xx
# Cd /boot
# Ln-s System.map-yyyy-xx System.map
6. Editor lilo configuration files /etc/lilo.conf (abbreviated).
The desirability of maintaining the original kernel, so if the new Linux kernel guide unsuccessful, we can use the old guide Linux kernel.
7. Testing new kernel.
Guide is completed, attention inspection /lib/modules/yyyy-xx catalog, creating modules.dep documents. If the documents exist, can be amended /etc/rc.d/rc.sysinit, the module swap notes on the contents of the order, the startup process can be speeded up Linux.



==============
LINUX more technical article, the Guide downloaded to do so in www.linuxdiyf.com[/u]

Linux configuration and optimization of the "switch"

-->
Please mark posted Source!
Do not make the writing itself seems to be!
Here are just a few days ago to do so, we were too BS

Linux configuration and optimization of the "switch"

Was written by Zhang Wensheng, sorry



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com