原文地址:http://blog.s135.com/post/399/
网址为:http://mirrors.163.com/
提供的镜像有:
1、Linux及BSD发行版镜像:FreeBSD、OpenBSD、RedHat、archlinux、centos、debian、fedora、gentoo、trixbox、ubuntu等。
2、开源软件镜像:eclipse可扩展开发平台、防火墙、openfiler网络存储管理工具。
该镜像目前只有一台杭州电信的服务器,网通用户访问可能会比较慢。
如果您安装 CentOS 系统的服务器位于电信机房,您可以修改/etc/yum.repos.d/CentOS-Base.repo文件,将它的yum源更改成网易的镜像,代替国外的镜像,以便获取更快的下载速度。
您可以按照以下步骤从 blog.s135.com 下载修改后的 CentOS-Base.repo 文件到您的服务器。
cd /etc/yum.repos.d/
mv CentOS-Base.repo CentOS-Base.repo.bak
wget http://blog.s135.com/soft/linux/centos/5.2/CentOS-Base.repo
附:修改后的 CentOS-Base.repo 文件内容如下:
阅读全文…
原文:http://www.ibm.com/developerworks/cn/linux/l-cn-screen/index.html
你是不是经常需要远程登录到Linux服务器?你是不是经常为一些长时间运行的任务头疼?还在用 nohup 吗?那么来看看 screen 吧,它会给你一个惊喜!
你是不是经常需要 SSH 或者 telent 远程登录到 Linux 服务器?你是不是经常为一些长时间运行的任务而头疼,比如系统备份、ftp 传输等等。通常情况下我们都是为每一个这样的任务开一个远程终端窗口,因为他们执行的时间太长了。必须等待它执行完毕,在此期间可不能关掉窗口或者断开连接,否则这个任务就会被杀掉,一切半途而废了。
元凶:SIGHUP 信号
让我们来看看为什么关掉窗口/断开连接会使得正在运行的程序死掉。
在Linux/Unix中,有这样几个概念:
- 进程组(process group):一个或多个进程的集合,每一个进程组有唯一一个进程组ID,即进程组长进程的ID。
- 会话期(session):一个或多个进程组的集合,有唯一一个会话期首进程(session leader)。会话期ID为首进程的ID。
- 会话期可以有一个单独的控制终端(controlling terminal)。与控制终端连接的会话期首进程叫做控制进程(controlling process)。当前与终端交互的进程称为前台进程组。其余进程组称为后台进程组。
阅读全文…
网站找了一些资料,结合自己的操作,把操作总结记录下来。centos 5.2下完成
[root@vi ~]# fdisk /dev/hda
The number of cylinders for this disk is set to 5221.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition’s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
阅读全文…
在郁闷的时间搭了一个VPN。有兴趣的朋友可以上去试下。
IP 222.186.31.123
用户名vi 密码 viyin.net
用XP自动的拨号程序就可以了。
VPN的英文全称是“Virtual Private Network”,翻译过来就是“虚拟专用网络”。顾名思义,虚拟专用网络我们可以把它理解成是虚拟出来的企业内部专线。它可以通过特殊的加密的通讯协议在连接在Internet上的位于不同地方的两个或多个企业内部网之间建立一条专有的通讯线路,就好比是架设了一条专线一样,但是它并不需要真正的去铺设光缆之类的物理线路。这就好比去电信局申请专线,但是不用给铺设线路的费用,也不用购买路由器等硬件设备。VPN技术原是路由器具有的重要技术之一,目前在交换机,防火墙设备或Windows 2000等软件里也都支持VPN功能,一句话,VPN的核心就是在利用公共网络建立虚拟私有网。
虚拟专用网(VPN)被定义为通过一个公用网络(通常是因特网)建立一个临时的、安全的连接,是一条穿过混乱的公用网络的安全、稳定的隧道。虚拟专用网是对企业内部网的扩展。虚拟专用网可以帮助远程用户、公司分支机构、商业伙伴及供应商同公司的内部网建立可信的安全连接,并保证数据的安全传输。虚拟专用网可用于不断增长的移动用户的全球因特网接入,以实现安全连接;可用于实现企业网站之间安全通信的虚拟专用线路,用于经济有效地连接到商业伙伴和用户的安全外联网虚拟专用网。
PPTP 全称为 Point to Point Tunneling Protocol — 点到点隧道协议,是VPN协议中的一种。
安装相关软件
- yum install -y ppp iptables
- wget http://poptop.sourceforge.net/yum/stable/packages/pptpd-1.3.4-1.rhel5.1.i386.rpm
- rpm -ivh pptpd-1.3.4-1.rhel5.1.i386.rpm
配置文件/etc/ppp/options.pptpd
- mv /etc/ppp/options.pptpd /etc/ppp/options.pptpd.bak
- vi /etc/ppp/options.pptpd
输入以下内容:
- #相当于身份验证时的域,一定要和/etc/ppp/chap-secrets中的内容对应
- name pptpd
- #传输加密。ppp-2.4.2以上的版本只支持MPPE加密,内核模块为 ppp_mppe.o
- #拒绝pap,chap身份验证
- refuse-pap
- refuse-chap
- #拒绝mschap身份验证
- <a href="http://www.viyin.net/2009/11/centos-pptpd-vpn.html#more-510" class="more-link">阅读全文...</a>
前一段时间我做备份的时候遇到的问题,要备份整个网站文件,其中有几个目录是NAS挂载的,NAS目录是相当的大~~而且已经在其他机上备份了。
以下是解决办法:
tar –exclude /www/web/viyinnet/vi -zvcf /www/web/backup/web_viyinnet_`date +”%y-%m-%d-%H”`.tar.gz /www/web/viyinnet
红色部份是要排除的目录。
附上用法
-X, –exclude-from=FILE exclude patterns listed in FILE
linux使用Msmtp mutt shell发邮件(备份mysql)
因为数据库有插件自动备份到邮箱,本例示范web数据备份。
需要用到mutt 和 msmtp 这两款软件
1.编译安装软件
- tar jxvf msmtp-1.4.16.tar.bz2
- ./configure --prefix=/usr/local/msmtp &&make &&make install
- tar -xzvf mutt-1.5.11.tar.gz
- ./configure --prefix=/usr/local/mutt &&make &&make install
2.查看msmtp配置文件路径
- [root@vi bin]# ./msmtp --ver
- msmtp version 1.4.16
- TLS/SSL library: OpenSSL
- Authentication library: GNU SASL
- Supported authentication methods:
- plain cram-md5 digest-md5 gssapi external login
- IDN support: enabled
- NLS: enabled, LOCALEDIR is /usr/local/msmtp/share/locale
- System configuration file name: /usr/local/msmtp/etc/msmtprc
- User configuration file name: /root/.msmtprc
-
- Copyright (C) 2008 Martin Lambers and others.
- This is free software. You may redistribute copies of it under the terms of
- the GNU General Public License .
- There is NO WARRANTY, to the extent permitted by law.
阅读全文…