国内速度较快的centos yum(更新源)


最开始用的是中国科技大学的服务器,主服务器在合肥,虽然是教育网,但是速度依然也很快。

后来陆续找到一些新的源,经测试,速度都较快,整理了下。

1:http://centos.ustc.edu.cn
中国科技大学,服务器位于合肥。
南方用户推荐。CenOS版本非常丰富,适合长期使用。
CenOS-Base.repo:http://centos.ustc.edu.cn/CentOS-Base.repo

2:http://mirrors.sohu.com/
sohu的开源镜像服务器,速度飞快,全国用户推荐,几乎支持目前所有的开源项目,可以看到该镜像服务器为FreeBSD、archlinux、fedora、CentOS、ubuntu、debian、gentoo、slackware主流开源系统,以及cygwin、mysql、php、nginx等主流的开源程序提供更新。
这个镜像服务器更新还比较及时的,频率为每两天更新一次。

3:http://mirrors.163.com/centos
网易的开源服务器镜像,速度也很快,全国用户推荐。

Ubuntu下快速搭建LAMP环境

安装 Apache2:
sudo apt-get install apache2
安装PHP模块:
sudo apt-get install php5
安装Mysql
sudo apt-get install mysql-server

其他模块安装:
sudo apt-get install libapache2-mod-php5
sudo apt-get install libapache2-mod-auth-mysql
sudo apt-get install php5-mysql
sudo apt-get install php5-gd
前两个很容易明白,要想apache能够解析PHP,就需要借助这两个模块来找到php engine。
第三个在php操作mysql数据库时用到,大多数人都有数据库编程经验,所以这就不用多解释了。
第四个GD库。

apache2相关配置

安装完上述的各个模块后,实际上基本配都OK了,只是一些小的细节问题

基本上多有的配置都在/etc/apache2目录及其子目录下完成,故一定要搞清楚这个目录结构。

1.apache根目录
安装完apache2,根目录在/var/www下,可以通过http://localhost/测试一下是否好用。
当然也可以在该目录下新建一个文件test.html来试一试http://localhost/test.html

2.PHP解析问题
安装完貌似php的解析都有点问题,浏览php网页会保存,apache没有将其解析为网页。
网上一般说的是需要在httpd.conf中添加XXXX,对其他的linux系统可能确实如此,但是ubuntu有点特殊。

ubuntu的apache2配置在/etc/apache2目录下。
这个目录下有个apache2.conf文件,这个文件通过包含其他配置文件涵盖了所有的apache2系统配置信息。

