Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1854053
  • 博文数量: 237
  • 博客积分: 9995
  • 博客等级: 中将
  • 技术积分: 2890
  • 用 户 组: 普通用户
  • 注册时间: 2006-04-30 10:33
文章分类

全部博文(237)

文章存档

2011年(1)

2007年(59)

2006年(177)

我的朋友

分类: BSD

2006-10-15 10:15:22

###################################################基本设置#####################################################
setenv PACKAGEROOT ""
pkg_add -r cvsup-without-gui
ee /etc/rc.conf
add
sendmail_enable="NONE"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
mkdir /usr/home/chb/pkg_info
reboot
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_cvsup-without-gui.txt
 
##################################################同步系统代码###################################################
cvsup -g -L 2 -h cvsup.jp.FreeBSD.org /usr/share/examples/cvsup/standard-supfile
reboot
 
##################################################编译系统内核###################################################
cd /usr/src
make -j4 buildworld
cd /usr/src/sys/i386/conf
cp GENERIC  /root/GENERIC.OLD
ee NS1
cd /usr/src
make buildkernel
make installkernel
shutdown -r now
mergemaster -p
cd /usr/src
make installworld
mergemaster
shutdown -r now
delete
/usr/obj
cd /usr/obj
chflags -R noschg *
rm -rf *
###############################################同步ports软件包###############################################
cvsup -g -L 2 -h cvsup.jp.FreeBSD.org /usr/share/examples/cvsup/ports-supfile
reboot
 
################################################设置bind######################################################
%%%%%%%%%%%%%%%%%建立正反向解析目录%%%%%%%%%%%%%%%
mkdir /etc/namedb/rev
mkdir /etc/namedb/hosts
%%%%%%%%%%%%%%%改变正反向解析目录属性%%%%%%%%%%%%%
chown bind:bind /etc/namedb/rev
chown bind:bind /etc/namedb/hosts
chmod 750 /etc/namedb/rev
chmod 750 /etc/namedb/hosts
%%%%%%%%%%%%%生成正反向解析文件的例子文件%%%%%%%%%
cd /etc/namedb
sh make-localhost
%%%%%%%%%%%%%%%%生成这正反向解析文件%%%%%%%%%%%%%%
cp /etc/namedb/master/localhost.rev /etc/namedb/rev/192.168.0.rev
cp /etc/namedb/master/localhost.rev /etc/namedb/hosts/chb.com.hosts
 
%%%%%%%%%%%%%%%%设置DNS服务器的主域%%%%%%%%%%%%%%%
ee /etc/namedb/named.conf
zone "0.168.192.IN-ADDR.ARPA" {
        type master;
        file "/etc/namedb/rev/192.168.0.rev";
};
zone "chb.com" {
        type master;
        file "/etc/namedb/hosts/chb.com.hosts";
};

%%%%%%%%%%%%%设置DNS服务器反向解析文件%%%%%%%%%%%%%
ee /etc/namedb/rev/192.168.0.rev
$TTL    3600
@       IN      SOA     ns1.tjhaina.net. root.ns1.tjhaina.net.  (
                                20050430        ; Serial
                                3600    ; Refresh
                                900     ; Retry
                                3600000 ; Expire
                                3600 )  ; Minimum
           IN      NS      ns1.tjhaina.net.
111     IN      PTR     ns1.tjhaina.net.
112 IN PTR .
 
%%%%%%%%%%%%%设置DNS服务器的正向击文件%%%%%%%%%%%%%%
ee /etc/namedb/hosts/tjhaina.net.hosts

$TTL    3600
@       IN      SOA     ns1.tjhaina.net. root.ns1.tjhaina.net.  (
                                20050621        ; Serial
                                3600    ; Refresh
                                900     ; Retry
                                3600000 ; Expire
                                3600 )  ; Minimum
        IN      NS      ns1.tjhaina.net.
ns1     IN      A       222.36.42.111
www     IN      A       222.36.42.112
mail IN A 222.36.42.111
pureftp IN A 222.36.42.111
phpsysinfo IN A 222.36.42.111
ns2 IN A 222.36.42.112
tjhaina.net.            IN      MX      10 ns1.tjhaina.net.
shop IN A 222.36.42.112
gg IN A 222.36.42.112
tjhaina.net. IN NS ns2.tjhaina.net.
chb IN A 222.36.42.112
yzhy IN A 222.36.42.112
biz IN A 222.36.42.112
card IN A 222.36.42.112
blog IN A 222.36.42.112
photo IN A 222.36.42.112
netdisk IN A 222.36.42.112
guestbook IN A 222.36.42.112
help IN A 222.36.42.111
yzhy2 IN A 222.36.42.111

%%%%%%%%%%%%%生成DNS服务器的key文件%%%%%%%%%%%%%%%%%
/usr/sbin/rndc-confgen > /etc/namedb/rndc.conf

%%%%%%%%%%%%将key文件导入named.conf文件%%%%%%%%%%%%%
cd /etc/namedb
tail -n10 rndc.conf | head -n9 | sed -e s/#\ //g >> named.conf
%%%%%%%%%%%%%%%%%%%启动DNS服务器%%%%%%%%%%%%%%%%%%%%
/usr/sbin/named -gc /etc/namedb/named.conf &
/usr/sbin/rndc status

%%%%%%%%%%%%%%%%%%设置本机DNS服务器地址%%%%%%%%%%%%%
ee /etc/resolv.conf
add
nameserver      127.0.0.1
nameserver      211.98.2.4
nameserver 202.99.104.68
nameserver 202.99.96.68
nameserver 202.102.128.68
nameserver 202.103.0.117
nameserver 202.103.44.5

%%%%%%%%%%%%删除或注释掉DNS服务器的监听地址%%%%%%%%
ee /etc/namedb/named.conf
delete
20  listen-on       { 127.0.0.1; };
rndc reload
%%%%%%%%%%%%使DNS服务器和系统一起启动%%%%%%%%%%%%%%
ee /etc/rc.conf
add
named_enable="YES"

###############################################安装perl5.8.X########################################################
cd /usr/ports/lang/perl5.8
make WITH_DEBUGGING=yes \
WITH_GDBM=yes \
WITHOUT_PERL_MALLOC=yes \
WITHOUT_PERL_64BITINT=yes \
WITH_THREADS=yes \
ENABLE_SUIDPERL=yes
make test
make install
make clean
make rmconfig
shutdown -r now
perl -v
ps auwx|grep perl
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_perl5.8.txt
 
#############################更改ports软件包的默认下载路径(因为只有安装了perl后才会有/etc/make.conf)##############
ee /etc/make.conf
add
MASTER_SITE_OVERRIDE=ftp://ftp3.jp.freebsd.org/pub/FreeBSD/ports/distfiles/${DIST_SUBDIR}
 

###############################################安装openssl##########################################################
cd /usr/ports/security/openssl
make
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_openssl.txt
 
##############################################安装web管理系统webmin################################################
cd /usr/ports/sysutils/webmin
make
make install
make clean
make rmconfig
/usr/local/lib/webmin/setup.sh
ee /etc/rc.conf
add
webmin_enable="YES"
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_webmin.txt
 
##############################################安装数据库mysql4.0#####################################################
cd /usr/ports/databases/mysql40-server
make WITH_CHARSET=gbk \
WITH_XCHARSET=all \
SKIP_DNS_CHECK=yes \
BUILD_OPTIMIZED=yes \
BUILD_STATIC=yes
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_mysql40-server.txt
%%%%%%%%%%%%%%%%%%安装mysql40组件%%%%%%%%%%%%%%%%%%
cd /usr/ports/databases/p5-DBD-mysql40
make
make install
make clean
make rmconfig
%%%%%%%%%%%%%%%使mysql40和系统一起启动%%%%%%%%%%%%%
ee /etc/rc.conf
mysql_enable="YES"
%%%%%%%%%%%%%%%%%启动mysql40%%%%%%%%%%%%%%%%%%%%%%%
start mysql
#/usr/local/share/mysql/mysql.server start
/usr/local/etc/rc.d/mysql-server.sh start
%%%%%%%%%%%%%%%%%%设置mysql40的密码%%%%%%%%%%%%%%%%
/usr/local/bin/mysqladmin -u root password
reboot
mysql -u root #
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_mysql40.txt
 
###############################################安装expat2#############################################################
cd /usr/ports/textproc/expat2
make
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_expat2.txt
 
###############################################安装web服务器apache1.33################################################
cd /usr/ports/www/apache13
make
make install
make clean
make rmconfig
%%%%%%%%%%%%%%%%%%使apache和系统一起启动%%%%%%%%%%%
ee /etc/rc.conf
add
apache_enable="YES"
%%%%%%%%%%%%%%%%更改apache的相应设置%%%%%%%%%%%%%%%
ee /usr/local/etc/apache/httpd.conf
change 330
ServerAdmin ==>ServerAdmin
change 348
#ServerName
add      794 
AddLanguage zh-cn .zh-cn
add      822 
Addcharset GB2312 .gb2312    
add   977
NameVirtualHost 222.36.42.111 (your hosts ip)
%%%%%%%%%%%%%%%%%%%%启动apache%%%%%%%%%%%%%%%%%%%%
start apache
/usr/local/sbin/apachectl start
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_apache.txt
 
##############################################安装php###############################################################
cd /usr/ports/lang/php4
make
make install
make clean
make rmconfig
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_php4.txt
 
##############################################安装php扩展###########################################################
cd /usr/ports/lang/php4-extensions
make (+  bz2)
make install
make clean
make rmconfig
cd /usr/local/etc
cp php.ini-recommended php.ini
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_php4-extensions.txt
 
##############################################安装phpSysInfo基于php的系统监测###########################################
cd /usr/ports/www/phpSysInfo/
make
make install
make clean
make rmconfig
cd /usr/local/www/data/phpSysInfo/
cp config.php.new config.php
chown www:www config.php
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_phpSysInfo.txt
 
#############################################安装phpmyadmin基于php的数据库web管理系统###################################
cd /usr/ports/databases/phpmyadmin/
make
make install
make clean
make rmconfig
%%%%%%%%%%%%%%%%%%更改phpMyAdmin的配置%%%%%%%%%
cd /usr/local/www/phpMyAdmin
chmod 755 config.inc.php
ee /usr/local/www/phpMyAdmin/config.inc.php
将84行
$cfg['Servers'][$i]['auth_type'] = 'config'; // Authentication method (config, http or cookie based)?
改成
$cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)?
将39行
$cfg['PmaAbsoluteUri'] = ' ';
改成
$cfg['PmaAbsoluteUri'] = '';
pkg_info
pkg_info | col -b > /usr/home/chb/pkg_info/pkg_info_phpmyadmin.txt

 
阅读(2508) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~