[color=blue]修改静态IP[/color]
[color=red]/etc/sysconfig/network-scripts/ifcfg-eth0[/color]
# Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet
DEVICE=eth1
HWADDR=78:2B:CB:2B:48:2D
ONBOOT=yes
HOTPLUG=no
BOOTPROTO=static
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.0.164
GATEWAY=192.168.0.172
PEERDNS=no
[color=blue]多IP[/color]
[color=red]cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1[/color]
[color=blue]设置DNS[/color]
[color=red]vi /etc/resolv.conf[/color]
nameserver 8.8.8.8
[color=blue]升级支持ReiserFS [/color]
1. 查看CentOS 内核升级包
yum --disablerepo updates,base --enablerepo=centosplus list 'kernel*'
2. 安装要升级的kernel包名称
yum --disablerepo updates,base --enablerepo=centosplus install kernel.x86_64
3. 安装reiserfs工具
yum --disablerepo updates,base --enablerepo=centosplus install reiserfs-utils.x86_64
[color=blue]升级系统[/color]
yum -y update
[color=blue]安装常用包[/color]
yum -y install gcc* gcc-c++* autoconf* automake* zlib* libxml* ncurses-devel* libmcrypt* libtool* openssl-devel sysstat net-snmp make
[color=blue]开启系统服务[/color]
chkconfig --level 2345 mysqld3306 on
[color=blue]查看某个端口是否监听[/color]
netstat -tunl | grep 8200
[color=blue]你打包/home这个目录,/home/123/是你不想打包的目录 [/color]
tar cvf my.bak.tar /home --exclude /home/123
[color=blue]强制拷贝文件夹[/color]
cp -rfu /src /dest
[color=red]apache生成密码[/color]
htpasswd -c /conf/awstats_passwd awstats_admin
[color=red]添加path路径[/color]
vi /etc/profile
让/etc/profile文件修改后立即生效 ,可以使用如下命令:
# . /etc/profile
注意: . 和 /etc/profile 有空格.
[color=red]查看目录大小[/color]
du -S | sort -n
[color=red]查看某一进程占用的内存大小[/color]
ps aux|grep videobox-api|grep startup|awk '{print $6}'
[color=red]关闭SELINUX[/color]
/usr/sbin/setenforce 0 立刻关闭 SELINUX
/usr/sbin/setenforce 1 立刻启用 SELINUX
加到系统默认启动里面
echo "/usr/sbin/setenforce 0" >> /etc/rc.local
[color=red]iptables限制同一IP连接数[/color]
iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 10 -j DROP
[color=red]查看端口占用情况[/color]
lsof -i:21
[color=red]用rm提示参数列表过长的解决办法 [/color]
在linux中删除大量文件时,直接用rm会出现:-bash: /bin/rm: 参数列表过长,的错误。
这时可以用find命令来结合使用。
例:
1、rm * -rf 改为:
find . -name "*" | xargs rm -rf '*' 就行了。
2、rm test* -rf 改为:
find . -name "test*" | xargs rm -rf "test*"
[color=red]/etc/sysconfig/network-scripts/ifcfg-eth0[/color]
# Broadcom Corporation NetXtreme II BCM5716 Gigabit Ethernet
DEVICE=eth1
HWADDR=78:2B:CB:2B:48:2D
ONBOOT=yes
HOTPLUG=no
BOOTPROTO=static
TYPE=Ethernet
NETMASK=255.255.255.0
IPADDR=192.168.0.164
GATEWAY=192.168.0.172
PEERDNS=no
[color=blue]多IP[/color]
[color=red]cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1[/color]
[color=blue]设置DNS[/color]
[color=red]vi /etc/resolv.conf[/color]
nameserver 8.8.8.8
[color=blue]升级支持ReiserFS [/color]
1. 查看CentOS 内核升级包
yum --disablerepo updates,base --enablerepo=centosplus list 'kernel*'
2. 安装要升级的kernel包名称
yum --disablerepo updates,base --enablerepo=centosplus install kernel.x86_64
3. 安装reiserfs工具
yum --disablerepo updates,base --enablerepo=centosplus install reiserfs-utils.x86_64
[color=blue]升级系统[/color]
yum -y update
[color=blue]安装常用包[/color]
yum -y install gcc* gcc-c++* autoconf* automake* zlib* libxml* ncurses-devel* libmcrypt* libtool* openssl-devel sysstat net-snmp make
[color=blue]开启系统服务[/color]
chkconfig --level 2345 mysqld3306 on
[color=blue]查看某个端口是否监听[/color]
netstat -tunl | grep 8200
[color=blue]你打包/home这个目录,/home/123/是你不想打包的目录 [/color]
tar cvf my.bak.tar /home --exclude /home/123
[color=blue]强制拷贝文件夹[/color]
cp -rfu /src /dest
[color=red]apache生成密码[/color]
htpasswd -c /conf/awstats_passwd awstats_admin
[color=red]添加path路径[/color]
vi /etc/profile
让/etc/profile文件修改后立即生效 ,可以使用如下命令:
# . /etc/profile
注意: . 和 /etc/profile 有空格.
[color=red]查看目录大小[/color]
du -S | sort -n
[color=red]查看某一进程占用的内存大小[/color]
ps aux|grep videobox-api|grep startup|awk '{print $6}'
[color=red]关闭SELINUX[/color]
/usr/sbin/setenforce 0 立刻关闭 SELINUX
/usr/sbin/setenforce 1 立刻启用 SELINUX
加到系统默认启动里面
echo "/usr/sbin/setenforce 0" >> /etc/rc.local
[color=red]iptables限制同一IP连接数[/color]
iptables -I INPUT -p tcp --dport 80 -m connlimit --connlimit-above 10 -j DROP
[color=red]查看端口占用情况[/color]
lsof -i:21
[color=red]用rm提示参数列表过长的解决办法 [/color]
在linux中删除大量文件时,直接用rm会出现:-bash: /bin/rm: 参数列表过长,的错误。
这时可以用find命令来结合使用。
例:
1、rm * -rf 改为:
find . -name "*" | xargs rm -rf '*' 就行了。
2、rm test* -rf 改为:
find . -name "test*" | xargs rm -rf "test*"