⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 1339.html

📁 著名的linux英雄站点的文档打包
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<br>
1.3 使用的软件<br>
  构建该系统需要以下的软件包: Apache 1.3.6 或以上版本http://www.apache.org/ PHP 3.0.12 需要将对IMAP和LDAP的支持编译进来 OpenLDAP 1.2 Cyrus 1.5.19 (注:不要使用1.6) postfix 19990627 pwcheck_ldap patch (针对cyrus 1.5的) IMP (2.0.4, 2.0.10, 和2.1.3-dev进行了测试) UW IMAP (针对 c-client) 注:cyrus 1.6树使用了一种不同的,被称作SASL的鉴别方法,pwcheck_ldap补丁不是针对这种鉴别方法设计的。然而,对SASL的LDAP的补丁正在设计中,你可以参观该主页来获得最新信息。<br>
<br>
1.4 特别注释<br>
  该系统有一个部分的可伸缩性不是很好:IMP使用的用来保存会话数据,参数,及地址簿的SQL服务器。<br>
<br>
2. 安装软件 2.1 Web服务器的安装<br>
  在web服务器上,管理员需要安装下列软件包:Apache, PHP, postfix, OpenLDAP, UW IMAP, 及IMP. 安装Apache和PHP是很容易的,具体步骤在PHP软件包中的安装导引有详细的说明。在安装PHP时,你需要将对LDAP和IMAP的支持编译进来。 安装postfix可以参考随软件包的安装指南,特别要注意文件LDAP_README。<br>
<br>
2.2 LDAP服务器的安装<br>
   需要安装OpenLDAP软件来构建LDAP服务器。你需要决定一个root dn并相应地向LDAP的db中加入设置。<br>
<br>
2.3 IMAP服务器的安装<br>
   在IMAP服务器上,你将需要安装LDAP, postfix, Cyrus及cyrus的pwcheck_ldap补丁。编译postfix时需要有加入对ldap的支持。根据软件安装文档安装Cyrus,但是需要根据pwcheck_ldap补丁的文档对pwcheck_ldap.c进行修改。另外需要修改pwcheck_ldap.c来提供ldap服务器及根dn信息;同样若在linux服务器上运行IMAP服务器,则需要在在文件pwcheck_ldap.c作如下修正: 增加行: #include &lt;linux/stddef.h&gt; 另外还需要做一些别的语法修改,具体可以在编译是发现。 使用下面的命令配置cyrus:<br>
<br>
./configure --with-login=unix_pwcheck --with-pwcheck=ldap<br>
<br>
后面的编译及安装则根据cyrus的文档;<br>
<br>
3. 如何配置服务器协同工作 3.1 LDAP服务器的配置<br>
   每个在LDAP数据库中的邮件用户信息除了其他的希望提供的信息以外需要有下面的内容:(假设你的根dn是o=someorg, c=US):<br>
<br>
dn: uid=someuser, o=someorg, c=us<br>
uid: someuser<br>
userpassword: somepassword<br>
maildrop: fulladdress@machine.dom.ain<br>
mailacceptinggeneralid: someuser<br>
mailacceptinggeneralid: somealias<br>
<br>
   同样,需要选择一个用户拥有cyrus管理权限。只有需要在imap服务器上配置cyrus时,才会需要考虑管理问题。另外,最好不要给一个已经存在的用户添加管理权限,这样做可能导致安全问题或者导致该用户不能查看自己的信件的问题。<br>
<br>
3.2 imap服务器的配置<br>
  配置在IMAP服务器上的postfix使用ldap来进行别名匹配。在文档LDAP_README对这个问题进行了说明。对于Cyrus,按照软件包的安装说明文件进行即可。同样,不要忘记激活pwcheck并在imap.conf中增添管理用户。<br>
<br>
3.3 web服务器<br>
   在这一步的设置中,web服务器同样是作为接收邮件网关的前端。配置postfix来使用ldap进行别名匹配。从而实现检查LDAP的maildrop表项并转发该邮件到maildrop地址,所以在maildrop中需要全邮件名。 例如,你可以将700,000个用户分配到各个服务器上,平均每台服务器10000个用户。邮件目的地址是user1@dom.ain的邮件将接入到某台WEB服务器,而该邮件将根据maildrop属性被转发到地址,而发网user657的邮件将被转发给user657@mail34。而且,maildrop属性同时可以被用作转发地址,如给user302的信件被转发给someuser@somewhereelse.com"&gt;<br>
