远程登录Linux(05)
文本方式远程: putty SecureCRT winSCP SshClient
图形方式远程:Xmanager Xmingifconfig
ps -ef | grep sshdf -Henv关机重启(09)
poweroffshutdown -h nowshutdown -h 10shutdown -h 20:25shutdown -r now
reboot文件目录命令
目录浏览: cd dir ls ll pwd文件浏览: cat (> >>) more less head tail目录操作: mkdir rmdir文件操作: touch rm cp mv ln tar gzip gunzip stat echofind grep who/w whereis whatis
find /tmp/ -name a.txtrpm -qa|grep httpdwho |grep tty1stat dm.txtdmesg 软件包安装(12) rpm -qa | grep httpdrpm -q httpdrpm -ql httpdrpm -ivh httpd.rpm
rpm -Uvh httpd.rpmrpm -Fvh httpd.rpmrpm -e httpdmount /dv/cdrom /mnt
打包(13)
tar -cvf test.tar *tar -zcvf test.tar.gz *tar -tf test.tartar -xvf test.tar
tar -zxvf test.tar.gzgzip gunzip
系统信息类命令(13)
date cal clockdmesg df du free w last
df -H
du /tmpecho $SHELL
history 用户与组管理(14)/etc/passwd/etc/shadow/etc/group useradd userdel passwd usermodgroupadd groupdel groupmodiduseradd -g stuff -G root stuff
userdel -r stuffid stuff文件系统(15)
u(user) g(group) o(other) a(all)SUID GUID SBIT- d l s p c bx(1) w(2) r(4) chmod chown umask文本编辑器VI(18)
H M L G ^ $dd yy p
: r filenae/ n N:s/old/new
:%s/old/new/g :%s/old/new/gc :set nu网络基础(19)
/etc/sysconfig/network-scripts/ifcfg-eth0/etc/sysconfig/network/etc/host.conf/etc/hosts/etc/resolv.conf/etc/servicesDEVICE=eth0
ONBOOT=yesBOOTPROTO=staticIPADDR=192.168.1.10NETMASK=255.255.255.0GATEWAY=192.168.1.1NETWORK=192.168.1.0BROADCAST=192.168.1.255NETWORKING=yes
HOSTNAME=linux.jnrp.cnGATEWAY=192.168.1.1127.0.0.1 localhost.localdomain localhost
192.168.1.10 centos nameserver 192.168.1.1nameserver 61.134.1.4search jnrp.cndomain jnrp.cn/etc/rc.d/rc.local
ifconfig ifup ifdown hostname route netconfig
ping traceroute netstat curl wget route -nroute add -net netaddr netmask gw ipaddr devroute add default gw ipaddrroute del -net netaddr netmask gw ipaddr devnetstat -antcurl --head www.163.com 进程管理(20)ps topkill killall nice renice nohupfg bg jobs setup ntsysv chkconfigps -aux
ps -efls -R / >list &kill -9 927killall xinetdCTRL + C
CTRL + Zchkconfig --list
邮件服务器(22)EXTMail LAMP综合(24)Apache /etc/httpd/conf/httpd.confPHP /etc/php.iniMySQL /etc/my.cnfhtpasswd -c /etc/httpd/conf/httppwd testUser
htpasswd /etc/httpd/conf/httppwd testUser基于用户/用户组的认证
基于虚拟主机(IP/端口)的网站MySQL主从服务器(29)
主: vi /etc/my.cnfserver-id=1
log-binbinglog-do-db=备份库名binglog-ignore-db=不备份库名从:
vi /etc/my.cnfserver-id=2master-host=192.168.1.9(主IP)master-user=admin(账号)master-password=7758521(密码)master-port=3306(端口)replicate-do-db=booboo(库名)mysql> show slave status\G
Slave startSlave stopReset slaveShow slave statusShow master statusWEB同步(29)
vi /etc/rsyncd.confuid=root
gid=rootuse chroot = nomax connections =20pid file=/var/run/rsyncd.pidlock file=/var/run/rsync.locklog file=/var/log/rsyncd.log[web]
path=/var/www/html/bbs/ignore errorsread only=yeshosts allow=192.168.1.0./24hosts deny=0.0.0.0/32 /usr/bin/rsync --daemon #!/bin/shwhile truedo /usr/bin/rsync -av 192.168.1.3::web /bbs/ >/dev/null 2>&1 sleep 20donersync -vzrtopg 192.168.1.3::web /bbs/
/usr/bin/nohup /bin/sh /usr/local/webserver/tb.sh 2>&1 > /dev/null &