php解析部分在的配置在/etc/apache2/mods-available下的php5.conf和php5.load中,apache2.conf文件中并没有将这两个文件包含进来,只要包含进去就OK了。
*************************************************
在apache2.conf中找到
    # Include module configuration:
    Include /etc/apache2/mods-enabled/*.load
    Include /etc/apache2/mods-enabled/*.conf
在其后面添加
    Include /etc/apache2/mods-available/php5.load
    Include /etc/apache2/mods-available/php5.conf
*************************************************
另外一种方法就是将这两个文件链接到mods-enabled目录下:
    sudo ln -s /etc/apache2/mods-available/php5.load /etc/apache2/mods-enabled/php5.load
    sudo ln -s /etc/apache2/mods-available/php5.conf /etc/apache2/mods-enabled/php5.conf
这一种方式更好一点,没有破坏apache2本身的配置结构。
*************************************************

3.改变apache2的默认目录到当前的开发目录

apache2的默认目录配置在/etc/apache2/sites-enabled/00default文件中。
找到该文件中的DocumentRoot项, 将/var/www改为你的开发目录就OK了。

当然,还有一种方法就是不该边默认目录,只是在var/www下建立一个到你的目录的链接。
比如你的目录在/home/username/phptest,那么你只要
sudo ln -s /home/username/phptest /var/www/phptest
这样你就可以通过http://localhost/phptest访问你的工作目录了。
[注意]链接文件名中不能含有“.”,否则apache2会将其当作为一个文件试图解析而无法达到链接目录的效果。

个人推荐用后一种方式,这样可以多个工作目录并行开发。
配置中常用命令
重启apache
sudo /etc/init.d/apache2 restart
建立系统链接
sudo ln -s a b

关于服务器用BSD还是Linux

一个一直以来都很争议的话题,不想挑起两派阵营之间无谓的口水战。

只是谈一点自己的看法:

1:BSD相对稳定,Linux则对新技术比较敏感,更新非常快。

2:BSD磁盘性能和网络性能稍弱于Linux。

3:BSD使用难度稍大于Linux。

4:安全性没有什么可说的,因为我一旦开说,就会有人说,安全是管理员的事情,和系统无关,但是,真正意义上的安全,也包括默认系统情况下的安全保护状态。这一点上,BSD无疑是相对安全一些的,可能与它开启较少的应用不无关系。

5:很多时候,BSDer也是和Linuxer相互转化并且两者并存之。因为BSD跑Oracle实在是一件很痛苦的事情,而linux的臃肿,又是让人很纠结的。

总而言之,BSD适合喜欢折腾的人用,适合蛋疼的时候用,毕竟使用的人很少,一切都得靠文档,有时候很多文档都是英文的。

当然,真正的BSDer和Linuxer也是不会忙于搞这类对比的,只有我这样蛋疼的人,才会没事折腾这个。作为消遣吧。

Linux适合快速搭建应用平台,省去了很多折腾的时间。中文教程一抓一片。

(注:Windows不在此文讨论中,并不意味着系统不安全,一个配置较好的Win系统,依然是很难攻破的)

耶鲁校长:中国这一代教育者不值得尊重[转]

曾任耶鲁大学校长的小贝诺·施密德特,日前在耶鲁大学学报上公开撰文批判中国大学,引起了美 国教育界人士对中国大学的激烈争论。

对中国大学近年来久盛不衰的“做大做强”之风,施密德特说:“他们以为社会对出类拔萃的要求只是多:课程多,老师多,学生多, 校舍多。他们的学者退休的意义就是告别糊口的讲台,极少数人对自己的专业还有兴趣,除非有利可图。他们没有属于自己真正意义上的事业。而校长的退休,与官 员的退休完全一样,他们必须在退休前利用自己权势为子女谋好出路。”他认为,“新中国没有一个教育家,而民国时期的教育家灿若星海。”

对于通过中国政府或下属机构“排名”、让中国知名大学跻身“世界百强”的做法,施密德特引用基尔克加德的话说,它们在做“自己屋子里的君主”。“他们把经济上的成功当成教育的成功,他们竟然引以为骄傲,这是人 类文明史最大的笑话。”

中国大学近来连续发生师生“血拼”事件,施密德特认为,这是大学教育的失败,因为“大学教育解放了人的个性,培养了人的独立精神,它也同时增强了 人的集体主义精神,使人更乐意与他人合作,更易于与他人心息相通”,“这种精神应该贯穿于学生之间,师生之间”。“他们计 划学术,更是把教研者当鞋匠。难怪他们喜欢自诩为园丁。我们尊重名副其实的园丁,却鄙视一个没有自由思想独立精神的教师”。

中国大学日益严重的“官本位”体制,施密德特也深感担忧,他痛心地说:“宙斯已被赶出天国,权力主宰一切”。“文科的计划学术,更是权力对于思考的祸害,这已经将中国学者全部 利诱成犬儒,他们只能内部恶斗。缺乏批评世道的道德勇气。孔孟之乡竟然充斥着一批不敢有理想的学者。令人失望。”施密德特为此嘲笑中国大学“失去了重点,失去了方向,失去了一贯保持的传统”,“课程价值流失,效率低,浪费大”。

他嘲笑说,“很多人还以为自己真的在搞教育,他们参加一些我们的会议,我们基 本是出于礼貌,他们不获礼遇”。

由于当前经济危机引发的一系列困难,导致大学生就业难。施密德特 对此说,“作为教育要为社会服务的最早倡议者,我要说,我们千万不能忘记大学的学院教育不是为了求职,而是为了生活”。

他说,大学应该“坚持青年必须用文明人的好奇心去接受知识,根本无需回答它是否对 公共事业有用,是否切合实际,是否具备社会价值等”,反之大学教育就会偏离“对知识的忠诚”。

对中国大学的考试作弊、论文抄袭、科研造假等学术腐败,施密德特 提出了另一种观察问题的眼光,他说,“经验告诉我们,如果政权是腐败的,那么政府部门、社会机构同样会骇人听闻的腐败”。

他还说,“中国这一代教育者不值得尊重,尤其是一些知名的教授”。

施密德特认为中国大学不存在真正的学术自由,他说中国大学“对政治的适应,对某些人利益的迎合,损害了大学对智力和真理的 追求”。

他提出“大学似乎是孕育自由思想并能最终自由表达思想的最糟糕同时又是最 理想的场所”,因 此,大学“必须充 满历史感”,“必须尊重进化的思想”,“同时,它倾向于把智慧,甚至特别的真理当作一种过程及一种倾向, 而不当作供奉于密室、与现实正在发生的难题完全隔绝的一种实体”。他说:“一些民办教育,基本是靠人头计算利润的企业。”

网易和搜狐提供的开源镜像站点

网易开源镜像站

http://mirrors.163.com/

搜狐开源镜像站

http://mirrors.sohu.com/

网易悄然上线了一个开源软件镜像站点(mirrors.163.com),提供了大量开源操作系统ISO镜像文件下载和开源应用软件的更新等服务。网易开源软件镜像站点提供 Debian 、 Ubuntu 等 Linux 发行版的软件源服务。目前,网易是国内首个提供如此多的开源软件镜像的大型门户站点。网易这样的国内大型门户也已经支持开源软件,相信不久后,国内将爆发一场开源的热潮。

继网易在今年二月启动开源项目镜像之后,现在国内的另一家门户网站搜狐也上线了开源镜像站。浏览该站点,其中镜像的项目包括 Arch Linux、CentOS、Debian、Fedora、Gentoo、OpenSuSE、Slackware、Ubuntu 等 Linux 发行版,同时也包括 FreeBSD、OpenBSD 、NetBSD等 BSD 版本。

相比较,搜狐的开源系统和163没有太多差别,速度也都非常快,个人在更新方面,linux使用163和sohu是不分上下。但是搜狐多了一个openbsd的开源系统下载,这让我对搜狐的个人情感,更为亲切一些。

nginx php fpm紧急漏洞修复

解决方案1:修改/usr/local/php/etc/php.ini将cgi.fix_pathinfo设为0 (注:前面可能有注释符号; 需要删除掉。),执行/usr/local/php/sbin/php-fpm restart重启。

解决方案2:为nginx虚拟主机添加如下内容:
if ( $fastcgi_script_name ~ \..*\/.*php ) {
return 403;
}
此方法测试结果为二级目录报错403错误(未大面积测试),不建议采用。

nginx真的存在文件类型解析漏洞吗? 结果证明是php-fpm的问题。

The OpenBSD 4.7 Release

发布于2010年5月19日
版权 1997-2010, Theo de Raadt。
ISBN 978-0-9784475-5-7

Only two remote holes in the default install, in a heck of a long time!

The OpenBSD project produces a FREE, multi-platform 4.4BSD-based UNIX-like operating system. Our efforts emphasize portability, standardization, correctness, proactive security and integrated cryptography. OpenBSD supports binary emulation of most programs from SVR4 (Solaris), FreeBSD, Linux, BSD/OS, SunOS and HP-UX.

OpenBSD is freely available from our FTP sites, and also available in an inexpensive 3-CD set.

The current release is OpenBSD 4.7 which was released May 19, 2010.

OpenBSD is developed entirely by volunteers. The project pays for the development environment and developer events by selling CDs through a collection of stores and by accepting donations from organizations and individuals. These finances ensure that OpenBSD will continue to exist, and will remain free for everyone to use and reuse as they see fit. T-shirts and posters are available as well, but do not fund the project.

新特性

以下是 OpenBSD 4.7 中新特性和新系统功能的部分列表。 完整的列表位于 4.7 的修改记录中。

新增/扩展的构架平台:
OpenBSD/alpha
增加对 DS15/DS25/ES45 的支持。
OpenBSD/loongson
基于 MIPS 兼容的 Loongson 2E 和 2F 处理器的新平台。支持以下机型:
Lemote Fuloong 2F mini-PC
Lemote Lynloong all-in-one-PC
Lemote Yeeloong netbook (8.9″ and 10.1″ models)
EMTEC Gdium Liberty 1000 netbook
OpenBSD/sgi
增加对多节点 SGI Origin 系统 M 模式的支持。
增加对 SGI Origin 350, Onyx 350, Onyx 4 和 Tezro 系统的支持。
增加对 SGI Octane 的 SMP 支持。
增加对 Octane 和 Origin 系统更多内置设备的支持 (见下)。
OpenBSD/socppc
增加对 RouterBOARD RB600A 的支持。
OpenBSD/sparc64
在 sun4v 机型的 OpenBSD 控制域中,增加在客户域中运行 OpenBSD 的初步支持。
更新了硬件支持, 包括:
Revamped SCSI midlayer and improved driver support.
UDF 2.5 and 2.6 (HDDVD and Blu-ray) disks support.
Added mpath(4), a driver that steals paths to scsi devices if they could be available via multiple paths and then made available via mpath(4).
New aibs(4) driver for ASUSTeK AI Booster hardware monitoring.
New uthum(4) driver for the TEMPerHUM USB temperature and humidity sensors.
New utrh(4) driver for USBRH temperature and humidity sensors.
New uyurex(4) driver for the Maywa-denki & KAYAC YUREX twitch/jiggle of knee sensor.
New urndis(4) driver for remote NDIS Ethernet over USB devices (phones).
New xf86-video-wsudl(4) Xorg driver for USB DisplayLink devices supported by udl(4).
New mpii(4) driver for LSI Logic Fusion MPT Message Passing Interface II based SAS 2 controllers.
New athn(4) driver for Atheros IEEE 802.11a/g/n wireless network devices.
New alc(4) driver for Atheros AR8131/AR8132 10/100/Gigabit Ethernet devices.
New lisa(4) driver for STMicroelectronics LIS331DL MEMS motion sensors.
New gcu(4) driver for Intel EP80579 Global Configuration Unit.
New lom(4) driver for LOMLite and LOMLite2 as found on many of Sun’s UltraSPARC-IIi servers.
New vsw(4) driver for virtual switches on sun4v machines.
New vds(4) driver for virtual disk servers on sun4v machines.
Support for EP80579 integrated Ethernet and ICH9 M V has been added to em(4).
Support for 82599 and SFP+ 82598 devices has been added to ix(4).
Support for the Sun GigabitEthernet SBus Adapter 1.0/1.1 has been added to ti(4).
Support for SBus variants of the QLogic Fibre Channel host adapters has been added to isp(4).
Support for SBus variants of the Sun Gigabit Ethernet has been added to gem(4).
Support for Intel WiFi Link 1000 and Intel Centrino Advanced-N 6200/Ultimate-N 6300 has been added to iwn(4).
Support for Ralink RT3572 based 802.11n devices has been added to run(4).
VIA Tremor 5.1, M-Audio Revolution 5.1 cards has been added to envy(4).
New uhts(4) driver for USB HID touchscreens.
Improved touchscreen support in the xf86-input-ws(4) Xorg driver and improved calibration using the new device properties from Xinput.
Support for ON CAT6095 and ON CAT34TS02 temperature sensors added to sdtemp(4).
Several improvements and bug fixes to existing Ethernet drivers, including em(4), re(4), ti(4) and vge(4).
Support for the PIC PCI-X controller added to the SGI xbridge(4) driver.
Support for the onboard Fast Ethernet interface found on SGI Octane and many SGI Origin family systems, iec(4).
Support for more SGI input and video devices on Octane and Origin systems, with iockbc(4), impact(4), and odyssey(4).
Improved PCI resource allocation; more hardware left unconfigured by the machine’s firmware (including hotplugged hardware) should work now.
Support for recording/full-duplex added to mavb(4).
Improved support for USB audio devices in uaudio(4).
Improved support for bwi(4) devices on strict-alignment architectures like armish.
Eliminate usage of SCSI tagged queueing mechanisms other than simple queuing, thus avoiding incorrect implementations on various disk devices.
Eliminate spurious dhclient(8) error messages when the specified interface does not exist.
Eliminate spurious softraid(4) error messages for removable devices without media.
新工具:
newfs_ext2fs(8) for creating ext2 filesystems.
mkuboot(8) for creating U-Boot boot loader images.
midicat(1) MIDI server allowing MIDI programs to communicate
POSIX-compliant fuser(1) to identify process IDs holding a file open
文件系统中间层的改进:
Dynamic Buffer Cache now supported to a max size set with sysctl kern.bufcachepercent
Dynamic VFS name cache rewrite, now uses Red/Black trees instead of linked lists.
Numerous NFS client stability fixes.
Fix FAT32 mounting.
Fix cd9660 directory handling to eliminate looping and random truncation of directory entries.
Fix various internal locking problems with cd9660, udf, msdosfs and ffs file systems.
pf(4) 改进:
nat-to, rdr-to, binat-to options replace the nat, rdr and binat translation rules. See 2009/09/01 – pf(4) address translation changes for more info.
The route-to, reply-to, dup-to and fastroute options in pf.conf move to filteropts. See 2009/09/02 – pf(4) route-to/reply-to syntax change for more info.
pf(4) can now translate packets between different routing domains.
Added -S and -L options to pfctl(8) to store and load pf state table from a file.
Added support for IPV4 and IPv6 divert sockets.
OpenBGPD, OpenOSPFD 以及其它后台路由程序的改进:
Update capability code in bgpd(8) to follow RFC 5492.
BGP MPLS VPN (RFC 4364) support added to the bgpd RIB.
In bgpd(8), implement the RFC4486 BGP Cease Notification Message subcodes.
It is now possible to enable/disable specific BGP capabilities.
Update bgpctl(8) irrfilter to support IPv6 and 4-byte AS numbers.
Minimal router-dead-time of 1 second and sub-second hello intervals added to ospfd(8). Additionally it is now possible to specify sub-second SPF timers for faster route fail-over.
ospf6d(8) is now installed by default. The RIB can be synced with the kernel routing table now. Support for AS-ext LSA has been added. This is still work-in-progress but testing is highly appreciated.
ldpd — the MPLS label distribution protocol daemon — is now installed by default. A custom kernel with option MPLS is needed to use it.
通用网络堆栈的改进:
brconfig is now integrated into ifconfig(8)
Added vether(4), a virtual Ethernet device.
Two bugs in IPsec/HMAC-SHA2 were fixed, resulting in an incompatibility with the HMAC-SHA-256/384/512 hash algorithms with previous versions of OpenBSD and other IPsec implementations sharing the bugs.
In dhcpd(8), echo back the Relay Agent Information option if present, and add support for the ipsec-tunnel hardware type.
Make dhcrelay(8) pick up the routing domain from the specified interface and use that rdomain for relaying the packets to the server.
Added support in dhcrelay(8) for RFC3046 “DHCP-over-ipsec”.
Make the tcpdump(8) BGP OPEN capability parser RFC 5492 compliant.
Added an exec command to route(8) to run a process and its children in a specified routing domain.
ifconfig(8) now deals with more than 64 alias addresses.
Various fixes to mbuf defragmenting and mbuf chain copying improve reliability.
杂项改进:
malloc(3) now has an S flag to turn on the options that help debugging and improve security.
Updated terminfo(3) database and ncurses(3) library.
Added support for lazy binding in ld.so(1) on hppa.
Added POSIX silent check option (-C) to sort(1).
Added POSIX extended regular expression support to sed(1) (-E option).
Added GNU-compatible macro prefix option (-P) to m4(1).
Make it possible to specify a port in resolv.conf(5).
Improved FILE locking support in stdio(3).
Added SO_SNDTIMEO and SO_RCVTIMEO support in pthreads(3).
cdio(1) no longer prints bogus information if no TOC is found on the disk.
New -v flag causes cdio(1) to print profile and feature information.
whois(1) no longer attempts to keep the memory of 6Bone alive.
Added per-application MIDI-controlled volume knob to aucat(1)
Added MMC and MTC support to aucat(1) making possible MIDI-to-audio synchronization
Added mio_open(3) interface to access hardware and software MIDI ports
发现并修正了许多内存泄露。
通过正确的初始化开始 label,使处理软盘的 disklabel 更可靠。
对安装/升级过程的修改:
Take more care to ensure all filesystems are umount’ed when restarting an install or upgrade.
If no possible root disk is found, keep checking until one appears.
The default ftp directory for -stable is now the release directory instead of the snapshot directory.
Selection of TZ during installs is no longer confused by trailing slashes.
If /etc/X11 is found during upgrades, add the X sets to the list of default sets to install.
OpenSSH 5.5:
新特性:
SSH protocol 1 is disabled by default.
Remove the libsectok/OpenSC-based smartcard code and add support for PKCS#11 tokens.
Add support for certificate authentication of users and hosts using a new, minimal OpenSSH certificate format (not X.509).
Added a ‘netcat mode’ to ssh(1).
Add the ability to revoke keys in sshd(8) and ssh(1).
Rewrite the ssh(1) multiplexing support to support non-blocking operation of the mux master.
Add a ‘read-only’ mode to sftp-server(8) that disables open in write mode and all other fs-modifying protocol methods. (bz#430)
Allow setting an explicit umask on the sftp-server(8) commandline to override whatever default the user has. (bz#1229)
Many improvements to the sftp(1) client.
New RSA keys will be generated with a public exponent of 65537 instead of the previous value 35.
Passphrase-protected SSH protocol 2 private keys are now protected with AES-128 instead of 3DES.
修正了以下重要问题:
Fixed a minor information leak of environment variables specified in authorized_keys if an attacker happens to know the public key in use.
When using ChrootDirectory, make sure we test for the existence of the user’s shell inside the chroot and not outside. (bz#1679)
Cache user and group name lookups in sftp-server using user_from_[ug]id(3) to improve performance on hosts where these operations are slow. (bz#1495)
Fix problem that prevented passphrase reading from being interrupted in some circumstances. (bz#1590)
Ignore and log any Protocol 1 keys where the claimed size is not equal to the actual size.
Make HostBased authentication work with a ProxyCommand. (bz#1569)
Avoid run-time failures when specifying hostkeys via a relative path by prepending the current working directory in these cases. (bz#1290)
Do not prompt for a passphrase if we fail to open a keyfile, and log the reason why the open failed to debug. (bz#1693)
Document that the PubkeyAuthentication directive is allowed in a sshd_config(5) Match block. (bz#1577)
When converting keys, truncate key comments at 72 chars as per RFC4716. (bz#1630)
Do not allow logins if /etc/nologin exists but is not readable by the user logging in.
Output a debug log if sshd(8) can’t open an existing authorized_keys. (bz#1694)
Quell tc[gs]etattr(3) warnings when forcing a tty (ssh -tt), since we usually don’t actually have a tty to read/set. (bz#1686)
Prevent sftp(1) from crashing when given a “-” without a command; also, allow whitespace to follow a “-”. (bz#1691)
After sshd(8) receives a SIGHUP, ignore subsequent HUPs while sshd(8) re-execs itself; prevents two HUPs in quick succession from resulting in sshd(8) dying. (bz#1692)
Clarify in sshd_config(5) that StrictModes does not apply to ChrootDirectory; permissions and ownership are always checked when chrooting. (bz#1532)
Set close-on-exec on various descriptors so they don’t get leaked to child processes. (bz#1643)
Fix very rare race condition in x11/agent channel allocation
Fix incorrect exit status when multiplexing and channel ID 0 is recycled. (bz#1570)
Fail with an error when an attempt is made to connect to a server with ForceCommand=internal-sftp with a shell session. (bz#1606)
Warn but do not fail if stat(2)ing the subsystem binary fails. (bz#1599)
Change “Connecting to host…” message to “Connected to host.” and delay it until after the sftp protocol connection has been established. (bz#1588)
Use the HostKeyAlias rather than the hostname specified on the commandline when prompting for passwords. (bz#1039)
Correct off-by-one in percent_expand(). (bz#1607)
Fix passing of empty options from scp(1) and sftp(1) to the underlying ssh(1); also add support for the stop option “–”.
Fix an incorrect magic number and typo in PROTOCOL. (bz#1688)
Don’t escape backslashes when displaying the SSH2 banner. (bz#1533)
Don’t unnecessarily dup() the in and out fds for sftp-server(8). (bz#1566)
Force use of the correct hash function for random-art signature display. (bz#1611)
Do not fall back to adding keys without constraints when the agent refuses the constrained add request. (bz#1612)
Fix a race condition in ssh-agent(1) that could result in a wedged or spinning agent. (bz#1633)
Flush stdio before exec() to ensure that everything has made it out before the streams go away. (bz#1596)
Set FD_CLOEXEC on in/out sockets in sshd(8). (bz#1706)
超过 5800 个 ports,package 工具的健壮性和速度有所改进。
每种架构都有许多预先构建的包:
i386: 5951
sparc64: 5745
alpha: 5641
sh: 768
amd64: 5879
powerpc: 5785
sparc: 4053
arm: 3711
hppa: 5500
vax: 1785
mips64: 3690
mips64el: 4316
部分关键程序:
Gnome 2.28.2.
KDE 3.5.10.
Xfce 4.6.1.
MySQL 5.1.42.
PostgreSQL 8.4.2.
Postfix 2.6.5.
OpenLDAP 2.3.43.
Mozilla Firefox 3.0.18 and 3.5.8.
Mozilla Thunderbird 2.0.0.23.
OpenOffice.org 3.1.1.
Emacs 21.4 and 22.3
Vim 7.2.267.
PHP 5.2.12.
Python 2.4.6, 2.5.4 and 2.6.3.
Ruby 1.8.6.369.
按照惯例,手册或其它文档也有相应补充和修改。
以下是系统包含的外部提供的重要程序:
Xenocara (based on X.Org 7.4 with xserver 1.6.5 + patches, freetype 2.3.9, fontconfig 2.6.0, Mesa 7.4.2, xterm 250 and more)
Gcc 2.95.3 (+ patches) and 3.3.5 (+ patches)
Perl 5.10.1 (+ patches)
Our improved and secured version of Apache 1.3, with SSL/TLS and DSO support
OpenSSL 0.9.8k (+ patches)
Groff 1.15
Sendmail 8.14.3, with libmilter
Bind 9.4.2-P2 (+ patches)
Lynx 2.8.6rel.5 with HTTPS and IPv6 support (+ patches)
Sudo 1.7.2
Ncurses 5.7
Latest KAME IPv6
Heimdal 0.7.2 (+ patches)
Arla 0.35.7
Binutils 2.15 (+ patches)
Gdb 6.3 (+ patches)
如何安装

如果通过购买的 CD 安装,请按照下述指令操作。使用 FTP(或其它安装方式)安装与之类似;CDROM 中的安装是自治的, 它会让你知道如果使用购买的 CD 安装是多么方便。

有关安装 OpenBSD 4.7 更详细的信息,请参阅在三张 CD 或相关 FTP 镜像站点中的以下文件:
CD1:4.7/i386/INSTALL.i386
CD2:4.7/amd64/INSTALL.amd64
CD2:4.7/macppc/INSTALL.macppc
CD3:4.7/sparc64/INSTALL.sparc64
FTP:…/OpenBSD/4.7/alpha/INSTALL.alpha
FTP:…/OpenBSD/4.7/armish/INSTALL.armish
FTP:…/OpenBSD/4.7/hp300/INSTALL.hp300
FTP:…/OpenBSD/4.7/hppa/INSTALL.hppa
FTP:…/OpenBSD/4.7/landisk/INSTALL.landisk
FTP:…/OpenBSD/4.7/loongson/INSTALL.loongson
FTP:…/OpenBSD/4.7/mvme68k/INSTALL.mvme68k
FTP:…/OpenBSD/4.7/mvme88k/INSTALL.mvme88k
FTP:…/OpenBSD/4.7/sgi/INSTALL.sgi
FTP:…/OpenBSD/4.7/socppc/INSTALL.socppc
FTP:…/OpenBSD/4.7/sparc/INSTALL.sparc
FTP:…/OpenBSD/4.7/vax/INSTALL.vax
FTP:…/OpenBSD/4.7/zaurus/INSTALL.zaurus
快速安装仅适合熟悉 OpenBSD 和“disklabel -E”命令用法的人。如果你根本不懂安装 OpenBSD,请参阅上面罗列的相应 INSTALL.* 文件!

OpenBSD/i386:

设置 BIOS 可以从 CD 启动。OpenBSD/i386 发行版本在 CD1 中。如果你的 BIOS 不支持从 CD 启动,就可能需要制作启动软盘。将 CD1:4.7/i386/floppy47.fs 写入软盘来制作启动软盘,通过软盘驱动器启动。
使用 CD1:4.7/i386/floppyB47.fs 来制作引导软盘,可以获得更好的 SCSI 支持,或者使用 CD1:4.7/i386/floppyC47.fs 获得更好的笔记本电脑支持。

如果你不能从 CD 或软盘启动的话,还可以用 PXE 通过网络安装,请参阅 INSTALL.i386 文件。

如果计划让 OpenBSD 与另一操作系统共存,双重启动,请参阅 INSTALL.i386 文件。

在 MS-DOS 环境制作启动软盘,请使用位于 CD1:4.7/tools/rawrite.exe 的”rawrite”工具。在 Unix OS 环境制作启动软盘,请使用 dd(1) 工具。下面是使用 dd(1) 的例子,”device”可以是”floppy”,”rfd0c”,或”rfd0a”。

# dd if= of=/dev/ bs=32k
请确认你的软盘无坏道,已经正确格式化。否则很可能会安装失败。 有关制作启动软盘和安装 OpenBSD/i386 的信息请参阅 FAQ 4.3.1。

OpenBSD/amd64:

OpenBSD/amd64 的 4.7 版本在 CD2 中。设置 BIOS 可以从 CD 启动,然后用 CD 启动,开始安装 – 你可能需要先修改 BIOS 选项。 如果不能从 CD 启动,可以通过制作启动软盘来安装。用 CD2:4.7/amd64/floppy47.fs 来制作启动软盘,然后用软驱来启动。
如果不能从 CD 或软盘启动,可以用 PXE 通过网络来安装,有关信息请参阅 INSTALL.amd64 文件。

如果计划让 OpenBSD 与另一个操作系统共存,双重启动,请参阅 INSTALL.amd64。

OpenBSD/macppc:

将 CD2 放入 CDROM,开机后一直按着 C 键,直到显示器显示 OpenBSD/macppc boot。
或者在出现 Open Firmware提示时,输入 boot cd:,ofwboot /4.7/macppc/bsd.rd

OpenBSD/sparc64:

将 CD3 放入 CDROM,输入 boot cdrom。
如果这个没用,或没有光驱,你可以把 CD3:4.7/sparc64/floppy47.fs 或 CD3:4.7/sparc64/floppyB47.fs (依赖于你的机器)写入软盘,用它作为启动盘,输入 boot floppy 来启动。详细内容参阅 INSTALL.sparc64。

请确认你的软盘无坏道,已经正确格式化。否则很可能会安装失败。

你也可以将 CD3:4.7/sparc64/miniroot47.fs 写入磁盘中的 swap 分区, 然后在启动时输入 boot disk:b。

如果以上都不行,你可以按照 INSTALL.sparc64 中的描述通过网络来启动安装。

OpenBSD/alpha:

将 FTP:4.7/alpha/floppy47.fs 或 FTP:4.7/alpha/floppyB47.fs (依赖于你的机器)写入软盘,用它作为启动盘,输入 boot dva0 来启动。详细内容参阅 INSTALL.alpha。

请确认你的软盘无坏道,已经正确格式化。否则很可能会安装失败。

OpenBSD/armish:

连接串口之后,Thecus 能直接通过网络用 tftp 或 http 启动。使用 fconfig 配置网络,重置之后,加载 bsd.rd,详细信息请参阅 INSTALL.armish 。 IOData HDL-G 只能从 EXT2 格式分区启动。进入 linux,复制 ‘boot’ 和 ‘bsd.rd’ 到第一个分区 wd0(hda1), 然后加载和运行 ‘bsd.rd’,保留 wd0i(hda1) 上的 EXT2 分区。请参阅 INSTALL.armish 以获得更多信息。

OpenBSD/hp300:

按照 INSTALL.hp300 的相关说明通过网络来启动安装。

OpenBSD/hppa:

按照 INSTALL.hppa 或 hppa 平台页面的相关说明通过网络来启动安装。

OpenBSD/landisk:

将 miniroot47.fs 写入 CF 卡或磁盘的开始,正常启动后安装。

OpenBSD/loongson:

将 miniroot47.fs 写入 USB 盘,然后引导 bsd.rd;或者通过 tftp 引导 bsd.rd 。 详细信息请参阅 INSTALL.loongson 中的安装说明。

OpenBSD/mvme68k:

可以制作启动磁带或通过网络来安装。
网络启动需要支持 NIOT 和 NBO 调试命令的 MVME68K BUG 版本。 更多相关信息请参阅 INSTALL.mvme68k 中的安装说明。

OpenBSD/mvme88k:

网络启动需要支持 NIOT 和 NBO 调试命令的 MVME88K BUG 版本。 更多相关信息请参阅 INSTALL.mvme88k。

OpenBSD/sgi:

在 O2 中安装时,将 cd47.iso 刻录到光盘,将其放入光驱中,从系统维护菜单中选择 Install System Software 进行安装。

对于其它系统,或者没有光驱,你可以配置 DHCP/tftp 网络服务器,使用匹配你的系统类型的内核,用 “bootp()/bsd.rd.IP##” 引导。更多相关信息请参阅 INSTALL.sgi。

OpenBSD/socppc:

连接串口,通过 DHCP/tftp 引导安装。更多相关信息请参阅 INSTALL.socppc。

OpenBSD/sparc:

从提供的 ISO 安装文件引导,根据你所用的 ROM 版本, 需用到下面两个命令中的一个。
ok boot cdrom 4.7/sparc/bsd.rd

> b sd(0,6,0)4.7/sparc/bsd.rd
如果你的 SPARC 系统没有 CD 驱动器,你可以将 floppy47.fs 写入启动软盘。 更多相关信息请参阅 FAQ 4.3.1。 根据你所用的 ROM 版本,需用到下面两个命令中的一个来从软盘引导。

ok boot floppy

> b fd()
请确认你的软盘无坏道,已经正确格式化。否则很可能会安装失败。

如果你的 SPARC 系统没有软驱和 CD 驱动器,你可以制作可启动磁带, 或者通过网络来安装。相关内容在 INSTALL.sparc 中。

OpenBSD/vax:

用 mopbooting 通过网络启动来安装,相关信息请参阅 INSTALL.vax。
OpenBSD/zaurus:

用 Linux 内置的图形化安装程序 ipkg 来安装 openbsd47_arm.ipk 包。 重启之后,即可运行。更多信息请参阅 INSTALL.zaurus 。

关于源代码的说明:

src.tar.gz 包含的源代码文件开始路径是 /usr/src。 该文件包括除了内核代码之外的所有源代码,内核代码位于单独的档案文件中。 解压方法:
# mkdir -p /usr/src
# cd /usr/src
# tar xvfz /tmp/src.tar.gz
sys.tar.gz 包含的源代码文件路径开始是 /usr/src/sys。 该文件包括了重建内核需要的所有源代码。解压方法:

# mkdir -p /usr/src/sys
# cd /usr/src
# tar xvfz /tmp/sys.tar.gz
这些文件是 CVS 检出格式。可以使用匿名 CVS 服务器基于它们获得最新的版本。基于这些文件更新,比从 CVS 完全检出的速度要快得多。

如何升级

如果你已经安装了OpenBSD 4.6,不想重新安装,可以在升级指南中找到升级方法和忠告。

使用 ports 的方法

也提供了 ports 的档案文件。解压方法:

# cd /usr
# tar xvfz /tmp/ports.tar.gz
# cd ports
ports/ 子目录是 OpenBSD ports 版本库的检出副本。假如你不了解 ports, 请浏览 ports 页面。该文件并非是如何使用 ports 的手册, 它只是 OpenBSD ports 系统用户的初级读本。

The ports/ 目录是我们从 CVS(如果你不熟悉 CVS,请参阅手册 cvs(1)) 检出的 ports 副本。与我们的代码一样,ports 也可以通过匿名 CVS 服务器更新。因此,为了确保版本是最新的,必须使 ports/ 在可读写的介质中, 更新的命令是:

# cd [portsdir]/; cvs -d anoncvs@server.openbsd.org:/cvs update -Pd -rOPENBSD_4_7
[当然,在实际操作时需要将本地目录和服务器名称替换成你的 ports 所在位置和较近的匿名 CVS 服务器。]

注意大部分的 ports 可以通过 FTP 获得预先编译的二进制包。如果发现问题,会为 4.7 版本发布升级包。

如果你有兴趣观察 ports 的变动信息,或者帮助我们,或者只是想获得更多的信息, 请加入邮件列表 ports@openbsd.org 。

安全的Web服务器-Hiawatha

Hiawatha是一个以安全性著称的Web服务器,作者声称,他从2002年开始接触Web服务器,但是他使用过的任何一个Web服务器在安全和逻辑编程语法方面都不能让他满意,因此他开发了Hiawatha。Hiawatha可以运行在Linux/UNIX下,并且拥有十分健壮的安全体系。Hiawatha设计的最主要的目的就是安全,当然它在可编程配置方面也表现的非常突出。

http://www.hiawatha-webserver.org/

最近可能会做一个轻型web server比较的专题

OpenBSD Current版本更新系统核心和已安装软件包的方法

开始之前,先说下OpenBSD的几个版本以及他们之间的关系。

-release:OpenBSD开发团队每隔六个月推出的版本,通俗意义上的“正式版”。

-stable:稳定版,在“正式版”的基础上打上补丁和进行部分修正的版本。受限于人力和精力,此版本的支持时间为一年,一年后不再进行新的修正。

-current:开发版,“正式版”+补丁+修订+新功能等等,会在几个月后变成新的”正式版“。

使用current版本可以得到最全面的支持和安全保证。但是缺点也很明显,就是要不停的cvs源码,不停的wget软件源码,make && make install……确保跟踪系统各个部分的变化。另外,使用current版本是得不到”官方“技术支持的,这意味着你要自己解决所有可能出现的问题。

那么,有没有一种办法可以既跟上官方的步伐,不至于落得太远,又能够保证和官方方向一致,不至于自己一个人落进代码的”黑洞“?最简单的办法是使用OpenBSD FTP里面的snapshots。

再来说说snapshots。其实官方FTP的这个目录里面保存的是current版本某个时间点的”快照“,上图用个红点表示出来了。而且snapshots的更新是比较快的,通常系统核心是3~5天更新一次,packages半月左右更新一次。

当snapshots更新时,该如何跟进呢?

一、系统核心更新

方法一:你可以只下载bsd.rd这个文件,放在根目录,用它启动,然后选择upgrade,到定位OpenBSD的位置时选择snapshots目录,它会去下载最新的系统核心文件到你的机器上,然后halt重启即可。这个方法应该是最”官方“的方法,不过如果你管理着几十上百台机器,还不等你这次upgraded,新的核心又来了。。。那么请你接着往下看。

方法二:

先说思路

其实snapshots中保存的已经是编译好的核心,直接wget下来,覆盖旧的核心文件不就行了吗?就算有几十上百台机器,用其中一台开通FTP或HTTP服务,wget下来,其他机器再来这里wget,速度会更快!

具体步骤这里就不详细讨论了,因为涉及到系统各个部分的更新。原则上更新过的文件需要覆盖,未更新过的则不需要覆盖。OpenBSD从4.4版开始,提供了一个sysmerge工具可以帮助确定/etc目录系统文件的修改,一个示例在:http://www.openbsd.org/faq/upgrade44.html。

另外,一定记得备份/etc目录,因为这个目录太重要了!下面贴段偶自己用的脚本(最近几个月在用):

#!/bin/sh
cd /
rm /bsd.*
rm /*.tgz
wget ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/i386/bsd.*
wget ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/i386/base*.tgz
#此处请加入你自己的备份命令,通常情况下是备份/etc目录。视情况下载etc*.tgz这个文件。若有文件修改则下载,无则不下载。
#wget ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/i386/etc*.tgz
#misc*.tgz貌似没有什么作用,可以不下载。
#wget ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/i386/misc*.tgz
wget ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/i386/man*.tgz
mv /bsd /obsd
mv /bsd.mp /bsd
#备份/etc目录中的所有文件以及你自己手动修改过的文件(软件包中的文件除外)!!!重要!!!
mkdir /var/bakup
cp -rf /etc/* /var/bakup/
tar xzvphf /base*.tgz
# etc*.tgz和misc*.tgz文件若无更新则无须下载,不用解压。
#tar xzvphf /etc*.tgz
#tar xzvphf /misc*.tgz
tar xzvphf /man*.tgz
#这里只是简单的把备份的/etc目录拷贝回去,实际应用中应该考虑此目录中文件更新的情况,对应拷贝。
#cp -rf /var/bakup/* /etc/
/dev/MAKEDEV all
rm /*.tgz
reboot

好了,等系统重启完毕,已经是最新的核心了。几十上百台机器的管理员们,请把上面脚本的地址换成你某个FTP或HTTP服务器的地址,更新会是非常的快!

需要说明的一点是,因为snapshots中的系统核心未经过大范围的验证,所以可能会有各个方面的问题(偶就在一个月中遇到过两次更新后无法启动的情况),请一定在测试系统中验证后再大批量更新!

二、软件包的更新

这个比较简单了,理论上是删掉旧的,安装新的。命令在下面:

export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/i386/
pkg_add -u -F installed -F update -F updatedepends

你可以把上面这两行命令加入/etc/rc.local文件的最前面,系统需要启动的程序放在后面。

这样,系统重启后就会进行update的工作,完成后再启动各个程序,保证系统所有的部分都是最新的!

例如:偶的O.N.M.P.环境,需要开机启动MySQL、PHP-Fastcgi、Nginx,那么/etc/rc.local文件就如同下示:

rdate -n 210.72.145.44
rdate -n 210.72.145.44 >> /var/run/pkgupdate
export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/snapshots/packages/i386/
pkg_add -u -F installed -F update -F updatedepends >> /var/run/pkgupdate
# Start MySQL
if [ -x /usr/local/bin/mysqld_safe ] ; then
echo -n ‘Starting MySQL…’
su -c mysql root -c ‘/usr/local/bin/mysqld_safe >/dev/null 2>&1 &’
echo “DONE”
fi
# Start php-fastcgi
if [ -x /usr/local/bin/spawn-fcgi ] ; then
echo -n ‘Starting php-fastcgi…’
/usr/local/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -C 6 -u www -f /usr/local/bin/php-fastcgi > /var/run/fcgi.pid
echo “DONE”
fi
# Start nginx
if [ -x /usr/local/sbin/nginx ] ; then
echo -n ‘Starting nginx…’
/usr/local/sbin/nginx
echo “DONE”
fi

同理,即便你管理着几十上百台机器,把PKG_PATH设成你某个FTP或HTTP服务器的地址,预先把要用到的packages down下来,从这个机器上进行软件包的update,速度绝对是非常快!

写在最后

其实,偶是因为在虚拟机中无法正常的make userland才逼出这么一个办法,不清楚是否已经有高人使用更好的方法来进行系统的更新了。

说几点需要注意的:

一、当系统核心更新后,你可以在测试系统上把bsd、bsd.rd、bsd.mp、base*.tgz、etc*.tgz、misc*.tgz、man*.tgz等文件down下来,在临时目录中解压后和较旧的文件进行对比(主要是文件的MD5值),把有更新的文件找出来,在系统核心更新的脚本文件中进行处理,以加快批量更新的速度。

二、如果你仔细一些,其实没必要备份整个/etc目录,查找一下,把有单独”印记“的文件备份即可(例如master.passwd文件,hostname.*文件等等),这样可以减少出错的几率。

三、一定一定要在测试系统中测试无误后再去应用到生产系统!

参考资料:

OpenBSD FAQ:http://www.openbsd.org/faq/index.html

OpenBSD Upgrade Guide:http://www.openbsd.org/faq/upgrade44.html