<br>
   例如,你可以将700,000个用户分配到各个服务器上,平均每台服务器10000个用户。邮件目的地址是user1@dom.ain的邮件将接入到某台WEB服务器,而该邮件将根据maildrop属性被转发到地址,而发网user657的邮件将被转发给user657@mail34。而且,maildrop属性同时可以被用作转发地址,如给user302的信件被转发给someuser@somewhereelse.com。<br>
<br>
   对IMP的培配置一般将根据软件文档,配置结束以后,需要做如下修改: 在config/defaults.php3增添如下内容:<br>
<br>
 <br>
<br>
/* LDAP/IMAP Server Default */ $default-&gt;LDAP_server = 'ldap.dom.ain'; $default-&gt;LDAP_dn = 'o=someorg,c=US'; $default-&gt;LDAP_search_field = 'uid'; $default-&gt;ldap_choose_server = true;<br>
to mailbox.php3 apply the following patch:<br>
<br>
Index: mailbox.php3 =================================================================== RCS file: /home/cvs/imp/mailbox.php3,v retrieving revision 2.29 diff -c -r2.29 mailbox.php3 *** mailbox.php3 1999/07/29 07:20:00 2.29 --- mailbox.php3 1999/08/04 18:04:10 *************** *** 29,34 **** --- 29,51 ---- require './lib/mimetypes.lib'; require './config/defaults.php3'; + /************LDAP**************/ + + if ($default-&gt;ldap_choose_server) { + $ldapconnect = ldap_connect($default-&gt;LDAP_server); + if ($ldapconnect) { + print("YES! "); + $ldapbind = ldap_bind($ldapconnect); + $ldapsearch = ldap_search($ldapconnect, $default-&gt;LDAP_dn, $default-&gt;LDAP_search_field."=".$imapuser, array("maildrop")); + $ldapget = ldap_get_entries($ldapconnect, $ldapsearch); + $ldapspl = explode("@", $ldapget[0]["maildrop"][0]); + $server = $ldapspl[1]; + $port = $default-&gt;port; + } + } + /**********end ldap************/ + + /* Html styles configuration */ require './config/html.php3'; /* Mailbox configuration */ 全部配置结束以后,将具有一个高可扩展性的web邮件系统。<br>
注:1999年8月,IMP的新版本已经包含了这些补丁的内容,所以如果使用新版本的话,就不需添加这些内容。<br>
<br>
4. Miscellaneous 4.1 Adding Users<br>
<br>
这里是一小段向LDAP服务器中增添用户的代码,并且同时向cyrus增添一个邮件用户。这是针对IMAP服务器设计的,但是你可以修改其适应别的环境。<br>
<br>
&lt;?php<br>
$ldapconn = ldap_connect("ldap.dom.ain");<br>
$machine = "mail01";<br>
if ($ldapconn)<br>
{<br>
$ldhb = ldap_bind($ldapconn, "cn=cyrusadmin, o=someorg,c=US","password");<br>
$dn = "uid=". $username .", o=someorg, c=US";<br>
$info["uid"]=$username;<br>
$info["userpassword"] = $password;<br>
$info["objectclass"] = "account";<br>
$info["maildrop"] = $username ."@" .$machine .".dom.ain";<br>
$info["mailacceptinggeneralid"] = $username;<br>
$ldhb = ldap_add($ldapconn, $dn, $info);<br>
ldap_close($ldapconn);<br>
}<br>
$imapconn = imap_open("{" .$machine .".dom.ain:143}", "cyrusadmin","password");<br>
if ($imapopen)<br>
{<br>
imap_createmailbox($imapconn, "{" .$machine ."dom.ain:143}user.".$username );<br>
imap_close($imapconn);<br>
}<br>
?&gt;<br>
<br>
注:由于一个bug的问题,这里使用明文password。<br>
</FONT><br>
                                      </TD>
                                    </TR>
                                <TR>
                                <TD colSpan=2><FONT 
                                class=middlefont></FONT><BR>
                                        <FONT 
                                class=normalfont>全文结束</FONT> </TD>
                                    </TR>
                                <TR>
                                <TD background="images/dot.gif" tppabs="http://www.linuxhero.com/docs/images/dot.gif" colSpan=2 
                                height=10></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></DIV></TD>
                        <TD vAlign=top width="20%" 
                      background="images/line.gif" tppabs="http://www.linuxhero.com/docs/images/line.gif" rowSpan=2> 
                          <DIV align=center> 
                            <table class=tableoutline cellspacing=1 cellpadding=4 
                        width="100%" align=center border=0>
                              <tr class=firstalt> 
                                <td noWrap background="images/bgline.gif" tppabs="http://www.linuxhero.com/docs/images/bgline.gif" colspan=2 height=21>
                                <font class=normalfont><b>所有分类</b></font></td>
                              </tr>
