安装防火墙 防火墙在上面已经编译入了内核,并且在上面的rc.conf里面已经打开了,所以在此只要设置一下即可! 允许所有IP通过,免得把自己给挡在外面了。 ipfw add all from any to any
其它规则根据实际情况来做,如果您想系统每次启动都使用上一次的规则,可以把这些内容加到: vi /etc/ipfw.rules 里面,语法规则同ipfw。
安装数据库MYSQL 安装mysql40-server和mysql40-client 进入/usr/ports/databases/mysql40-server 执行: make clean make deinstall make WITH_OPENSSL=yes WITH_linuxTHREADS=yes BUILD_OPTIMIZED=yes install 或者使用下面可参考的编译参数:BUILD_STATIC=yes 编译成静态执行版本 make clean
再修改/usr/local/etc/pureftpd-mysql.conf的如下部份为您的设定值: # Mandatory : user to bind the server as. MYSQLUser demo # Mandatory : user password. You must have a password. MYSQLPassword demo # Mandatory : database to open. MYSQLDatabase demo
再进入使用mysql –uroot –p123456 进入mysql的文本方式﹔ 使用如下命令建立新表: use system; DROP TABLE IF EXISTS users; CREATE TABLE users ( User varchar(16) NOT NULL default '', status enum('0','1') NOT NULL default '0', Password varchar(64) NOT NULL default '', Uid varchar(11) NOT NULL default '-1', Gid varchar(11) NOT NULL default '-1', Dir varchar(128) NOT NULL default '', ULBandwidth smallint(5) NOT NULL default '0', DLBandwidth smallint(5) NOT NULL default '0', comment tinytext NOT NULL, ipaccess varchar(15) NOT NULL default '*', QuotaSize smallint(5) NOT NULL default '0', QuotaFiles int(11) NOT NULL default 0, PRIMARY KEY (User), UNIQUE KEY User (User) ) TYPE=MyISAM;
$DefaultUser = "ftpuser"; # Default User Logon^M $DefaultPass = ""; # Default User Password^M $DefaultUid = "1002"; # Default User ID ( must be a re al user acct )^M $DefaultGid = "1001"; # Default Group ID ( must be a r eal group acct )^M $DefaultDir = "/home"; # Default User Dir ( use /./ at the end to chroot )^M $DefaultUL = "0"; # Default Upload Throttl e ( 0 disables it )^M $DefaultDL = "0"; # Default Download Throt tle ( 0 disables it )^M $Defaultip = "*"; # Default IP restriction s ( * = any IP )^M $DefaultQS = "200"; # Default Quota Size ( 0 disable s it )^M $Defaultcmt = ""; # Default Comment for us er^M ^M // UA^M $DefaultQF = "0"; # Default Quota Files ( 0 disabl
安装APACHE服务器 安装apache13-modssl 进入/usr/ports/www/apache13-modssl 执行: make clean make deinstall make WITH_APACHE_SUEXEC=yes APACHE_HARD_SERVER_LIMIT=1024 APACHE_PERF_TUNING=yes install 编译时带上suexec和优化。 Make clean
取消所有Options里面的Indexes,禁止浏览目录及文件。 设置KeepAlive Off 安装PHP语言 安装php 进入/usr/ports/www/mod_php4 执行: make clean make deinstall make install 编译常用的选项即可,一定记得选择上mysql和gd。 Make clean 安装完成后,在/usr/local/etc/apache/httpd.conf里面,加入如下内容: AddType application/x-httpd-php .php .php3 .php4 .phtml AddType application/x-httpd-php-source .phps
再cp php.ini-recommended /etc/php.ini 以及修改php.ini里面的参数 vi /etc/php.ini 修改下面两处为: register_globals = On magic_quotes_gpc = On
安装ZendOptimizer 先下载ZendOptimizer-2.1.0b-FreeBSD4.0-i386.tar.gz 再执行 tar zxvf ZendOptimizer-2.1.0b-FreeBSD4.0-i386.tar.gz cd ZendOptimizer-2.1.0b-FreeBSD4.0-i386 sh setup 即可完成傻瓜式的安装。 注意:此时您的php.ini配置文件,一般会移到 /usr/loca/Zend/etc/php.ini 并且底部会增加以下几行: [Zend] zend_optimizer.optimization_level=15 zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-2.1.0 zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-2.1.0 zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so
您可以根据需要,改变15为1023,来提升加速的等级。
安装APACHE其它整合软件 安装mod_bandwidth 进入/usr/ports/www/mod_bandwidth 执行: make clean make deinstall make install 编译完成后,一定记得 vi /usr/local/etc/apache/httpd.conf LoadModule bandwidth_module libexec/apache/mod_bandwidth.so AddModule mod_bandwidth.c
* MinBandWidth 设定每个连接传送数据的基本带宽占用,以Byte为单位。默认值:256 B/s。 当rate设定为0时,使用默认带宽限制。 安装mod_fastcgi 进入/usr/ports/www/mod_ fastcgi 执行: make clean make deinstall make install 编译完成后,一定记得 vi /usr/local/etc/apache/httpd.conf LoadModule fastcgi_module libexec/apache/mod_fastcgi.so AddModule mod_fastcgi.c AddHandler fastcgi-script fcgi fcgi fpl
make clean
安装mod_gzip 进入/usr/ports/www/mod_gzip 执行: make clean make deinstall make install 编译完成后,一定记得 vi /usr/local/etc/apache/httpd.conf LoadModule gzip_module libexec/apache/mod_gzip.so AddModule mod_gzip.c
make clean
安装mod_limitipconn 进入/usr/ports/www/mod_limitipconn 执行: make clean make deinstall make install 编译完成后,一定记得 vi /usr/local/etc/apache/httpd.conf LoadModule limitipconn_module libexec/apache/mod_limitipconn.so AddModule mod_limitipconn.c
make clean
安装mod_perl 进入/usr/ports/www/mod_perl 执行: make clean make deinstall make install 编译完成后,一定记得 vi /usr/local/etc/apache/httpd.conf LoadModule perl_module libexec/apache/mod_perl.so AddModule mod_perl.c
make clean
安装mod_throttle 进入/usr/ports/www/mod_throttle 执行: make clean make deinstall make install 编译完成后,一定记得 vi /usr/local/etc/apache/httpd.conf LoadModule throttle_module libexec/apache/mod_throttle.so AddModule mod_throttle.c
make clean
安装mod_watch 进入/usr/ports/www/mod_watch 执行: make clean make deinstall make install 编译完成后,一定记得 vi /usr/local/etc/apache/httpd.conf LoadModule watch_module libexec/apache/mod_watch.so AddModule mod_watch.c
注:需 mod_status 的 ExtendedStatus On 支持!! 如超出限制的并发数在客户端就会出现503错误:
Service Temporarily Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. --------------------------------------------------------------------------------
Apache/1.3.27 Server at server1 Port 80
在 error_log 中将会有类似以下的错误提示: [Mon Jun 23 15:22:24 2003] [error] client access to server1 deferred, MaxVhostClients 100 exceeded
安装MRTG 安装net-snmp 进入/usr/ports/net/net-snmp 执行: make clean make deinstall make install make clean
安装mrtg 进入/usr/ports/net/mrtg 执行: make clean make deinstall make install make clean 设置虚空间的mrtg和流量分析 生成流量控制檔: /usr/local/sbin/apache2mrtg.pl /usr/local/etc/apache/httpd.conf > /usr/local/etc/apache/mod_watch.cfg 修改此文件,并且加如下头部信息:
安装BIND 9 安装bind9 这是一套域名解析系统,可以让您的SERVER做DNS SERVER,非常不错的! 进入/usr/ports/dns/bind9 make clean make deinstall make install make clean 然后再记得修改name.conf 等配置文件,具体的内容太复杂,建议看一下其它专门讲授这方面的书籍。