lsscsi
lsscsi - list SCSI devices (or hosts) and their attributes[root@tonykorn97 ~]# lsscsi [0:0:0:0] disk ATA WDC WD1601ABYS-1 06.0 /dev/sda[root@tonykorn97 ~]# lsscsi -H [0] ata_piix [1] ata_piix [root@tonykorn97 ~]# [@more@]
redhat5中修改raw设备的默认用户和权限
在下面这个链接中讲述了在redhat5中怎么管理raw设备http://tonykorn97.itpub.net/post/6414/466424但是默认的用户名和组都是属于root,权限也是系统定义好的。不过在实际的工作中我们需要裸设备的用户和权限会和系统默认的不一样,需要通过如下方式更改:修改/etc/udev/rules.d/50-udev.rules文件,在KERNEL=="raw[0-9]*", NAME="raw/%k" 这行后面加上用户和权限信息,如下所示:[root@tonykorn97 ~]# cat /etc/udev/rules.d/50-udev.rules | grep usernameKERNEL=="raw[0-9]*", N
selinux常用命令
1,查看安全上下文ls -Zps -Z 2,更改安全上下文chcon -t tmp_t /etc/hostschcon -t public_content_rw_t /var/ftp/incoming[@more@]3,恢复系统的默认上下文restorecon /etc/hosts4,查看和设置selinux级别getenforcesetenforce system-config-selinux5,selinux帮助工具安装setroubleshootd用sealert -b打开这个图形工具6,selinux策略管理工具列出文件上下文semanage fcontext -l | grep ftp7,setroubleshoot client tool查看警告idsealert -l 05d2769e-af58-4fc5-ac09-b32cdfb382228,设置SELinux布尔值setsebool -P ftpd_disable_tr
登录ftp服务器的时候显示421 Service not available
登录服务器的时候显示:[root@station10 ~]# ftp server1Connected to server1.example.com.421 Service not available.ftp> bye[root@station10 ~]#用chkconfig查看服务是只有一个ftp启动,然后重新启动vsftpd服务,还是不行,重新安装这个服务还是不行,查看日志也没有找到具体原因。iptables和selinux都查看了,结果还是一样的报错。最后查找到底原因是hosts.deny禁止了这个服务。这种情况比较难找到原因,因为没有日志信息,所以只能看经验了。[@more@]
Hdparm Tuning
这一个软件「hdparm」它可用来调整 IDE 硬盘的参数,以求得到最佳效能。很多人的测试下,证实 hdparm 的确可以增进硬盘的效能,假使 HDD 规格越差,那么增强的效果会越明显!(尤其是 NB’s HDD)[@more@] 经过 hdparm 调整参数后,确实会有「些微」效能增加!所以提出来跟大家分享,有兴趣的朋友不妨试试看。 安装完后,可以简单的对自己的硬盘做一些基本检测: 1:# hdparm -Tt /dev/hda(可对 hda 做效能测试,会得到这颗硬盘的效能测试数据) 2:# hdparm /dev/hda(可察看一下目前 hda 的参数设定状态) 3:# hdparm -i /dev/hda(可察看 hd
用at方式自动重启minilog进程
有一台服务器,日志有问题,不记录日志,并且minilog这个进程随着时间的推移,占用内存会越来越大,必须手工把这个进程杀掉,然后重启syslog服务,经常手工操作也比较麻烦,做一个脚本让15天自动运行一下,操作系统的信息如下:[@more@][root@station10 ~]# uname -aLinux station10 2.6.9-11.ELsmp #1 SMP Fri May 20 18:25:30 EDT 2005 x86_64 x86_64 x86_64 GNU/Linux[root@station10 ~]# cat /etc/issueRed Hat Enterprise Linux AS release 4 (Nahant Update 1)Kernel r on an m[root@station10 ~]# 做的这个脚本的信息如下:[ro
SSD——新一代磁盘革命?(转贴)
作者:piner (转载请注明本文出处:Ixdba.com) 永久链接:http://www.ixdba.com/html/y2008/m10/285-intel-ssd.html 这几天在云南腾冲参加Intel互联网数据中心论坛,各路的互联网英雄汇聚一堂,有百度、QQ、新浪、盛大等不少互联网公司出席。从中还是学到了不少的新东西,数据中心上的话题就先不说了,以后有空我再总结总结。除了数据中心,我最感兴趣的就是Intel生产的SSD硬盘了。[@more@]SSD 硬盘刚在存储上出现的时候,我就感觉到了它巨大无比的潜力,因为机械硬盘经过这么多年的发展,性能基本上是走到了尽头。明显的一点就是,CPU技术
RHEL5上安装邮件系统Postfix+CyrusSASL+dovecot(转帖)
默认方式安装RHEL5,不选中任何类型服务器(如WEB服务器,开发服务器,虚拟服务器等)[@more@]安装postfix[root@rhel5 ~]# /etc/rc.d/init.d/sendmail stop关闭 sm-client: [确定]关闭 sendmail: [确定][root@rhel5 ~]# chkconfig sendmail off[root@rhel5 Server]# rpm -ivh postfix-2.3.3-2.i386.rpm[root@rhel5 Server]# vi /etc/postfix/main.cfmyhostname = mail.mailidc.cn #设置运行postfix服务的邮件主机的主机名、域名mydomain = mailidc.cn myorigin = $mydomain #设置由本机寄出的邮件所使用的域名或主机名称inet_interfaces
Dovecot 配置!
一,Mail Retrieval ProtocolsPost Office Protocol All data,including passwords,is passed in cleartext over TCP port 110 Use POP3s to provide SSL encryption of data over TCP port 995Internet Mail Access Protocol All data,including passwords,is passwd in cleartext over TCP port 143 Use IMAP to provide SSL encryption of data over TCP port 993Dovecot supports POP3,POP3s,IMAP,and IMAPs[@more@]二,Service Profile:Dovecottype:systemV-managed servicepackage:dovecotdaemon:/usr/sbin/dovecotscritp:/etc/
简单了解procmail
一,什么是procmail procmail 是一个强大得惊人的过滤进入邮件的应用程序。 它允许用户定义 “规则”, 并用这些规则来匹配进入的邮件, 进而执行某些特定的功能, 或将这些邮件转发到其他信箱和/或邮件地址。[@more@]二,Procmail, A Mail Delivery Agent (邮件分发代理)Different uses include:1,sorting incoming email into different folders or files2, preprocessing email3, starting an event or program when email is received4, automatically forwarding email to others 启用procmail1,sendmail 默认已经启用。2,postfi
postfix安装和简单配置
一,安装:[root@station10 ~]# yum install -y postfix[@more@]二,postconf工具介绍 Display defaults: postconf -dDisplay current non-default settings: postconf -nModify main.cf:postconf -e key=valueShow supported map types: postconf -m三,Incomming Postfix Configuration修改/etc/postfix/main.cf文件1,监听所有端口:inet_interfaces = all2,specify each name and alias by which the server may be referred (监听主机)mydestination = $myhostname,localhost,mydomain,localhot,$mydomain3,把默认的配置inet_interf
使用 alternatives to Switch MTA
Overview of the alternatives system displays or configures the preferred MTA and associated man pages based on a generic name generic name is a link to a link in /etc/alternatives/ only the links in /etc/alternatives/ are modified[@more@]Switch between MTA's stop the current MTA and disable boot-time startup alternatives --config mta and make a selection start the new MTA and enable boot-time startupGraphical interface: system-switch-mail-gnome package显示当前使用的MTA[root@station10 ~]#
sendmail配置
一,安装:[root@station10 ~]# yum install -y sendmail*[root@station10 ~]# rpm -aq | grep sendmailsendmail-doc-8.13.8-2.el5sendmail-cf-8.13.8-2.el5sendmail-devel-8.13.8-2.el5sendmail-8.13.8-2.el5[root@station10 ~]# [@more@]二,sendmail进入的配置1,修改 /etc/mail/sendmail.mc 文件,让监听所有网卡地址,在前面加上dnl # 即可:[root@station10 mail]# vi sendmail.mcdnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl2,修改 /etc/mail/local-host-names 文件。[root@station10 mail]# cat local-host-name
squid 简单配置
配置squid让同网段内的其他机器可以使用一,安装:[root@station10 ~]# yum -y install squid[@more@]二,启动默认配置:[root@station10 ~]# chkconfig squid on[root@station10 ~]# service squid startStarting squid: .[ OK ][root@station10 ~]#三,默认的配置信息:http_port 3128hierarchy_stoplist cgi-bin ?acl QUERY urlpath_regex cgi-bin ?cache deny QUERYacl apache rep_header Server ^Apachebroken_vary_encoding allow apacheaccess_log /var/log/squid/access.log squidrefresh_pattern ^ftp: 1440 20%
httpd服务器的安装和基本配置
主要了解虚拟目录的使用1,安装[root@station10 /]# yum install httpd*[root@station10 /]# chkconfig httpd on[@more@]2,启动[root@station10 /]# service httpd startStarting httpd: [ OK ][root@station10 /]# 3,校验 DocumentRoot目录:DocumentRoot "/var/www/html"4,测试5,创建目录[root@station10 /]# mkdir -p /var/www/virtual/www10.example.com/html[root@station10 /]# cd /var/www/virtual/www10.example.com/html[root@station10 html]# cat > index.html <<EOF> <b> www10.example.com
修改vnc分辨率大小
vncserver默认的分辨率是1024x768,而我们现在的显示器一般的支持都高于这个,为了更好的现实图像,修改分辨率,只修改当前启动的服务,运行:[@more@][root@test]# vncserver -geometry 1280x1024New 'nyback.rrl.com:1 (root)' desktop is nyback.rrl.com:1Starting applications specified in /root/.vnc/xstartupLog file is /root/.vnc/nyback.rrl.com:1.log[root@test]# 修改默认的分辨率大小需要修改/usr/bin/vncserver文件。一般建议启动vnc服务的时候运行,不要修改默认的分辨率大小,防止修改的分辨率过高在其他机器上不能运行。
用elinks文本浏览器快速测试web服务是否可用
Elinks是Linux命令行下的网络浏览器。它的特点是速度很快,支持frame、表格和鼠标,拥有菜单,在Elinks中网页的显示效果是所有命令行下网络浏览器中最好的。[@more@]如果经常在文本界面下运行,用这个命令测试web服务是否正常是最快速度。1,安装[root@station12 ~]# yum install elinks2,查看man帮助,得到-dump参数的作用。-dump [0|1] (default: 0)Print formatted plain-text versions of given URLs to stdout.3,测试服务是否可用[root@station10 /]# elinks -dump www10.example.comwww10.example.com[root@station10 /]# elinks
samba服务器安装
一,安装软件[root@station10 ~]# yum install -y samba samba-common samba-client system-config-samba查看安装的软件[root@station10 ~]# rpm -aq | grep sambasamba-3.0.25b-0.el5.4system-config-samba-1.2.39-1.el5samba-client-3.0.25b-0.el5.4samba-common-3.0.25b-0.el5.4[root@station10 ~]#[@more@]二,配置samba,方法有如下三种1,system-config-samba 2,samba-swat(http://localhost:901)3, 编辑 smb.conf 文件三,通过第3中方法配置samba1, 建立一个共享的文件夹[root@station10 /]# mkdir /backup[root@station10 /]# chmo
在redhat上安装dell服务器诊断工具
dell的新服务器现在只提供一张dvd光盘了,从光盘启动发现不能直接运行诊断工具了,需要安装到操作系统上。[@more@]1,获取软件[root@test ~]# cd /mnt/SERVICE/pexxxx/diagnostics/r177222/[root@test r177222]# lsdell-onlinediags-linux-2.11.0.109.tar.gz[root@test r177222]# cp dell-onlinediags-linux-2.11.0.109.tar.gz /root/[root@test r177222]# cd /root/[root@test ~]# tar -zxvf dell-onlinediags-linux-2.11.0.109.tar.gz onlinediags/onlinediags/srvadmin-omilcore-5.3.0-497.i386.rpmonlinediags/dell-onlinediags-2.11
dell服务器在redhat5.2上会出现硬盘无辜掉线的情况
一,dell 2970的服务器突然出现系统不能使用,dmesg信息出现:sd 0:2:0:0: rejecting I/O to offline devicesd 0:2:0:0: rejecting I/O to offline devicesd 0:2:0:0: rejecting I/O to offline devicesd 0:2:0:0: rejecting I/O to offline device[@more@]操作系统:[root@test ~]# cat /etc/issueRed Hat Enterprise Linux Server release 5.2 (Tikanga)Kernel r on an m[root@test ~]# 通过系统查看硬盘:[root@test at]# fdisk -lDisk /dev/sdb: 218.0 GB, 218020577280 bytes255 heads, 63 sectors/track, 26506 cylindersUnits = cy