<tr class=secondalt> <td noWrap width=27%> <font class=normalfont>1:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type1.html" tppabs="http://www.linuxhero.com/docs/type1.html">非技术类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>2:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type2.html" tppabs="http://www.linuxhero.com/docs/type2.html">基础知识</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>3:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type3.html" tppabs="http://www.linuxhero.com/docs/type3.html">指令大全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>4:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type4.html" tppabs="http://www.linuxhero.com/docs/type4.html">shell</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>5:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type5.html" tppabs="http://www.linuxhero.com/docs/type5.html">安装启动</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>6:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type6.html" tppabs="http://www.linuxhero.com/docs/type6.html">xwindow</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>7:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type7.html" tppabs="http://www.linuxhero.com/docs/type7.html">kde</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>8:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type8.html" tppabs="http://www.linuxhero.com/docs/type8.html">gnome</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>9:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type9.html" tppabs="http://www.linuxhero.com/docs/type9.html">输入法类</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>10:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type10.html" tppabs="http://www.linuxhero.com/docs/type10.html">美化汉化</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>11:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type11.html" tppabs="http://www.linuxhero.com/docs/type11.html">网络配置</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>12:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type12.html" tppabs="http://www.linuxhero.com/docs/type12.html">存储备份</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>13:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type13.html" tppabs="http://www.linuxhero.com/docs/type13.html">杂项工具</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>14:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type14.html" tppabs="http://www.linuxhero.com/docs/type14.html">编程技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>15:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type15.html" tppabs="http://www.linuxhero.com/docs/type15.html">网络安全</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>16:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type16.html" tppabs="http://www.linuxhero.com/docs/type16.html">内核技术</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>17:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type17.html" tppabs="http://www.linuxhero.com/docs/type17.html">速度优化</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>18:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type18.html" tppabs="http://www.linuxhero.com/docs/type18.html">apache</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>19:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type19.html" tppabs="http://www.linuxhero.com/docs/type19.html">email</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>20:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type20.html" tppabs="http://www.linuxhero.com/docs/type20.html">ftp服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>21:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type21.html" tppabs="http://www.linuxhero.com/docs/type21.html">cvs服务</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>22:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type22.html" tppabs="http://www.linuxhero.com/docs/type22.html">代理服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>23:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type23.html" tppabs="http://www.linuxhero.com/docs/type23.html">samba</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>24:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type24.html" tppabs="http://www.linuxhero.com/docs/type24.html">域名服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>25:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type25.html" tppabs="http://www.linuxhero.com/docs/type25.html">网络过滤</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>26:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type26.html" tppabs="http://www.linuxhero.com/docs/type26.html">其他服务</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>27:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type27.html" tppabs="http://www.linuxhero.com/docs/type27.html">nfs</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>28:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type28.html" tppabs="http://www.linuxhero.com/docs/type28.html">oracle</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>29:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type29.html" tppabs="http://www.linuxhero.com/docs/type29.html">dhcp</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>30:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type30.html" tppabs="http://www.linuxhero.com/docs/type30.html">mysql</a></font></td>    </tr>  </table></td></tr><tr class=secondalt> <td noWrap width=27%> <font class=normalfont>31:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type31.html" tppabs="http://www.linuxhero.com/docs/type31.html">php</a></font></td>    </tr>  </table></td></tr><tr class=firstalt> <td noWrap width=27%> <font class=normalfont>32:</font> </td><td noWrap width=73%>   <table width=100% border=0>    <tr>       <td><font class=normalfont><a href="type32.html" tppabs="http://www.linuxhero.com/docs/type32.html">ldap</a></font></td>    </tr>  </table></td></tr>                            </table>
                          </DIV></TD></TR>
                    <TR vAlign=top>
                        <TD width="80%"> 
                          <DIV align=center><BR>
                          </DIV>
                        </TD></TR></TBODY></TABLE></TD></TR>
                </TABLE></TD></TR>
          </TABLE>
      <TABLE cellSpacing=0 cellPadding=4 width="100%" bgColor=#eeeeee 
        border=0><TBODY>
        <TR>
          <TD width="50%">
              <P><FONT class=middlefont>版权所有 &copy; 2004 <A 
            href="mailto:bjchenxu@sina.com">linux知识宝库</A><BR>
                违者必究. </FONT></P>
            </TD>
          <TD width="50%">
              <DIV align=right><FONT class=middlefont>Powered by: <A 
            href="mailto:bjchenxu@sina.com">Linux知识宝库</A> Version 0.9.0 </FONT></DIV>
            </TD></TR></TBODY></TABLE>
      <CENTER></CENTER></TD></TR>
    </TABLE></CENTER></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -