我给倪一分服务器设置的手顺书
一定要给分!
目录:
<1. Redhat Install>
<2. PostgreSQL Install>
<3. Aapche Install>
<4. Php4 Install>
<5. Proftpd Install>
<6. daemontools Install>
< 7.cdb-0.75 install>
<8. tcpsever Install>
<9. tcpwrapper 设定>
<10. openssh Install>
<11. qmail Install>
<12.rsync install>
<13. xntp install >
<14. analog>
<15. fml >
安装所需软件:(软件放在/home/dico/sysad/src下)
apache_1.3.19.tar.gz
postgreSQL7.1.2.tar.gz
openssl-0.9.5a.tar.gz
mod_ssl-2.8.3-1.3.19.tar.gz
php-4.0.4.tar.gz
php-4.0RC2_jstring-1.0.tar.gz
rsync-2.4.6.tar.gz
proftpd-1.2.1.tar.gz
openssh-1.2.1pre22.tar
xntp3-5.93-4.i386.rpm
daemontools-0.76.tar.gz
ucspi-tcp-0.88.tar.gz
cdb-0.75.tar.gz
qmail-1.03.tar.gz
vpopmail-4.9.tar.gz
<1. Redhat Install>
1. 设置CMOS为光盘启动;
2. 光盘放入光驱中;
3. Welcome to Red Hat Linux 显示后,回车;
4. Keyboard Configuration 页面,点击 Next;
5. Mouse Configuration页面,选择 2 Buttons Mouse ( Ps/2 ), 点击 Next;
6. Welcome to Red Hat Linux页面,点击 Next;
7. Install Options页面,选择 Custom System,点击 Next;
8. Disk Partitioning页面,选择Manually Partition with Fdisk ;
9. Using Fdisk 中,Select drive to run fdisk on ----had----中,点击----had----;
10. Partition with Fdisk;
1) 删除分区(从后往前删除已经存在的分区);
2) 新建分区
Command(m for help):n<enter>
e extend
p primary partition (1---4)
p<enter>
Partition number (1---4) :1<enter>
First cylinder (1---1868,default 1) :<enter>
Last cylinder or +size or +sizeM or +sizeK: +256M<enter>(该PC 内存倍数)
Command(m for help):n<enter>
e extend
p primary partition (1---4)
p<enter>
Partition number (1---4) :2<enter>
First cylinder (18---1868,default 18) :<enter>
Last cylinder or +size or +sizeM or +sizeK:+1024M<enter>
Command(m for help):n<enter>
e extend
p primary partition (1---4)
p<enter>
Partition number (1---4) :3<enter>
First cylinder (149---1868,default 149) :<enter>
Last cylinder or +size or +sizeM or +sizeK:+1024M<enter>
Command(m for help):n<enter>
e extend
p primary partition (1---4)
e<enter>
Partition number (1---4) :4<enter>
First cylinder (280---1868,default 280) :<enter>
Last cylinder or +size or +sizeM or +sizeK default 1868:<enter>#此处,将剩余空间全部#给extend
Command(m for help):n<enter>
First cylinder :<enter>
Last cylinder or +size or +sizeM or +sizeK:+2048M<enter>
Command(m for help):n<enter>
First cylinder :<enter>
Last cylinder or +size or +sizeM or +sizeK:+1024M<enter>
Command(m for help):n<enter>
First cylinder :<enter>
Last cylinder or +size or +sizeM or +sizeK:+xxxxM<enter> #此处,使用剩余空间的3/5
Command(m for help):n<enter>
First cylinder :<enter>
Last cylinder or +size or +sizeM or +sizeK:+xxxxM<enter> #此处,使用剩余空间的1/2
Command(m for help):n<enter>
First cylinder :<enter>
Last cylinder or +size or +sizeM or +sizeK:+xxxxM<enter> #此处,使用剩余全部空间
3) 改变分区ID:
Command(m for help):t<enter>
Partition number (1---9): 1<enter>
Hex code (type L to list codes):82<enter>
Command(m for help):t<enter>
Partition number (1---9): 4<enter>
Hex code (type L to list codes):85<enter>
Command(m for help):a<enter>
Partition number (1---9): 2<enter>
4)保存分区信息:
Command(m for help):w<enter>
点击Next
11. Partitions中,点击Edit,修改分区名称。修改结果如下:
Mount Point Device Requested Actual Type
<swap> hda1 133M 133M linux swap
/ * hda2 1027M 1027M linux native
/home hda3 2055M 2055M linux native
/usr hda4 1027M 1027M linux native
/var hda5 1027M 1027M linux native
/user1 hda6 5710M 5710M linux native
/user2 hda7 1882M 1882M linux native
/user3 hda8 1788M 1788M linux native
12. Choose Partitions to Format, 点击 Next;
13. Lilo Configuration, 点击 Next;
14. Network Configuration, 根据要求在各项中填写正确的IP,Netmask, Hostname, Gate way 与 Primary DNS 信息,例如:
(不选DHCP)
IP: 192.168.10.207
Netmask: 255.255.255.0
Hostname: dragon.qddico.com.cn
Gate way: 192.168.10.254
Primary DNS: 192.168.10.254
15. Fire Wall Configuration, 选择 No Fire Wall, 点击 Next;
16. Language Support Selection, 选择具体语言环境;
17. Time Zone Selection, 选择“shanghai (China coast )”;
18. Account Configuration,填写所需项目,例如:
Root Password: qingdao
Confirm Password: qingdao
点击 Next;
19. Authentication Configuration, 点击 Next;
20. Selecting Package Groups, 选择:
i. Anonymous FPT Server
ii. DNS Name Server
iii. Authoring / Publishing
iv. Emacs
v. Development
vi. Kernel Deverlopment
vii. Utilities
点击 Next;
21. About to Install, 点击 Next ( 期间,程序提示更换第二张光盘 );
22. Boot Disk Creation(制作启动盘), 根据要求选择
Skip boot disk creation (跳过启动盘制作)
23. Congratulations, installation is complete,点击 Exit.
24. 取出光盘,软盘。
25. Linux 7.1安装结束。
1-2-1)
添加一个标准用户:g-dico
# /usr/sbin/groupadd –g 700 dico
# /usr/sbin/useradd –g dico –u 700 –d /home/dico g-dico
# chmod 755 /home/dico
# passwd g-dico
New UNIX password: dico1234
Retype new UNIX password:dico1234
Passwd: all authentication tokens updated successfully,添加用户及密码设定成功
1-2-2) 密码设定后将其规整:
/usr/sbin/pwconv
/usr/sbin/grpconv
# su g-dico
$ mkdir /home/dico/sysad
$ mkdir /home/dico/sysad/src
1-2-4) 建立原始目录:
# mkdir /usr/local/dico-bin
# chgrp dico /usr/local/dico-bin
# chmod 770 /usr/local/dico-bin
2-1) postgreSQL7.1.2
#groupadd –g 71 postgres
#useradd -d /home/postgres -g postgres -u 16 postgres
#/usr/bin/pwconv
#/usr/sbin/grpconv
#mkdir /home/postgres
#chown postgres.postgres
#mkdir /usr/local/pgsql
#chown postgres.postgres /usr/local/pgsql
# tar zxvf postgressql-7.1.2.tar.gz
# chown –R postgres.postgres postgresql-7.1.2
# cd postgressql-7.1.2
# su – postgres
$ ./configure - -enable-multibyte - - with-perl
$ make all
如果出现“all of PostgreSQL is successfully made. Ready to install.”执行,
$ make install
vi /home/postgres/.bash_profile
export PATH="$PATH":/usr/local/pgsql/bin
export POSTGRES_HOME=/usr/local/pgsql
export PGLIB=$POSTGRES_HOME/lib
export PGDATA=$POSTGRES_HOME/data
export MANPATH="$MANPATH":$POSTGRES_HOME/man
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH":"$PGLIB"
$ cd /home/psotgres
$ source .bash_progfile
$ initdb 初始化数据库
重新启动设定
$su – root
#vi /etc/rc.d/rc.local 在末尾添加:
#PostgreSQL
rm /tmp/.s.PGSQL.*
su – postgres –c “/usr/local/pgsql/bin/postmaster –S -i”
#sync:sync:sync:/sbin/reboot
测试postgresql:
# su – postgres
$cd /usr/local/src/postgres-7.1.2/src/test/regress
$ make all runtest
各个项目都有“ok”和“failed”的表示
如果只有几个“failed”的话没有什么问题
比如说) abstime .. failed
2-2)安装perl5
#su - postgres
$cd /usr/local/src/postgres-7.1.2/src/interface/perl5
$perl Makefile.PL
$make
$make test
$su – root
#cd /usr/local/src/postgres-7.1.2/src/interface/perl5
#make install
perl5安装完成。
3)apache install>
# cd /home/dico/sysad/src
# tar xzvf apache_1.3.19.tar.gz
# tar xvfz mod_ssl-2.8.3-1.3.19.tar.gz
# tar xzvf php-4.0.4.tar.gz
# tar xzvf php-4.0RC2_jstring-1.0.tar.gz
# tar xvfz openssl-0.9.5a.tar.gz
3-1) apache_1.3.19 + mod_ssl install
openssl的安装:
# cd openssl-0.9.5a
# ./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl/conf
# make
# make test
# make install
3-2)mod_ssl-2.8.3-1.3.19 动态安装的设定
# cd mod_ssl-2.8.3-1.3.19
# ./configure --with-apache=../apache_1.3.19
3-3)apache的安装
# cd ../apache_1.3.19
# SSL_BASE=/usr/local/openssl
# ./configure --enable-module=so --disable-rule=WANTHSREGEX --prefix=/usr/local/apache
--sysconfdir=/etc/httpd --logfiledir=/var/log/httpd --enable-shared=max --enable-module=ssl –datadir=/home/httpd
# cd src
# cp Configuration.apaci Configuration
# ./Configure
# cd ..
# make
***重要,没有TYPE=custom的话会造成密钥交换失败
# make certificate TYPE=custom
______________________________________________________________________
1. Country Name (2 letter code) [XY]:JP
2. State or Province Name (full name) [Snake Desert]:Tokyo
3. Locality Name (eg, city) [Snake Town]:Chiyoda-ku
4. Organization Name (eg, company) [Snake Oil, Ltd]:Digital Cosmos, Inc.
5. Organizational Unit Name (eg, section) [Certificate Authority]:Network Solution
6. Common Name (eg, CA name) [Snake Oil CA]:ds4test.qddico.com.cn
7. Email Address (eg, name@FQDN) [ca@snakeoil.dom]:root@ds4test.qddico.com.cn
8. Certificate Validity (days) [365]:365
______________________________________________________________________
STEP 3: Generating X.509 certificate for CA signed by itself [ca.crt]
Certificate Version (1 or 3) [3]:1
----------------------------------------------
1. Country Name (2 letter code) [XY]:JP
2. State or Province Name (full name) [Snake Desert]:Tokyo
3. Locality Name (eg, city) [Snake Town]:Chiyoda-ku
4. Organization Name (eg, company) [Snake Oil, Ltd]:Digital Cosmos, Inc.
5. Organizational Unit Name (eg, section) [Webserver Team]:ds4test.qddico.com.cn
6. Common Name (eg, FQDN) [www.snakeoil.dom]:ds4test.qddico.com.cn
7. Email Address (eg, name@fqdn) [www@snakeoil.dom]:root@ds4test.qddico.com.cn
8. Certificate Validity (days) [365]:365
______________________________________________________________________
STEP 6: Generating X.509 certificate signed by own CA [server.crt]
Certificate Version (1 or 3) [3]:1
Encrypt the private key now? [Y/n]: y
read RSA key
writing RSA key
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:dico1234
Fine, you're using an encrypted private key.dico1234
Encrypt the private key now? [Y/n]: y
read RSA key
writing RSA key
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:dico1234
Fine, you're using an encrypted private key.dico1234
_____________________________________________________________________
4> php-4.0.4 安装
4-1) php-4.0.4 install
# cd php-4.0.4
# ./configure --with-apxs=/usr/local/apache/bin/apxs
# make
# make install
# cp php.ini-dist /usr/local/lib/php.ini
# vi /etc/httpd/httpd.conf
将其中的:
# AddType application/x-httpd-php .php
# AddType application/x-httpd-php-source .phps
修改为:
AddType application/x-httpd-php .php .php3 .php4
AddType application/x-httpd-php-source .phps
# /etc/rc.d/init.d/httpd restart
# ./configure
# make
# make install
# ln -s /usr/local/apache/bin/apachectl /etc/rc.d/init.d/httpd
# /etc/rc.d/init.d/httpd restart
# cd ..
4-2> php4.0.4日文补丁安装 php-4.0RC2_jstring-1.0 install
# cd jstring/
# phpize
# ./configure --enable-jstring
# make
# make install
# cp /usr/local/lib/php/extensions/no-debug-non-zts-20001214/jstring.so /usr/local/lib/php/extensions/
# vi /usr/local/lib/php.ini
将:
extension_dir = ./
修改为:
extension_dir = /usr/local/lib/php/extensions
查找:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Dynamic Extensions ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
然后在:
; needs to go here. Specify the location of the extension with the extension_dir directive above.
这一行后面另起一行添加:
extension=jstring.so后,保存退出。
# /etc/rc.d/init.d/httpd restart ------------重新启动httpd,让设定生效;
***检验:
# /usr/local/bin/php -m
显示:
Zend Engine v1.0.4, Copyright (c) 1998-2000 Zend Technologies
[PHP Modules]
jstring
xml
standard
session
posix
pcre
mysql
[Zend Modules]
表示jstring模块安装正确
***做成一测试页面:
# vi /usr/local/apache/htdocs/test.php
-----------------------------
<HTML>
<TITLE>php test page</TITLE>
<BODY>
<?
phpinfo();
?>
</BODY>
</HTML>
-----------------------------
在IE打开此页面http://hostname/test.php将显示PHP安装设定的信息,说明php4安装成功
All install end
5)proftp安装>
$ cd /home/dico/sysad/src
$ tar xvfz proftpd-1.2.1.tar.gz
$ cd proftpd-1.2.1
$ ./configure
$ make
$ su
# make install
5-1)设定proftpd.conf文件
# vi /usr/local/etc/proftpd.conf
修改文件内容为如下方式
=======================================================
ServerName "ProFTPD Default Installation"
DeferWelcome on
ServerType inetd
DefaultServer on
DefaultRoot ~!admin
Systemlog /var/log/proftpd.log
ExtendedLog /var/log/proftpd.log ALL
<Limit LOGIN>
AllowGroup profuser
AllowUser ftp
DenyAll
</Limit>
Umask 022
MaxInstances 30
User nobody
Group nobody
<Directory /*>
AllowOverwrite on
</Directory>
<Anonymous ~ftp>
User ftp
Group ftp
RequireValidShell off
UserAlias anonymous ftp
MaxClients 10
DisplayLogin welcome.msg
DisplayFirstChdir .message
<Limit WRITE>
DenyAll
</Limit>
</Anonymous>
=======================================================
5-2) 进行proftp用户管理设定,添加一个允许组内用户ftp的组
# /usr/sbin/groupadd -g 777 profuser
5-3) ftplog设定
# cd /etc/logrotate.d/
# cp ftpd proftpd
# vi proftpd
5-4) 修改proftp ftplog控制文件为如下
====================================================
/var/log/proftpd.log {
# ftpd doesn't handle SIGHUP properly
nocompress
}
====================================================
5-5) 用proftp程序替换wu-ftp程序
# cp /usr/local/sbin/in.proftpd /usr/sbin/
# cd /etc/xinetd.d/
# mv wu-ftp proftp
# vi proftp
5-6) 将守护进程配置文件改写成如下样式
===================================================
service ftp
{
socket_type = stream
wait = no
user = root
server = /usr/sbin/in.proftpd
server_args =
log_on_success += DURATION USERID
log_on_failure += USERID
nice = 10
disable = no
}
===================================================
5-7) 启动proftp
# /etc/rc.d/init.d/xinetd stop
# /etc/rc.d/init.d/xinetd start
# vi /etc/group
在profuser:x:777: 行加入希望给予ftp权限的用户,用户名之间用,分隔。
7)cdb-0.75 install)
$ cd /home/dico/sysad/src
$ gzip -dc cdb-0.75.tar.gz | tar xvf -
$ cd /home/dico/sysad/src/cdb-0.75
$ make
# su
# cp cdbget /usr/local/bin
# cp cdbmake /usr/local/bin
# cp cdbdump /usr/local/bin
# cp cdbstats /usr/local/bin
# cp cdbtest /usr/local/bin
8) tcpserver Install>
$ cd /home/dico/sysad/src
$ gzip -dc ucspi-tcp-0.88.tar.gz | tar xvf -
$ cd /home/dico/sysad/src/ucspi-tcp-0.88
$ make
$ su
# make setup check
# exit