FreeBSD/Linux

You are currently browsing the articles from 哥哥万的博客 matching the category FreeBSD/Linux.

vmware server 1.x 序列号 windows

9ATW4-YR12E-14Q2L-4UH8H 90RMH-YRJ0T-1F6A7-4TK38 9AXY0-YR029-14PA0-4UNVR 98DYM-YH188-14L85-4HN3W 929YJ-YRHAX-1FK07-4KJVR 98XWH-YHJ8W-163A4-4HQTX 90WM4-YHJA8-1D39M-4AH38 90XWH-YHJA8-1462Q-40JJ1 98XWH-YK408-1420Q-4A190 92DMN-YRH8W-16KA1-4T11D 90XPH-YUMAW-1DK8Q-4C6L5 98RPN-YHN2R-14K8H-4U709 9A8WN-YR509-14P21-4V2UM 92EM4-YR42D-14307-4H6KJ [...]

Written by gegewan on 四月 26th, 2010 with no comments.
Read more articles on FreeBSD/Linux.

关闭和启用SeLinux的方法

1.命令方式临时解决一下
setenforce 0    #关闭SeLinux
setenforce 1    启动SeLinux
2.修改配置文件方式长期解决掉
如果要彻底禁用SELinux 需要在/etc/sysconfig/selinux中设置参数SELINUX=disabled
 
有时间要去了解下SeLinux的工作机制,不要每次都把这个东西关闭

Written by gegewan on 四月 10th, 2010 with 1 comment.
Read more articles on FreeBSD/Linux.

linux下为一个网卡绑定多个ip地址

编辑文件/etc/sysconfig/network-scripts/ifcfg-eth0:0,添加以下内容
DEVICE="eth0:0"                       #绑定到第一个设备上 IPADDR="192.168.1.200"           #设置IP地址 NETMASK="255.255.255.0"        #设置子网掩码 ONBOOT="yes"                         #设备在启动时自动生效

Written by gegewan on 四月 10th, 2010 with no comments.
Read more articles on FreeBSD/Linux.

Apache中建立虚拟目录

Alias /cctv11/ "/home/vhost/cctv11/" <Directory "/home/vhost/cctv11">     AllowOverride None     Options None     Order allow,deny     Allow from all </Directory>

Written by gegewan on 九月 17th, 2009 with no comments.
Read more articles on FreeBSD/Linux.

shell 下 ftp自动上传文件的脚本

#!/bin/sh export file=123456 ftp -n<<EOF open yourhost user backup ****** binary cd /home/backup lcd /home/stuff/backup prompt put ${file}.txt [...]

Written by gegewan on 三月 18th, 2009 with no comments.
Read more articles on FreeBSD/Linux.

shell 下sftp 自动上传文件的脚本

#!/bin/sh export HOST=myhost; export USER=backup; export PASS=******; export xxx=filename echo "sftp start"; lftp -u ${USER},${PASS} sftp://${HOST} <<EOF cd /home/backup put /home/stuff/${xxx}.txt [...]

Written by gegewan on 三月 18th, 2009 with no comments.
Read more articles on FreeBSD/Linux.

修改FreeBSD的系统时间

必须有root权限 # date YYMMDDHHMM 比如要修改时间为2007年4月15日7点52 # date 0704150752
  只改时间的话 # date HHMM
使用NTP服务器更新本地时间 # ntpdate time.nist.gov 常用的NTP服务器 time.nist.gov time.windows.com chime.utoronto.ca [...]

Written by gegewan on 二月 22nd, 2009 with no comments.
Read more articles on FreeBSD/Linux.

SSL-enabled Name-based Apache Virtual Hosts with mod_gnutls

This article describes how to implement SSL-enabled name-based vhosts – that is secure virtual hosts which share the same IP address and port – with the SNI-capable mod_gnutls module for Apache’s httpd web server. Server Name Indication (SNI), as described in section 3.1 of the RFC3546, is a [...]

Written by gegewan on 一月 24th, 2009 with no comments.
Read more articles on FreeBSD/Linux.

mod_gnutls – 單一 IP 建置多重 SSL 網站

雖然 Apache 的文件上已明白說明單一IP無法建置多重 SSL 網站,不過這類需求與嘗試永遠存在。
有一陣子熱衷於尋找解法之際,曾看過 Everyday Work 的這篇解法,直接在 Certificate 中塞進多個 CN。最近則看到了國外提到用 mod_gnutls 這個 Apache Module 來實行,而且竟然又是個老早就有的專案。
mod_gnutls 是實做出 RFC3546 中的 Server Name Indication(SNI)解決方案,透過 TLS extension 達成 name-based 的 SSL 虛擬主機設定。mod_gnutls 的開發目的類似於 mod_ssl,但它並不依賴 OpenSSL,一方面是因為 OpenSSL 到目前 0.98 為止仍未支援 SNI,不過據說 0.99 會開始支援。
在下載並編譯後,將 libmod_gnutls.so 複製到 Apahce modules 目錄 (依平台而不同,如 /usr/lib/httpd/modules 或 /usr/local/libexec/apache2 等),並更名為 mod_gnutls.so,再將剛剛來源目錄中的 dhfile、rsafile 複製到 [...]

Written by gegewan on 一月 24th, 2009 with no comments.
Read more articles on FreeBSD/Linux.

Linux下FTP站点同步一句话脚本。应用wget

很简单,如下:
wget -b -m -nH  ftp://user:passwd@192.168.0.1:21 简单解释: -b:应用程序后,自动放入后台,输出日志到当前目录下wget-log文件 -m:mirror,就是镜像的意思 -nH:不产生站点的目录名,我讨厌产生那样的目录。
实现功能:单向同步,B站点为A的完全镜像。既然是同步,就不会重复下载。配合cron使用吧。 简单说一下:在同步的过程中,会在本地端,也就是B端各个层级内产生2个隐藏文件,如果只有目录的话,只产生.listing。如果有文件的话,就会产生2个文件:
.listing   用来检视目录 .tempcrc.jasfv 检视文件,并且产生CRC32的校验码,用于比对。
顺便插一句,发现man帮助真是太长了,不利于快速使用。–help倒是很好用。呵呵。 网上很多朋友,都有在找这个东西。其实只需要wget –help就会找到答案。BS自己一下,我也google了半天。 对了,产生的那个文件自己看一下。挺有意思的。我就不贴了。 追加: 想用crontab调用还是需要做些修改的。比如考虑,执行脚本的路径,和本地存放的路径,日志输出位置,所以就丰富一下命令吧。
wget -b [...]

Written by gegewan on 十月 5th, 2008 with no comments.
Read more articles on FreeBSD/Linux.