王殊勋的个人博客

只要开始,虽远不迟!

问题: 我每次su -就出现这种界面 bash-4.1#:,而且进入其他目录不显示. 解答: 应该是删了/root 目录下的文件,通过这样修复下应该就可以了,到自己家目录拷贝 .bashrc和 .bash_profile,到 /root目录即可. 1 2 3 4 5 6 bash-4.1$ cd /home/wangshuxun bash-4.1$ cd ./.bashrc /root bash-4.1$ cp ./.bash_profile /root bash-4.1$ su - wangshuxun [wangshuxun@localhost ~]$ su root [roo
阅读全文 »

在Linux中执行.sh脚本,出现错误: 1 /bin/sh^M: bad interpreter: No such file or directory. 分析: 这是不同系统编码格式引起的:在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统下执行会报以上异常信息. 解决: 1)在windows下转换: 利用一些编辑器如UltraEdit或EditPlus等工具先将脚本编码转换,再放到Linux中执行.转换方式如下(UltraEdit):File–>Conversions–>DOS->UNIX即可. 2)也可在Linux中转换: 首先要确保文件有可执
阅读全文 »

编译安装snort出现错误: 1 2 3 ERROR! dnet header not found, go get it from http://code.google.com/p/libdnet/ or use the --with-dnet-* options, if you have it installed in an unusual place 解决办法是去http://code.google.com/p/libdnet/ 下载 libdnet-1.12.tgz. 然后: 1 2 3 4 tar -zxvf libdnet-1.12.tgz cd libdnet-1
阅读全文 »

1 mail -s "Title" root 回车后输入邮件内容,内容输完后,按两次ctrl+D键,就发送了. 或者,事先写好邮件保存在mail.txt中. 1 2 cat mail.txt | mail -s "Title" root mail -s "Title" root < mail.txt 再或者: 1 cat mail.txt | /usr/sbin/sendmail -i root
阅读全文 »

为什么要用nginx呢,apache处理动态页面确实不错,但是它占用资源确实是太大了. 而lighttpd据说存在大并发的时候内存溢出,所以综合考虑nginx是个不错的选择. 编译安装太麻烦,用一键安装包又慢的要死要死的.这里使用的yum安装,很方便. 1、导入外部软件库 centos-5 32位: 1 2 3 rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/epel-release-5-4.noarch.rpm rpm -Uvh http://dl.iuscommunity.org/pub/ius/st
阅读全文 »

编辑nginx的配置文件 nginx.conf 修改下面: 1 2 3 4 5 6 server { listen 80; server_name 173.252.192.205; rewrite ^(.*) http://w91838.s85.chinaccnet.cn permanent; } server段为这个样子就可以了,域名根据自己需要修改.
阅读全文 »

清空iptables规则,设默认为ACCEPT. 我一般写规则之前都会这样做的,哈哈. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #!/bin/sh #accept-all policy IPT='/usr/local/sbin/iptables' $IPT -t nat -F $IPT -t nat -X $IPT -t nat -P PREROUTING ACCEPT $IPT -t nat -P POSTROUTING ACCEPT $IPT -t nat -P OUTPUT ACCEPT $IPT
阅读全文 »
0%