Eric @ EricBess WebHome

胜不骄,败不馁,胸有激雷而面如平湖

Chinese (Simplified) flagItalian flagKorean flagPortuguese flagEnglish flagGerman flagFrench flagSpanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flagCzech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flagSwedish flagNorwegian flagCatalan flagFilipino flagHebrew flagIndonesian flagLatvian flagLithuanian flagSerbian flagSlovak flagSlovenian flagUkrainian flagVietnamese flag
By N2H

My Freebsd Setting

前章:FreeBSD standard setup and tuning [load]

第0小节:最小化安装后作业

sysinstall-->Configure-->Distributions-->man //安装man我的习惯,没有这个东西,真是痛苦
/usr/libexec/locate.updatedb //更新LOCATE库

第1小节:配置ssh

ee /etc/rc.conf
//里面如果有sshd_enable="YES"则说明我们已经开启ssh服务器了,如果没有请加上。

ee /etc/ssh/sshd_config
//找到#PermitRootLogin no这一行,去掉前面的#号,再把后面的no改成yes,按ESC再按两下回车保存退出。如果你会用VI也可以。

//重启SSH服务
/etc/rc.d/sshd restart

第2小节:更新系统

//安装cvsup程序。cvsup是一个用于从远程服务器主机上的主cvs(1) 库分发和更新源码树的软件包,用来更新操作系统和软件。
setenv PACKAGEROOT "ftp://ftp.freebsdchina.org/"
setenv PACKAGESITE "ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/i386/packages-7.0-release/Latest/" OR
//在/etc/profile 里设国内快点的packagesite
export PACKAGESITE=ftp://ftp.freebsdchina.org/pub/FreeBSD/ports/i386/packages-7.0-release/Latest/
export PACKAGEROOT=ftp://ftp.freebsdchina.org/

pkg_add -r cvsup-without-gui
rehash

//现在我们可以使用cvsup了,首先更新ports软件包源码。
cp /usr/share/examples/cvsup/ports-supfile ~root

更新服务器:

ee ~root/ports-supfile
//*default host=CHANGE_THIS.FreeBSD.org
//我们为了更快的速度,一般选择离我们比较近的服务器:
//*default host=cvsup.freebsdchina.org

更新PORTS LIST:

cvsup -g -L 2 ~root/ports-supfile

Click to continue reading

03月 23rd, 2008 Posted by eric | Unix/BSD/Linux | no comments

FreeBSD 7.0今天正式发布

FreeBSD 7.0-RELEASE 正式发布了,这是 7-STABLE 分支的第一个正式的发行版本,同时也是目前第一个以计划而非功能作为优先考虑的奇数版本。这一版本的主要亮点包括:

- 对于 SMP 环境下的数据库以及许多其他性能测试中暴露的可伸缩性问题进行了大幅度的改善。FreeBSD 7.0 在一些用例中,普通负载时性能比 FreeBSD 6.X 提高了 350%,高负载条件下性能提高达 1500%。与目前为止 Linux 内核的最佳性能(2.6.22 和 2.6.24版本)相比,性能高 15%。这些性能改善的结果来自于用于分析和改进系统性能的性能评估用例,对于您具体的工作负载,可能会有所不同。性能方面的改善主要源自以下方面的改进:
  * 默认采用 1:1 线程模型的 libthr 线程库。
  * 对于进程间通讯(IPC)、网络和调度器上锁方面的改进。
  * 对 5.x 和 6.x 分支所引入的 SMP 架构的优化。

一些性能测试显示,这一版本的 FreeBSD 对于至多 8 颗 CPU 的情形,其性能随 CPU 个数线性增加。许多工作负载在多核系统中均呈现了显著的性能提升。

Click to continue reading

02月 28th, 2008 Posted by eric | Unix/BSD/Linux | no comments

Proftpd for FreeBSD port

Install proftpd

 cd /usr/ports/ftp/proftpd
 make config

| |   [X] IPV6             Use IPv6                                | |
| |   [ ] LDAP             Use LDAP                                | |
| |   [ ] LDAP_TLS         Use LDAP TLS (Requires LDAP, OPENSSL)   | |
| |   [X] MYSQL            Use MySQL                               | |
| |   [ ] PGSQL            Use Postgres                            | |
| |   [X] OPENSSL          Include mod_tls                         | |
| |   [X] QUOTA            Include mod_quota                       | |
| |   [X] IFSESSION        Include mod_ifsession                   | |
| |   [X] README           Include mod_readme                      | |
| |   [X] RATIO            Include mod_ratio                       | |
| |   [X] CTRLS            Include controls                        | |
| |   [X] REWRITE          Include mod_rewrite                     | |
| |   [X] WRAP             Include mod_wrap2                       | |
| |   [ ] WRAP_FILE        Include mod_wrap2_file                  | |
| |   [ ] WRAP_SQL         Include mod_wrap2_sql                   | |
| |   [X] RADIUS           Include mod_radius                      | |
| |   [ ] QUOTATAB_RADIUS  include mod_quotatab_radius             | |
| |   [ ] BAN              Include mod_ban (Requires CTRLS)        | |
| |   [ ] NLS              Use nls (builds mod_lang)               | |
| |   [ ] CYRFIX           Patch to fix cyrillic encoding          | |
| |   [X] CLAMAV           Include mod_clamav                      | |

 make install

#基本配置

   cp /usr/local/etc/proftpd.conf /usr/local/etc/proftpd.conf.sample
   vi /usr/local/etc/proftpd.conf

1 2 3

02月 19th, 2008 Posted by eric | System | no comments

Apache @ Linux&FreeBSD Setup

1. Linux Setup

1.1 Installation

1
2
3
4
5
wget -P tar/ http://apache.justdn.org/httpd/httpd-2.X.XX.tar.bz2tar jxvf tar/httpd-2.X.XX.tar.bz2
cd httpd-2.X.XX
./configure --prefix=/usr/local/apache
make -j 10
make install

1.2 Config setting

1
2
cp support/apachectl /etc/init.d/httpd
chmod 755 /etc/init.d/httpd

Add following to the head "/etc/init.d/httpd" : 修改/etc/init.d/httpd:前面几行改成如下样子.

1
2
3
4
5
6
7
# Startup script for the Apache Web Server
# chkconfig: 35 85 15
# description: Apache is a World Wide Web server. It is used to serve \
# HTML files and CGI.
# processname: httpd
# pidfile: /usr/local/apache/log/httpd.pid
# config: /usr/local/apache/conf/httpd.conf

Run

1
chkconfig --add httpd

Configuration "/usr/local/apache/conf/httpd.conf"

1
ServerName yourservername.yourdomainname:80

#在/root/.bash_profile 中的PATH****后加上:/usr/local/apache/bin

2. 用Apache的.htaccess文件增加用户认证

 
然后编辑httpd.conf, 添加 例:
1
2
3
4
5
6
7
Alias /test"/var/www/test"
<directory "/var/www/test">
  Options Indexes MultiViews
  AllowOverride AuthConfig #表示进行身份验证
  Order allow,deny
  Allow from all
</directory>
最后:注意".htaccess"的权限。
 

3.名字型虚拟主机

1
2
3
4
5
6
7
8
9
10
NameVirtualHost 61.152.210.22
<virtualhost></virtualhost>
  ServerAdmin eric@ericbess.com
  ServerName www.ericbess.com
  DocumentRoot /home/eric/public_html/igenus
 
<virtualhost></virtualhost>
  ServerAdmin eric@dyzq.com
  ServerName mail.dyzq.com
  DocumentRoot /usr/local/httpd/htdocs/

4.Other

在这里,最好是在apache的配置中增加默认文件类型的cache机制,即利用apache的expires模块,新增类似如下几行:

1
2
3
4
5
6
7
ExpiresActive On
ExpiresByType text/html &quot;access plus 10 minutes&quot;
ExpiresByType text/css &quot;access plus 1 day&quot;
ExpiresByType image/jpg &quot;access 1 month&quot;
ExpiresByType image/gif &quot;access 1 month&quot;
ExpiresByType image/jpg &quot;access 1 month&quot;
ExpiresByType application/x-shockwave-flash &quot;access plus 3 day&quot;

Click to continue reading

12月 29th, 2007 Posted by eric | Unix/BSD/Linux | no comments

FreeBSD CVSup (简明使用)

  CVSup 是一个用于从远程服务器主机上的主 CVS 仓库发布和升级源代码树的软件包。 FreeBSD 的源代码维护在加利福尼亚州一台主开发服务器的 CVS 仓库里。 有了 CVSup,FreeBSD 用户可以很容易的保持他们自己的源代码树更新。

  CVSup 使用所谓的升级 pull 模式。在 pull 模式下,客户端在需要的时候向服务器端请求更新。 服务器被动的等待客户端的升级请求。因此所有的升级都是客户端发起的。 服务器决不会发送未请求的升级。用户必须手动运行 CVSup 客户端获取更新, 或者设置一个 cron 作业来让它以固定的规律自动运行。

  术语 CVSup用大写字母写正是表示, 代表了完整的软件包。它的主要组件是运行在每个用户机器上的客户端 cvsup, 和运行在每个 FreeBSD 镜像站点上的服务器端 cvsupd。

安装

安装 CVSup 最简单的方式就是使用 FreeBSD packages collection 中预编译的 net/cvsup 包。
# pkg_add -r cvsup
如果想在没有安装 XFree86TM 或 Xorg 的计算机,则只能使用不包含 CVSup GUI 的 net/cvsup-without-gui。
# pkg_add -r cvsup-without-gui

这样我们就安装了cvsup程序,但我们要刷新一下命令才可以使用cvsup。输入
#rehash

Click to continue reading

12月 11th, 2007 Posted by eric | Unix/BSD/Linux | no comments

PHP 整理(Linux,Freebsd)

1. Installation php

Installing PHP 4.4.1 (Linux)

1
2
3
4
5
6
7
wget -P tar/ http://cn.php.net/get/php-4.4.1.tar.bz2/from/this/mirror
tar jxvf tar/php-4.4.1.tar.bz2
cd php-4.4.1
./configure --prefix=/usr/local/php --with-mysql=/usr/local/mysql --with-apxs2=/usr/local/apache/bin/apxs
make -j 10
make install
cp php.ini-dist /usr/local/php/lib/php.ini

Configuring PHP (Linux)

vi /usr/local/php/lib/php.ini
#;default_charset = "iso-8859-1"
#在这行下面加一行
#default_charset = "gbk"

vi /usr/local/apache/conf/httpd.conf
#找到#AddType application/x-tar .tgz 这行,在下面加两行

1
2
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

#找到下面一行在后面加上index.php,这表示网站的默认页也能够为index.php

1
DirectoryIndex index.html index.html.var index.php

#注意:改变了http.conf后,要重启apache服务
#确认安装成功了解配制信息: echo "<? phpinfo(); ?>" >/usr/local/apache/htdocs/phpinfo.php
#访问http://yourserver/phpinfo.php  

Installing  PHP(FreeBSD port)

# cd /usr/ports/lang/php5
# make install clean

Adding the PHP 5 module to Apache(22) >>/usr/local/etc/apache22/httpd.conf

1
2
3
DirectoryIndex index.php index.html index.htm
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps  

Configuring PHP (freeBSD)

# cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini

Click to continue reading

11月 27th, 2007 Posted by eric | System, Unix/BSD/Linux | no comments

Page 1 of 212»