<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></title> 
<link>http://www.bizeway.net/index.php</link> 
<description><![CDATA[网务通 - 网务公司发展之路]]></description> 
<language>zh-cn</language> 
<copyright><![CDATA[BIWEB开源PHP WMS系统创始人ArthurXF肖飞的blog]]></copyright>
<item>
<link>http://www.bizeway.net/read.php?</link>
<title><![CDATA[跟着ArthurXF学FreeBSD3——用ftp.cn.FreeBSD.org更新ports]]></title> 
<author>ArthurXF &lt;arthurxf@gmail.com&gt;</author>
<category><![CDATA[FreeBSD]]></category>
<pubDate>Thu, 18 Jan 2007 10:04:24 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?</guid> 
<description>
<![CDATA[ 
	　　FreeBSD的Packages和Ports是应用程序的安装和配置及反安装的解决方案，基本上类似RedHat的RPM方案，再说的通俗一点就是windows的installer，这个还不知道啊？setup.exe总知道了吧？就是类似安装程序，只是FreeBSD把很多软件安装的接口都做到Ports里面去了，那么我们很多时候就想知道软件是不是有更新啦，我们要用新的软件，那么怎么办？那么我们就要更新Ports了。现在看看我们如何更新Ports的。<br/>　　本文由ArthurXF倾情奉献，谢谢大家支持。<br/>我们发现更新ports是一件痛苦的事情，主要的原因是很多软件都来自国外的服务器，那个下载速度只有几K，更新一次就要好几个小时。我们直接把下载服务器改成国内的服务器不是很好吗？网上虽然有很多教程说如何将MASTER_SITE_FREEBSD_ORG改成ftp.cn.FreeBSD.org，因为FreeBSD版本问题，很多方法都有些牛头不对马嘴了。这里ArthurXF直接奉献精华方法给大家。<br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">最近国内的服务器镜像的文件竟然不全，只有一部分，我找了半天，发现韩国的服务器是全的。<br/>大家可以把下面的ftp.cn.FreeBSD.org替换成ftp.kr.FreeBSD.org即可</div></div><br/><br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">cd /etc/<br/>vi make.conf<br/>加入下面的内容：<br/>MASTER_SITE_FREEBSD_ORG= ftp://ftp.cn.FreeBSD.org/pub/FreeBSD/%SUBDIR%/<br/>MASTER_SITE_GNOME= &nbsp;http://mirrors.geekbone.org/gnome/%SUBDIR%/<br/>MASTER_SITE_LOCAL= &nbsp;ftp://ftp.cn.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/%SUBDIR%/<br/>MASTER_SITE_OVERRIDE=ftp://ftp.cn.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}/</div></div><br/>大功告成，这样更新ports，就直接从中国的服务器下载了。这个速度就别提了，就是一个字，“快”！<br/><br/>1、安装cvsup<br/>如果还没安装过cvsup，那么请执行以下命令安装：<br/>cd /usr/ports/net/cvsup<br/>make install clean<br/><br/>2、然后拷贝ports的配置文件到/etc/ports-supfile<br/>cp /usr/share/examples/cvsup/ports-supfile /etc/ports-supfile<br/>ee /etc/ports-supfile<br/>将其中的# host=CHANGE_THIS.FreeBSD.org一行改为host=cvsup.cn.freebsd.org<br/>cvsup.freebsdchina.org这个是中国的镜像服务器执行速度很快，不会连接过多<br/>其他镜像站可以到<a href="http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS" target="_blank">http://www.freebsd.org/doc/handbook/cvsup.html#CVSUP-MIRRORS</a>查找<br/><br/>3、更新ports<br/> /usr/local/bin/cvsup -g -L 2 /etc/ports-supfile<br/><br/>4、修改/etc/make.conf文件<br/>如果不存在则可以参考，/usr/share/examples/etc/make.conf文件新建一个，该文件主要是编译的时候需要用到。<br/>如果要中文支持，就要加入这一段在make.conf中<br/><br/>下面是我的make.conf文件内容<br/><div class="quote"><div class="quote-title">引用</div><div class="quote-content">SUP_UPDATE= yes<br/>SUP= &nbsp;/usr/local/bin/cvsup<br/>SUPFLAGS= -g -L 2<br/>SUPHOST= cvsup.cn.FreeBSD.org<br/>PORTSUPFILE= /etc/ports-supfile<br/>WITH_CJK= yes</div></div><br/><br/>好了，这样Ports就更新完了。想测试一下吗？赶快去安装一个软件试试吧。<br/><br/>我们以后要用ports方式安装软件，这些软件都是以源码形式安装的， 所以我们这里得做两方面的优化工作，第一是优化编译器，也就是GCC的编译指令，这样可以提高软件的效率，第二就是为ports下载软件加速了。<br/>首先检查GCC的版本是否大于3.0<br/>#gcc --version<br/><br/>接着我们调整一下GCC的编译参数。<br/># ee /etc/make.conf<br/>加入：<br/>CFLAGS= -march=prescott -O2 -pipe -msse2 -mmmx -mfpmath=sse<br/>CXXFLAGS= ${CFLAGS}<br/>其中-march是指你机器的CPU，不知道CPU型号可以用下面的方法来查，我的是Intel志强，结果如下：<br/># sysctl hw.model<br/>hw.model: Genuine Intel(R) CPU 3.20GHz<br/>以下是对照表，按照你的CPU型号改就OK了（参考金步国的《<a href="http://lamp.linux.gov.cn/Linux/optimize_guide.html" target="_blank">GCC编译优化指南</a>》）。<br/>i386 (Intel)<br/>CFLAGS= -march=i386<br/>CXXFLAGS+= -march=i386 <br/><br/>i486 (Intel)<br/>CFLAGS= -march=i486<br/>CXXFLAGS+= -march=i486<br/><br/>Pentium 1 (Intel)<br/>CFLAGS= -march=pentium<br/>CXXFLAGS+= -march=pentium <br/><br/>Pentium MMX (Intel)<br/>CFLAGS= -march=pentium-mmx <br/>CXXFLAGS+= -march=pentium-mmx <br/><br/>Pentium PRO (Intel)<br/>CFLAGS= -march=pentiumpro <br/>CXXFLAGS+= -march=pentiumpro <br/><br/>Pentium II (Intel)<br/>CFLAGS= -march=pentium2 <br/>CXXFLAGS+= -march=pentium2 <br/><br/>Celeron (Mendocino), aka Celeron1 (Intel)<br/>CFLAGS= -march=pentium2 <br/>CXXFLAGS+= -march=pentium2 <br/><br/>Pentium III (Intel)<br/>CFLAGS= -march=pentium3 <br/>CXXFLAGS+= -march=pentium3 <br/><br/>Celeron (Coppermine) aka Celeron2 (Intel)<br/>CFLAGS= -march=pentium3 <br/>CXXFLAGS+= -march=pentium3 <br/><br/>Celeron (Willamette?) (Intel)<br/>CFLAGS= -march=pentium4 <br/>CXXFLAGS+= -march=pentium4 <br/><br/>Pentium 4 (Intel) <br/>CFLAGS= -march=pentium4 <br/>CXXFLAGS+= -march=pentium4 <br/><br/>Intel Core Solo/Duo(Intel) <br/>model name &nbsp; : Genuine Intel(R) CPU TXXXX @ XXXGHz<br/>CFLAGS= -march=prescott<br/>CXXFLAGS+= -march=prescott <br/><br/>Eden C3/Ezra (Via) <br/>CFLAGS= -march=i586 -m3dnow <br/>CXXFLAGS+= -march=i586 -m3dnow <br/><br/>Core i7 and Core i5, Xeon 55xx <br/>32 bit profile (x86) - for <sys-devel/gcc-4.3: <br/>CHOST="i686-pc-linux-gnu"<br/>CFLAGS=-O2 -pipe -march=nocona -msse3 -fomit-frame-pointer<br/>CXXFLAGS=${CFLAGS}<br/><br/>32 bit profile (x86) - for >=sys-devel/gcc-4.3: <br/>CHOST="i686-pc-linux-gnu"<br/>CFLAGS=-O2 -pipe -march=core2 -msse4 -mcx16 -msahf -fomit-frame-pointer<br/>CXXFLAGS=${CFLAGS}<br/><br/>64 bit profile (amd64) - for <sys-devel/gcc-4.3 <br/>CHOST="x86_64-pc-linux-gnu"<br/>CFLAGS=-march=nocona -O2 -msse3 -pipe<br/>CXXFLAGS=${CFLAGS}<br/><br/>64 bit profile (amd64) - for >=sys-devel/gcc-4.3 <br/>CHOST="x86_64-pc-linux-gnu"<br/>CFLAGS=-march=core2 -msse4 -mcx16 -msahf -O2 -pipe<br/>CXXFLAGS=${CFLAGS}<br/><br/>K6 (AMD)<br/>CFLAGS= -march=k6 <br/>CXXFLAGS+= -march=k6 <br/><br/>K6-2 (AMD)<br/>CFLAGS= -march=k6-2 <br/>CXXFLAGS+= -march=k6-2 <br/><br/>K6-3 (AMD)<br/>CFLAGS= -march=k6-3 <br/>CXXFLAGS+= -march=k6-3 <br/><br/>Athlon (AMD)<br/>CFLAGS= -march=athlon <br/>CXXFLAGS+= -march=athlon <br/><br/>Athlon-tbird, aka K7 (AMD)<br/>CFLAGS= -march=athlon-tbird <br/>CXXFLAGS+= -march=athlon-tbird <br/><br/>Athlon-tbird XP (AMD)<br/>CFLAGS= -march=athlon-xp <br/>CXXFLAGS+= -march=athlon-xp <br/><br/>Athlon 4(AMD)<br/>CFLAGS= -march=athlon-4 <br/>CXXFLAGS+= -march=athlon-4 <br/><br/>Athlon XP (AMD)<br/>CFLAGS= -march=athlon-xp <br/>CXXFLAGS+= -march=athlon-xp <br/><br/>Athlon MP (AMD)<br/>CFLAGS= -march=athlon-mp <br/>CXXFLAGS+= -march=athlon-mp <br/><br/>更多类型请查阅<a href="http://en.gentoo-wiki.com/wiki/Safe_Cflags" target="_blank">http://en.gentoo-wiki.com/wiki/Safe_Cflags</a><br/><br/>最后我们的ports使用axel来多线程下载，不知道axel在ports的那个位置，可以用下面指令找找：<br/># cd /usr/ports<br/># make search key=axel<br/>Port: &nbsp; axel-1.0b<br/>Path: &nbsp; /usr/ports/ftp/axel<br/>Info: &nbsp; A download accelerator<br/>Maint: ports@FreeBSD.org<br/>B-deps: gettext-0.14.5_2 gmake-3.81_1 libiconv-1.9.2_2<br/>R-deps: gettext-0.14.5_2 libiconv-1.9.2_2<br/>WWW: &nbsp; &nbsp;http://wilmer.gaast.net/main.php/axel.html<br/>其实还有一个更方便的方法就是whereis<br/># whereis axel<br/>axel: /usr/ports/ftp/axel<br/><br/>直接开始安装<br/># cd /usr/ports/ftp/axel<br/># make install clean<br/>安装完成以后，我们到make.conf进行设置，axel才能工作。<br/># ee /etc/make.conf<br/>加入：<br/>FETCH_CMD=axel<br/>FETCH_BEFORE_ARGS= -n 10 -a<br/>FETCH_AFTER_ARGS=<br/>DISABLE_SIZE=yes<br/><br/>这样编译出来的程序执行效率明显提高，呵呵。ArthurXF倾情奉献！<br/><br/>现在ArthurXF本人正在搞PHP等技术培训，如果想学习的人可以跟我联系。另外培训的招生简章在这个网址，想了解的可以去看看。加我QQ：29011218交流也可。<br/><a href="http://www.bizeway.net/read.php/285.htm" target="_blank">PHP培训招生简章</a><br/>Tags - <a href="tag.php?tag=freebsd" rel="tag">freebsd</a> , <a href="tag.php?tag=ports" rel="tag">ports</a> , <a href="tag.php?tag=cvsup" rel="tag">cvsup</a> , <a href="tag.php?tag=%E6%9B%B4%E6%96%B0ports" rel="tag">更新ports</a>
]]>
</description>
</item><item>
<link>http://www.bizeway.net/read.php?&amp;guid=0#topreply</link>
<title><![CDATA[[评论] 跟着ArthurXF学FreeBSD3——用ftp.cn.FreeBSD.org更新ports]]></title> 
<author> &lt;user@domain.com&gt;</author>
<category><![CDATA[评论]]></category>
<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate> 
<guid>http://www.bizeway.net/read.php?&amp;guid=0#topreply</guid> 
<description>
<![CDATA[ 
	
]]>
</description>
</item>
</channel>
</rss>