用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
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
locale的设定及其LANG、LC_ALL、LANGUAGE环境变量的区别(转帖)
例如zh_CN.GB2312、zh_CN.GB18030或者zh_CN.UTF-8。很多人都不明白这些古里古怪的表达方式。这个外星表达式规定了什么东西呢?这个问题稍后详述,现在只需要知道,这是locale的表达方式就可以了。 [@more@]locale这个单词中文翻译成地区或者地域,其实这个单词包含的意义要宽泛很多。Locale是根据计算机用户所使用的语言,所在国家或者地区,以及当地的文化传统所定义的一个软件运行时的语言环境。[oracle@game ~]$ localeLANG=en_US.UTF-8LC_CTYPE="en_US.UTF-8"LC_NUMERIC="en_US.UTF-8"LC_TIME="en_US.UTF-
建立dns转发服务器
修改named.conf文件,增加: forwarders { 192.168.0.254; }; forward only; 其中: forwarders { 192.168.0.254; };说明把dns请求转发到192.168.0.254。 forward only; 说明这个服务器只做转发用。 如果设置成forward first说明先把dns请求转发出去然后再查本机的dns记录。[@more@]
建立slave类型的dns服务器
DNS服务器的类型:Master: 提供dns服务,并且本身含有区域文档。Slave: 和Master一起提供dns服务,当Master服务器上的名字地址对更改的时候,会自动更新Slave服务器来达到同步。Cache-only: 没有自己的区域文档,只是帮助客户段向外部dns请求查询,然后将查到的结果保存到他的缓存中。[@more@]1,pre-configuration checkdig -t axfr example.com @192.168.0.254host -l example.com 192.168.0.2542,安装包yum install -y bind bind-utils bind-chroot caching-nameserver3,编辑named.conf zone "example.com"
如何不安装但是获取rpm包中的文件
使用工具rpm2cpio和cpio rpm2cpio xxx.rpm | cpio -vid rpm2cpio xxx.rpm | cpio -idmv rpm2cpio xxx.rpm | cpio --extract --make-directories 参数i和extract相同,表示提取文件。v表示指示执行进程 d和make-directory相同,表示根据包中文件原来的路径建立目录 m表示保持文件的更新时间[@more@]
lvm中怎么增大根分区的步骤:
1,查看磁盘分区,其中/dev/sda5是没有用的磁盘空间[root@server1 /]# fdisk -lDisk /dev/sda: 16.1 GB, 16106127360 bytes255 heads, 63 sectors/track, 1958 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 1 13 104391 83 Linux/dev/sda2 14 1318 10482412+ 8e Linux LVM/dev/sda3 1319 1383 522112+ 82 Linux swap / Solaris/dev/sda4 1384
/etc/fstab文件中系统启动不能自动加载usb设备的分区
一台2850的服务器加一个rd1000的设备,这个rd1000的设备在启动后也可以认成/dev/sdb设备,分一个区为/dev/sdb1,需要在系统启动的时候加载到根目录的一个文件夹下面。[@more@]分好区后,然后用e2label 给/dev/sdb1新加一个标签/backupe2label /dev/sdb1 /backup然后在/etc/fstab文件中新增一行:LABEL=/backup /backup ext3 defaults 1 1然后重启服务器,启动的时候报找不到这个分区。取消这一行重新启动系统,启动后发现usb的驱动应该是后发现的,不存在先认到usb设备的问题。最后估计可能的原因是
将三张Red Hat 9.0 CD iso合成一张DVD iso的方法(转贴)
1. 首先您必須要有一个很大的磁盘空间大概要3.5g是空闲的建立一个文档夹Createiso,然后把您的3个iso文档shrike-i386-disk1.iso,shrike-i386- disk2.iso,shrike-i386-disk3.iso放到Createiso中[@more@]2. 输入以下命令 mkdir shrike-i386-disc{1,2,3} shrike-docs 这是建立 shrike-i386-disc{1,2,3} 和 shrike-docs 这4个目录3.将刚才放入Createiso中的3个iso映像文档挂载到建立好的shrike-i386-disc{1,2,3} 这3个目录mount -o ro,loop shrike-i386-disc1.iso shrike-i386-disc1mount -o ro,loop shrike-i386-disc2.iso shrike-i386-