📄 113.html
字号:
6、chmod go-w / /etc /etc/mail /usr /var /var/spool<br>
/var/spool/mqueue<br>
<br>
7、chown root / /etc /etc/mail /usr /var /var/spool<br>
/var/spool/mqueue<br>
<br>
8、cd /usr/local/src/sendmail-8.12.2/sendmail<br>
<br>
9、sh Build<br>
<br>
10、cd /usr/local/src/sendmail-8.12.2/cf/cf<br>
<br>
11、建立文件sendmail.mc内容如下,你可根据需要修改相应部分。<br>
<br>
<br>
divert(-1)<br>
dnl This is the macro config file used to generate the<br>
/etc/sendmail.cf<br>
dnl file. If you modify thei file you will have to regenerate the<br>
dnl /etc/sendmail.cf by running this macro config through the m4<br>
dnl preprocessor:<br>
dnl m4 /etc/sendmail.mc > /etc/sendmail.cf<br>
dnl You will need to have the Sendmail-cf pacage installed for<br>
this to work.<br>
include(`/usr/local/src/sendmail-8.12.2/cf')<br>
define(`confDEF_USER_ID',`8:12')<br>
OSTYPE(`linux')<br>
undefine(`UUCP_RELAY')<br>
undefine(`BITNET_RELAY')<br>
define(`confTO_CONNECT', `1m')<br>
define(`confTRY_NULL_MX_LIST',true)<br>
define(`confDONT_PROBE_INTERFACES',true)<br>
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')<br>
define(`SMART_HOST',compaq.rd.xxx.com)<br>
<---这条用于(非HUB)缺省使用HUB发送邮件<br>
MASQUERADE_AS(`rd.xxx.com')<br>
<-------------------------<br>
FEATURE(`masquerade_entire_domain')<br>
<---这三条用于邮件地址伪装<br>
FEATURE(`masquerade_envelope')<br>
<-------------------------<br>
FEATURE(`smrsh',`/usr/sbin/smrsh')<br>
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')<br>
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')<br>
FEATURE(redirect)<br>
FEATURE(always_add_domain)<br>
FEATURE(use_cw_file)<br>
FEATURE(local_procmail)<br>
FEATURE(`access_db')<br>
FEATURE(`blacklist_recipients')<br>
FEATURE(`accept_unresolvable_domains')<br>
MAILER(smtp)<br>
MAILER(procmail)<br>
dnl We strongly recommend to comment this one out if you want to<br>
protect<br>
dnl yourself from spam. However, the laptop and users on computers<br>
that do<br>
dnl not hav 24x7 DNS do need this.<br>
dnl FEATURE(`relay_based_on_MX')<br>
<br>
12、sh Build install-cf<br>
<br>
13、groupadd smmsp<br>
<br>
14、useradd smmsp<br>
<br>
15、cd cd /usr/local/src/sendmail-8.12.2/sendmail<br>
<br>
16、sh Build install<br>
<br>
17、cd /usr/local/src/sendmail-8.12.2/makemap<br>
<br>
18、sh Build clean<br>
<br>
19、sh Build all<br>
<br>
20、sh Build install<br>
<br>
21、cd /usr/local/src/sendmail-8.12.2/<br>
<br>
22、在本域DNS主数据库文件中增加MX纪录:<br>
<br>
<br>
rd.xxx.com. IN MX 0 compaq<br>
<br>
注意修改相应部分。那个0是有几个邮件集中器的时候用于标记先后顺序的。<br>
当有好几个MX的时候,建议顺序写为10、20、30…<br>
<br>
23、在/etc/mail目录下创建access文件,内容类似如下:<br>
<br>
<br>
127.0.0.1 RELAY<br>
21.9.22 RELAY<br>
211.99.221.238 RELAY<br>
<br>
然后:makemap hash access.db < access<br>
<br>
24、创建文件/etc/mail/local-host-names,其内容为本机的拥有的域名信息<br>
。<br>
<br>
<br>
rd.xxx.com<br>
compaq.rd.xxx.com<br>
<br>
25、创建文件/etc/mail/aliases,内容类似:<br>
<br>
<br>
MAILER-DAEMON: postmaster<br>
postmaster: root<br>
bin: root<br>
daemon: root<br>
nobody: root<br>
<br>
运行newaliases创建数据库。<br>
<br>
创建别名文件的意义之一在于当邮件发往域中其他邮件服务器的用户而不是<br>
mail HUB用户的时候用。<br>
<br>
比如增加一条:<br>
<br>
<br>
atan: atan@fbsd<br>
<br>
则导致邮件发往mail HUB的时候自动转发到atan@fbsd.rd.xxx.com<br>
<br>
26、启动sendmail: /usr/sbin/sendmail -bd -q30m<br>
<br>
排错:如果有问题导致启动不了,大部分问题和DNS配置有关,可以使用<br>
nslookup检查DNS是否正常。挨个检查/etc/mail中的文件内容也是排错的好办法。<br>
另外,修改配置,不建议直接编辑sendmail.cf文件,建议使用m4宏编译工具,因<br>
为有些带有安全漏洞或过时的宏在编译的时候会有提示,这样以免造成相关安全问<br>
题。<br>
(3)安装DHCP服务器<br>
<br>
1、源程序下载地址是:ftp://ftp.isc.org/isc/dhcp/dhcp-3.0.tar.gz ,我<br>
们的版本是:dhcpd-3.0<br>
<br>
2、复制到:/usr/local/scr后解压:tar zxvf dhcp-3.0.tar.gz<br>
<br>
3、cd /usr/local/src/dhcp-3.0.tar.gz<br>
<br>
4、./configure<br>
<br>
5、make(如果不是第一次编译,先make clean)<br>
<br>
6、make install<br>
<br>
7、cp ./server/dhcpd.conf /etc<br>
<br>
8、编辑这个文件,看起来类似下面这样:(要更改的地方用粗体标出)<br>
<br>
<br>
# dhcpd.conf<br>
#<br>
# Sample configuration file for ISC dhcpd<br>
#<br>
<br>
# option definitions common to all supported networks...<br>
option domain-name "rd.xxx.com";<br>
option domain-name-servers compaq.rd.xxx.com;<br>
<br>
default-lease-time 86400;<br>
max-lease-time 172800;<br>
<br>
ddns-update-style ad-hoc;<br>
<br>
# If this DHCP server is the official DHCP server for the local<br>
# network, the authoritative directive should be uncommented.<br>
#authoritative;<br>
<br>
# Use this to send dhcp log messages to a different log file (you<br>
also<br>
# have to hack syslog.conf to complete the redirection).<br>
log-facility local7;<br>
<br>
# No service will be given on this subnet, but declaring it helps<br>
the<br>
# DHCP server to understand the network topology.<br>
<br>
# This is a very basic subnet declaration.<br>
<br>
subnet 21.9.22.0 netmask 255.255.255.224 {<br>
range 21.9.22.2 21.9.22.6;<br>
option routers 21.9.22.1;<br>
}<br>
<br>
# This declaration allows BOOTP clients to get dynamic addresses,<br>
# which we don't really recommend.<br>
<br>
#subnet 10.254.239.32 netmask 255.255.255.224 {<br>
# range dynamic-bootp 10.254.239.40 10.254.239.60;<br>
# option broadcast-address 10.254.239.31;<br>
# option routers rtr-239-32-1.example.org;<br>
#}<br>
<br>
# A slightly different configuration for an internal subnet.<br>
#subnet 10.5.5.0 netmask 255.255.255.224 {<br>
# range 10.5.5.26 10.5.5.30;<br>
# option domain-name-servers ns1.internal.example.org;<br>
# option domain-name "internal.example.org";<br>
# option routers 10.5.5.1;<br>
# option broadcast-address 10.5.5.31;<br>
# default-lease-time 600;<br>
# max-lease-time 7200;<br>
#}<br>
<br>
# Hosts which require special configuration options can be listed<br>
in<br>
# host statements. If no address is specified, the address will<br>
be<br>
<br>
# allocated dynamically (if possible), but the host-specific<br>
information<br>
# will still come from the host declaration.<br>
<br>
#host passacaglia {<br>
# hardware ethernet 0:0:c0:5d:bd:95;<br>
# filename "vmunix.passacaglia";<br>
# server-name "toccata.fugue.com";<br>
#}<br>
<br>
# Fixed IP addresses can also be specified for hosts. These<br>
addresses<br>
# should not also be listed as being available for dynamic<br>
assignment.<br>
# Hosts for which fixed IP addresses have been specified can boot<br>
using<br>
# BOOTP or DHCP. Hosts for which no fixed address is specified can<br>
only<br>
# be booted with DHCP, unless there is an address range on the<br>
subnet<br>
# to which a BOOTP client is connected which has the dynamic-bootp<br>
flag<br>
# set.<br>
<br>
#host fantasia {<br>
# hardware ethernet 08:00:07:26:c0:a5;<br>
# fixed-address fantasia.fugue.com;<br>
#}<br>
<br>
# You can declare a class of clients and then do address<br>
allocation<br>
# based on that. The example below shows a case where all<br>
clients<br>
# in a certain class get addresses on the 10.17.224/24 subnet, and<br>
all<br>
# other clients get addresses on the 10.0.29/24 subnet.<br>
<br>
#class "foo" {<br>
# match if substring (option vendor-class-identifier, 0, 4) =<br>
"SUNW";<br>
#}<br>
<br>
#shared-network 224-29 {<br>
# subnet 10.17.224.0 netmask 255.255.255.0 {<br>
# option routers rtr-224.example.org;<br>
# }<br>
# subnet 10.0.29.0 netmask 255.255.255.0 {<br>
# option routers rtr-29.example.org;<br>
# }<br>
# pool {<br>
# allow members of "foo";<br>
# range 10.17.224.10 10.17.224.250;<br>
# }<br>
# pool {<br>
# deny members of "foo";<br>
# range 10.0.29.10 10.0.29.230;<br>
# }<br>
<br>
上面这个文件中后面都是注释,是原来系统给你的配置做的例子,可以不要。<br>
当然除非你用到它们,并且清楚它们的含义。<br>
<br>
9、建立空文件:touch /var/state/dhcp/dhcpd.leases空文件<br>
<br>
10、检查内核编译选项:Networking options-----Packet socket:<br>
mmapped IO和Socket Filtering选项是否被选中(不知道怎么看?看看前面的文章<br>
,用make menuconfig呀),如果没有就需要重新编译内核了。<br>
<br>
11、route add -host 255.255.255.255 dev eth0<br>
<br>
12、roote add -host localhost dev eth0<br>
<br>
13、在/etc/rc.d/rc.local最后增加一行route add -host 255.255.255.<br>
255 dev eth0<br>
<br>
14、reboot系统<br>
<br>
15、用dhcpd命令启动DHCP,用其他的机器试试看能不能自动配置网络了。<br>
<br>
(4) 安装apache+mysql+php+gd+png+zlib+jpeg+freetype+sslmod<br>
<br>
这么一大堆东西为什么要一块说呢?因为他们中间是有紧密联系的,尤其是那<br>
个PHP,用到其他所有的模块。要想PHP功能全,只能一步步来了。<br>
<br>
1、首先安装MYSQL:从http://www.mysql.com/downloads/index.html下载自<br>
己觉得合适的版本。这里用3.23.42版本。<br>
<br>
2、进入目录/usr/local/src(这个以后就不用说了吧?)解压缩:tar zxvf<br>
mysql-3.23.42.tar.gz<br>
<br>
3、cd mysql-3.23.42/<br>
<br>
4、configure --prefix=/usr/local/mysql<br>
<br>
5、make<br>
<br>
6、make install<br>
<br>
7、useradd mysql ; groupadd mysql ; su mysql ;(建立命名为mysql的用户<br>
和组,并切换为mysql身份)<br>
<br>
8、scripts/mysql_install_db (建立数据库结构)<br>
<br>
9、cd /usr/local/mysql/bin<br>
<br>
10、./safe_mysqld & (启动了)<br>
<br>
11、./mysqladmin -u root password "new-password"(你的新密码,记住<br>
MYSQL的密码核系统密码是独立的,缺省是没有密码)<br>
<br>
12、用mysql程序试试看。<br>
<br>
下面的步骤都很程式化,我尽量简洁地写出。<br>
<br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -