1.安装wget #cd /usr/ports/ftp/wget/ #make install clean 2.修改/etc/make.conf FETCH_CMD=wget -c -t 1 DISABLE_SIZE=yes #这行是必要的,否则… 如果你要wget穿透代理服务器,请加上下面两行 FETCH_ENV=http_proxy=http://proxy2.zsu.edu.cn:3128 FETCH_ENV=ftp_proxy=http://proxy2.zsu.edu.cn:3128 或者使用其他的穿越代理工具例如proxychains 或者socks5(runsocks) 则FETCH_CMD=proxychains wget或者runsocks wget
Browsing the archives for the ports tag
我们经常使用ports来安装程序,ports中的make命令还可以有很多的功能:
引用
fetch – Retrieves ${DISTFILES} (and ${PATCHFILES} if defined) into ${DISTDIR} as necessary.
fetch-list – Show list of files that would be retrieved by fetch.
fetch-recursive – Retrieves ${DISTFILES} (and ${PATCHFILES} if defined), for port and dependencies into ${DISTDIR} as necessary.
1、安装PostgreSQL8.3
用PREFIX指定安装路径/home/developer/opt/postgresql
#cd /usr/ports/databases/postgresql83-server
#make install clean PREFIX=/home/developer/opt/postgresql
2、安装apache2.2
#cd /usr/ports/www/apache22
#make install clean PREFIX=/home/developer/opt/apache
针对自己需要选择,如果需要支持pgsql,需要选中pgsql这项。可以使用make config命令重新选择。
3、安装php5
#cd /usr/ports/lang/php5
#make install clean PREFIX=/home/developer/opt/php
针对自己需要选择,一般选择apache,suhosin,multibyte这三项即可。可以使用make config命令重新选择。
感觉FreeBSD 6.0最方便的改进就是增加了portsnap这个很方便的升级port tree软件,以前用恼人的portupgrade做port tree升级的时候总是感觉有点缺陷,方便性不够,而且做成crontab总是担心。现在FreeBSD 6.0下有了portsnap这个方便的工具,升级port tree就十分方便。
以下就是portsnap的几种简单用法:
第一次使用可以:portsnap fetch extract
以后使用只要:portsnap fetch update
放在cron里运行:portsnap cron
方法A: 使用代理。
在/etc/make.conf中设置:
FETCH_ENV= “HTTP_PROXY=IP[:端口]”
如果需要,在FETCH_ENV值后面加入空格,
HTTP_PROXY_AUTH=basic:*:user:password
方法B: 在其它机器上fetch
make fetch-recursive
…
然后将/usr/ports/distfiles拿走。
方法c:使用wget/axel加速你的port下载
portupgrade 是一个软件,用于快捷便利地升级软件
cd /usr/ports/sysutils/portupgrade
make install clean
安装上它
在FreeBSD中,使用ports方式安装apache时,可以使用以下命令指定apache的安装路径 #make PREFIX=/usr/local/apache install
Xinsoft-BSD# cp /usr/share/examples/cvsup/ports-supfile /root
Xinsoft-BSD# vi /etc/make.conf
# added by root [Xinoft] 2006-02-05 03:52:11
# for cvsup
# Block_CVSUP :: begin
SUP_UPDATE= yes
SUP= /usr/local/bin/cvsup