查看完整版本: [轉貼]Ubuntu Server 8.10下安装ispconfig 3教程

chun 2009-11-18 20:00

[轉貼]Ubuntu Server 8.10下安装ispconfig 3教程

http://www.ispcpcn.com/article/23/<br><br><h1 class="post-title">Ubuntu Server 8.10下安装ispconfig 3教程</h1>

                                <p>ISPConfig
是Linux的一款开源的虚拟主机管理程序,带Web控制面板,可通过Web控制面板管理虚拟主机、开设网站、开设邮箱、开设和管理mysql数据库、支
持DNS解析和监控服务器运行状况等功能。下面我们将讲解如何在Ubuntu Server 8.10中安装ISPConfig3。 <br>
<strong><span style="color: rgb(0, 0, 255);">1、Ubuntu Server 8.10的安装</span></strong><br>
这里,我们的安装设置是:<br>
IP地址:192.168.0.100<br>
子网掩码:255.255.255.0<br>
网关:192.168.0.1<br>
DNS服务器:61.128.192.68 61.128.128.68<br>
服务器主机名:server.ispcpcn.com<br>
详细的安装请参照本站<a title="Permanent Link to Ubuntu Server 8.10的安装" rel="bookmark" href="http://www.ispcpcn.com/article/4/"><font color="#5371c5">Ubuntu Server 8.10的安装</font></a><br>
<strong><span style="color: rgb(0, 0, 255);">2、开启并使用root用户</span><br>
</strong>在重启之后,我们将使用root用户按照本文章的步骤来完成安装,这样,我们就不必每次运行命令都要加个“sudo”了!而且某些步骤使用“sudo”来执行也是个麻烦的事情。我们先获得root权限<br>
</p><table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">ispcpcn@server:~$ sudo su</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后设置root的密码
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">ispcpcn@server:~$ passwd root</span></p>
            </td>
        </tr>
    </tbody>
</table>
输入两次密码后root的密码就设定了,退出然后再用root登陆就可以了。 <br>
<strong><span style="color: rgb(0, 0, 255);">3、安装SSH Server 如果您已经安装了SSH Server,请忽略这一步。</span></strong><span style="color: rgb(0, 0, 255);"> </span>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# apt-get install ssh openssh-server</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">4、安装vim-nox,如果您还是习惯用nano编辑器,这一步可以忽略</span></strong><br>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# apt-get install vim-nox</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">5、设置主机名 </span></strong>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/hosts</span></p>
            </td>
        </tr>
    </tbody>
</table>
编辑后的内容如下:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">127.0.0.1 localhost<br>
            192.168.0.100 server.ispcpcn.com server</span></p>
            <p><span style="color: rgb(255, 255, 255);"># The following lines are desirable for IPv6 capable hosts<br>
            ::1 localhost ip6-localhost ip6-loopback<br>
            fe00::0 ip6-localnet<br>
            ff00::0 ip6-mcastprefix<br>
            ff02::1 ip6-allnodes<br>
            ff02::2 ip6-allrouters<br>
            ff02::3 ip6-allhosts</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后运行下面的命令:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# echo server.ispcpcn.com &gt; /etc/hostname<br>
            root@server:~# /etc/init.d/hostname.sh start</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后运行
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# hostname<br>
            root@server:~# hostname -f</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后显示的结果都应该是server.ispcpcn.com。<br>
<strong><span style="color: rgb(0, 0, 255);">6、更新系统到最新。</span></strong><br>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# aptitude update &amp;&amp; aptitude safe-upgrade</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">7、重启服务器。 </span></strong>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# reboot</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">8、修改默认的Shell</span><br>
</strong>/bin/sh是/bin/dash的连接,然而我们需要/bin/bash而不是/bin/dash,所以我们运行如下命令:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# ln -sf /bin/bash /bin/sh</span></p>
            </td>
        </tr>
    </tbody>
</table>
如果您不执行本操作,后续安装将失败。<br>
<strong><span style="color: rgb(0, 0, 255);">9、禁止AppArmor </span></strong>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# /etc/init.d/apparmor stop<br>
            root@server:~# update-rc.d -f apparmor remove<br>
            root@server:~# aptitude remove apparmor apparmor-utils</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">10、校正系统时间</span></strong><br>
使用NTP矫正服务器的系统时间是一个好习惯,他可以保持您的服务器时间的正确性。
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# aptitude install ntp ntpdate</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">11、安装Postfix,Courier,Saslauthd,MySQL,phpmyadmin,rkhunter,binutils </span></strong>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~#
aptitude install postfix postfix-mysql postfix-doc mysql-client
mysql-server courier-authdaemon courier-authlib-mysql courier-pop
courier-pop-ssl courier-imap courier-imap-ssl libsasl2-2
libsasl2-modules libsasl2-modules-sql sasl2-bin libpam-mysql openssl
maildrop getmail4 rkhunter binutils</span></p>
            </td>
        </tr>
    </tbody>
</table>
我们可能需要回答以下问题:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">New password for the MySQL "root" user: &lt;-- 你的MySQL的root用户的密码<br>
            Repeat password for the MySQL "root" user: &lt;-- 重复输入root的用户密码<br>
            Create directories for web-based administration? &lt;-- No<br>
            General type of mail configuration: &lt;-- Internet Site<br>
            System mail name: &lt;-- server.ispcpcn.com<br>
            SSL certificate required &lt;-- Ok </span></p>
            </td>
        </tr>
    </tbody>
</table>
如果我们想让MySQL能服务所有的网络,而不仅仅是本地,那么,我们要编辑/etc/mysql/my.cnf使用#把bind-address=127.0.0.1给禁止了。编辑/etc/mysql/my.cnf
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/mysql/my.cnf</span></p>
            </td>
        </tr>
    </tbody>
</table>
编辑部分的内容如下:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">[...]<br>
            # Instead of skip-networking the default is now to listen only on<br>
            # localhost which is more compatible and is not less secure.<br>
            #bind-address = 127.0.0.1<br>
            [...]</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后我们重启MySQL服务
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# /etc/init.d/mysql restart</span></p>
            </td>
        </tr>
    </tbody>
</table>
在安装期间,IMAP-SSL和POP3-SSL将使用localhost这个主机名建立两个证书,我们要把他改成正确的主机名(在这里是server.ispcpcn.com),删除证书文件:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# cd /etc/courier<br>
            root@server:~# rm -f /etc/courier/imapd.pem<br>
            root@server:~# rm -f /etc/courier/pop3d.pem</span></p>
            </td>
        </tr>
    </tbody>
</table>
接下来我们要编辑两个文件,用CN=server.ispcpcn.com替换文件中的CN=localhost
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/courier/imapd.cnf</span></p>
            </td>
        </tr>
    </tbody>
</table>
编辑的内容如下:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">[...]<br>
            CN=server.ispcpcn.com<br>
            [...]</span></p>
            </td>
        </tr>
    </tbody>
</table>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/courier/pop3d.cnf</span></p>
            </td>
        </tr>
    </tbody>
</table>
编辑的内容如下:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">[...]<br>
            CN=server.ispcpcn.com<br>
            [...]</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后重新生成新的证书文件
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# mkimapdcert<br>
            root@server:~# mkpop3dcert</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后重启Courier-IMAP-SSL和Courier-POP3-SSL:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# /etc/init.d/courier-imap-ssl restart<br>
            root@server:~# /etc/init.d/courier-pop-ssl restart</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">12、安装Amavisd-new、SpamAssassin和Clamav</span></strong><br>
运行下面命令安装Amavisd-new、SpamAssassin和Clamav:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~#
aptitude install amavisd-new spamassassin clamav clamav-daemon zoo
unzip bzip2 arj nomarch lzop cabextract apt-listchanges
libnet-ldap-perl libauthen-sasl-perl clamav-docs daemon
libio-string-perl libio-socket-ssl-perl libnet-ident-perl zip
libnet-dns-perl</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">13、安装Apache2、PHP5、phpMyAdmin、FCGI、suExec、Pear和mcrypt </span></strong>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~#
aptitude install apache2 apache2.2-common apache2-doc
apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
libapache2-mod-php5 php5 php5-common php5-gd php5-mysql php5-imap
phpmyadmin php5-cli php5-cgi libapache2-mod-fcgid apache2-suexec
php-pear php-auth php5-mcrypt mcrypt php5-imagick imagemagick
libapache2-mod-suphp</span></p>
            </td>
        </tr>
    </tbody>
</table>
在安装的过程中,我们要回答以下问题:<br>
Web server to reconfigure automatically: &lt;-- apache2<br>
为了能提供更安全的PHP,我们要升级PHP到5.2.9版。<br>
编辑/etc/apt/sources.list
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/apt/sources.list</span></p>
            </td>
        </tr>
    </tbody>
</table>
在最下面一行添加以下内容:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">deb http://packages.dotdeb.org/ oldstable all</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后升级安装5.2.9版的PHP
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# apt-get update<br>
            root@server:~# apt-get install php-cli<br>
            root@server:~# apt-get upgrade</span></p>
            </td>
        </tr>
    </tbody>
</table>
升级的过程中,会提示要修改/etc/mysql/my.cnf,这个时候请输入“y”,等安装完成后,按照上文11步的要求重新编辑/etc
/mysql/my.cnf。然后我们运行下面命令启用Apache的suexec,rewrite,ssl,actions和include的模块:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# a2enmod suexec rewrite ssl actions include</span></p>
            </td>
        </tr>
    </tbody>
</table>
为了安全,我们注释掉phpmyadmin中的/etc/phpmyadmin/apache.conf文件的部分内容。<br>
编辑/etc/phpmyadmin/apache.conf
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/phpmyadmin/apache.conf</span></p>
            </td>
        </tr>
    </tbody>
</table>
注释掉的部分如下:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">[...]<br>
            # # Authorize for setup<br>
            # &lt;Files setup.php&gt;<br>
            # # For Apache 1.3 and 2.0<br>
            # &lt;IfModule mod_auth.c&gt;<br>
            # AuthType Basic<br>
            # AuthName "phpMyAdmin Setup"<br>
            # AuthUserFile /etc/phpmyadmin/htpasswd.setup<br>
            # &lt;/IfModule&gt;<br>
            # # For Apache 2.2<br>
            # &lt;IfModule mod_authn_file.c&gt;<br>
            # AuthType Basic<br>
            # AuthName "phpMyAdmin Setup"<br>
            # AuthUserFile /etc/phpmyadmin/htpasswd.setup<br>
            # &lt;/IfModule&gt;<br>
            # Require valid-user<br>
            # &lt;/Files&gt;<br>
            [...]</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后重启Apache:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# /etc/init.d/apache2 restart</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">14、安装PureFTPd和Quota 运行如下命令安装PureFTPd和Quota:</span></strong>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# aptitude install pure-ftpd-common pure-ftpd-mysql quota quotatool</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后编辑文件/etc/default/pure-ftpd-common
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/default/pure-ftpd-common</span></p>
            </td>
        </tr>
    </tbody>
</table>
我们要确保启动模式是standalone,VIRTUALCHROOT=true:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">[...]<br>
            STANDALONE_OR_INETD=standalone<br>
            [...]<br>
            VIRTUALCHROOT=true<br>
            [...]</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后重启PureFTPd
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# /etc/init.d/pure-ftpd-mysql restart</span></p>
            </td>
        </tr>
    </tbody>
</table>
编辑/etc/fstab,添加“ ,usrquota,grpquota到分区加载点 /”,编辑内容如下:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/fstab</span></p>
            </td>
        </tr>
    </tbody>
</table>
编辑后的内容如下(注意本文中可能出现换行,在实际的情况中那个换行是不存在的:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);"># /etc/fstab: static file system information.<br>
            #<br>
            # &lt;file system&gt; &lt;mount point&gt; &lt;type&gt; &lt;options&gt; &lt;dump&gt; &lt;pass&gt;<br>
            proc /proc proc defaults 0 0<br>
            # /dev/sda1<br>
            UUID=e7f9e640-1254-462f-b314-6471ce83db4d / ext3 relatime,errors=remount-ro,usrquota,grpquota 0 1<br>
            # /dev/sda5<br>
            UUID=32b41e4e-4d4a-4825-8922-27e8c6aeeb45 none swap sw 0 0<br>
            /dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0 </span></p>
            </td>
        </tr>
    </tbody>
</table>
运行如下命令,去启用quota:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# touch /quota.user /quota.group<br>
            root@server:~# chmod 600 /quota.*<br>
            root@server:~# mount -o remount /<br>
            root@server:~# quotacheck -avugm<br>
            root@server:~# quotaon -avug</span></p>
            </td>
        </tr>
    </tbody>
</table>
<span style="color: rgb(0, 0, 255);"><strong>15、安装MyDNS</strong></span><br>
在安装MyDNS前,我们安装一些MyDNS的依赖包:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# aptitude install g++ libc6 gcc gawk make texinfo libmysqlclient15-dev</span></p>
            </td>
        </tr>
    </tbody>
</table>
MyDNS没有包含在Ubuntu 8.10的更新源中,所以我们必须去自己编译:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# cd /tmp<br>
            root@server:~# wget http://heanet.dl.sourceforge.net/sourceforge/mydns-ng/mydns-1.2.8.27.tar.gz<br>
            root@server:~# tar xvfz mydns-1.2.8.27.tar.gz<br>
            root@server:~# cd mydns-1.2.8<br>
            root@server:~# ./configure<br>
            root@server:~# make<br>
            root@server:~# make install</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后我们来创建MyDNS的启动脚本:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# vi /etc/init.d/mydns</span></p>
            </td>
        </tr>
    </tbody>
</table>
启动脚本如下:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">#! /bin/sh<br>
            #<br>
            # mydns Start the MyDNS server<br>
            #<br>
            # Author: Philipp Kern &lt;phil@philkern.de&gt;.<br>
            # Based upon skeleton 1.9.4 by Miquel van Smoorenburg<br>
            # &lt;miquels@cistron.nl&gt; and Ian Murdock &lt;imurdock@gnu.ai.mit.edu&gt;.<br>
            #</span></p>
            <p><span style="color: rgb(255, 255, 255);">set -e</span></p>
            <p><span style="color: rgb(255, 255, 255);">PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin<br>
            DAEMON=/usr/local/sbin/mydns<br>
            NAME=mydns<br>
            DESC="DNS server"</span></p>
            <p><span style="color: rgb(255, 255, 255);">SCRIPTNAME=/etc/init.d/$NAME</span></p>
            <p><span style="color: rgb(255, 255, 255);"># Gracefully exit if the package has been removed.<br>
            test -x $DAEMON || exit 0</span></p>
            <p><span style="color: rgb(255, 255, 255);">case "$1" in<br>
            start)<br>
            echo -n "Starting $DESC: $NAME"<br>
            start-stop-daemon --start --quiet \<br>
            --exec $DAEMON -- -b<br>
            echo "."<br>
            ;;<br>
            stop)<br>
            echo -n "Stopping $DESC: $NAME"<br>
            start-stop-daemon --stop --oknodo --quiet \<br>
            --exec $DAEMON<br>
            echo "."<br>
            ;;<br>
            reload|force-reload)<br>
            echo -n "Reloading $DESC configuration..."<br>
            start-stop-daemon --stop --signal HUP --quiet \<br>
            --exec $DAEMON<br>
            echo "done."<br>
            ;;<br>
            restart)<br>
            echo -n "Restarting $DESC: $NAME"<br>
            start-stop-daemon --stop --quiet --oknodo \<br>
            --exec $DAEMON<br>
            sleep 1<br>
            start-stop-daemon --start --quiet \<br>
            --exec $DAEMON -- -b<br>
            echo "."<br>
            ;;<br>
            *)<br>
            echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" &gt;&amp;2<br>
            exit 1<br>
            ;;<br>
            esac</span></p>
            <p><span style="color: rgb(255, 255, 255);">exit 0</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后我们给这个脚本可执行权限,并且建立系统启动连接:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# chmod +x /etc/init.d/mydns<br>
            root@server:~# update-rc.d mydns defaults</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">16、安装Vlogger和Webalizer </span></strong>
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# aptitude install vlogger webalizer</span></p>
            </td>
        </tr>
    </tbody>
</table>
<span style="color: rgb(0, 0, 255);"><strong>17、安装Jailkit</strong></span><br>
Jailkiet仅仅当你使用chroot SSH用户的时候才需要Jailkit(必须在安装ISPConfig之前安装Jailkit),使用如下命令行安装:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# aptitude install build-essential autoconf automake1.9 libtool flex bison<br>
            root@server:~# cd /tmp<br>
            root@server:~# wget http://olivier.sessink.nl/jailkit/jailkit-2.5.tar.gz<br>
            root@server:~# tar xvfz jailkit-2.5.tar.gz<br>
            root@server:~# cd jailkit-2.5<br>
            root@server:~# ./configure<br>
            root@server:~# make<br>
            root@server:~# make install<br>
            root@server:~# cd ..<br>
            root@server:~# rm -rf jailkit-2.5*</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">18、安装fail2ban</span></strong><br>
这是可选的,但是建议安装,因为ISPConfig的监测管理将尝试显示fail2ban的日志。
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# aptitude install fail2ban</span></p>
            </td>
        </tr>
    </tbody>
</table>
<span style="color: rgb(0, 0, 255);"><strong>19、安装SquirrelMail</strong></span><br>
运行一下命令安装AquirrelMail客户端:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# aptitude install squirrelmail</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后建立如下连接:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# ln -s /usr/share/squirrelmail/ /var/www/webmail</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后配置SquirrelMail:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# squirrelmail-configure</span></p>
            </td>
        </tr>
    </tbody>
</table>
配置让SquirrelMail使用Courier-IMAP和Courier-POP3:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">rSquirrelMail Configuration : Read: config.php (1.4.0)<br>
            ---------------------------------------------------------<br>
            Main Menu --<br>
            1. Organization Preferences<br>
            2. Server Settings<br>
            3. Folder Defaults<br>
            4. General Options<br>
            5. Themes<br>
            6. Address Books<br>
            7. Message of the Day (MOTD)<br>
            8. Plugins<br>
            9. Database<br>
            10. Languages</span></p>
            <p><span style="color: rgb(255, 255, 255);">D. Set pre-defined settings for specific IMAP servers</span></p>
            <p><span style="color: rgb(255, 255, 255);">C Turn color on<br>
            S Save data<br>
            Q Quit</span></p>
            <p><span style="color: rgb(255, 255, 255);">Command &gt;&gt; </span><span style="color: rgb(255, 0, 0);">&lt;-- D</span></p>
            <p><span style="color: rgb(255, 255, 255);"><br>
            SquirrelMail Configuration : Read: config.php<br>
            ---------------------------------------------------------<br>
            While we have been building SquirrelMail, we have discovered some<br>
            preferences that work better with some servers that don't work so<br>
            well with others. If you select your IMAP server, this option will<br>
            set some pre-defined settings for that server.</span></p>
            <p><span style="color: rgb(255, 255, 255);">Please note that you will still need to go through and make sure<br>
            everything is correct. This does not change everything. There are<br>
            only a few settings that this will change.</span></p>
            <p><span style="color: rgb(255, 255, 255);">Please select your IMAP server:<br>
            bincimap = Binc IMAP server<br>
            courier = Courier IMAP server<br>
            cyrus = Cyrus IMAP server<br>
            dovecot = Dovecot Secure IMAP server<br>
            exchange = Microsoft Exchange IMAP server<br>
            hmailserver = hMailServer<br>
            macosx = Mac OS X Mailserver<br>
            mercury32 = Mercury/32<br>
            uw = University of Washington's IMAP server</span></p>
            <p><span style="color: rgb(255, 255, 255);">quit = Do not change anything<br>
            Command &gt;&gt; </span><span style="color: rgb(255, 0, 0);">&lt;-- courier</span></p>
            <p><br>
            <span style="color: rgb(255, 255, 255);">SquirrelMail Configuration : Read: config.php<br>
            ---------------------------------------------------------<br>
            While we have been building SquirrelMail, we have discovered some<br>
            preferences that work better with some servers that don't work so<br>
            well with others. If you select your IMAP server, this option will<br>
            set some pre-defined settings for that server.</span></p>
            <p><span style="color: rgb(255, 255, 255);">Please note that you will still need to go through and make sure<br>
            everything is correct. This does not change everything. There are<br>
            only a few settings that this will change.</span></p>
            <p><span style="color: rgb(255, 255, 255);">Please select your IMAP server:<br>
            bincimap = Binc IMAP server<br>
            courier = Courier IMAP server<br>
            cyrus = Cyrus IMAP server<br>
            dovecot = Dovecot Secure IMAP server<br>
            exchange = Microsoft Exchange IMAP server<br>
            hmailserver = hMailServer<br>
            macosx = Mac OS X Mailserver<br>
            mercury32 = Mercury/32<br>
            uw = University of Washington's IMAP server</span></p>
            <p><span style="color: rgb(255, 255, 255);">quit = Do not change anything<br>
            Command &gt;&gt; </span><span style="color: rgb(255, 0, 0);">courier</span></p>
            <p><span style="color: rgb(255, 255, 255);">imap_server_type = courier<br>
            default_folder_prefix = INBOX.<br>
            trash_folder = Trash<br>
            sent_folder = Sent<br>
            draft_folder = Drafts<br>
            show_prefix_option = false<br>
            default_sub_of_inbox = false<br>
            show_contain_subfolders_option = false<br>
            optional_delimiter = .<br>
            delete_folder = true</span></p>
            <p><span style="color: rgb(255, 255, 255);">Press any key to continue... </span><span style="color: rgb(255, 0, 0);">&lt;-- 按任意键</span></p>
            <p><br>
            <span style="color: rgb(255, 255, 255);">SquirrelMail Configuration : Read: config.php (1.4.0)<br>
            ---------------------------------------------------------<br>
            Main Menu --<br>
            1. Organization Preferences<br>
            2. Server Settings<br>
            3. Folder Defaults<br>
            4. General Options<br>
            5. Themes<br>
            6. Address Books<br>
            7. Message of the Day (MOTD)<br>
            8. Plugins<br>
            9. Database<br>
            10. Languages</span></p>
            <p><span style="color: rgb(255, 255, 255);">D. Set pre-defined settings for specific IMAP servers</span></p>
            <p><span style="color: rgb(255, 255, 255);">C Turn color on<br>
            S Save data<br>
            Q Quit</span></p>
            <p><span style="color: rgb(255, 255, 255);">Command &gt;&gt; </span><span style="color: rgb(255, 0, 0);">&lt;-- S</span></p>
            <p><br>
            <span style="color: rgb(255, 255, 255);">SquirrelMail Configuration : Read: config.php (1.4.0)<br>
            ---------------------------------------------------------<br>
            Main Menu --<br>
            1. Organization Preferences<br>
            2. Server Settings<br>
            3. Folder Defaults<br>
            4. General Options<br>
            5. Themes<br>
            6. Address Books<br>
            7. Message of the Day (MOTD)<br>
            8. Plugins<br>
            9. Database<br>
            10. Languages</span></p>
            <p><span style="color: rgb(255, 255, 255);">D. Set pre-defined settings for specific IMAP servers</span></p>
            <p><span style="color: rgb(255, 255, 255);">C Turn color on<br>
            S Save data<br>
            Q Quit</span></p>
            <p><span style="color: rgb(255, 255, 255);">Command &gt;&gt; </span><span style="color: rgb(255, 0, 0);">&lt;-- Q</span></p>
            </td>
        </tr>
    </tbody>
</table>
<strong><span style="color: rgb(0, 0, 255);">20、安装ISPConfig 3</span></strong><br>
下载ISPConfig 3的最新版本并解压缩:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# cd /tmp<br>
            root@server:~# wget http://downloads.sourceforge.net/ispconfig/ISPConfig-3.0.1.1.tar.gz?use_mirror=<br>
            root@server:~# tar xvfz ISPConfig-3.0.1.tar.gz<br>
            root@server:~# cd ispconfig3_install/install/</span></p>
            </td>
        </tr>
    </tbody>
</table>
下一步运行如下命令安装:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">root@server:~# php -q install.php</span></p>
            </td>
        </tr>
    </tbody>
</table>
然后就开始安装ISPConfig 3了:
<table width="560" bgcolor="#000000" border="1" cellpadding="1" cellspacing="0">
    <tbody>
        <tr>
            <td>
            <p fontcolor="#FFFFFF"><span style="color: rgb(255, 255, 255);">r<br>
            --------------------------------------------------------------------------------<br>
            _____ ___________ _____ __ _<br>
            |_ _/ ___| ___ \ / __ \ / _(_)<br>
            | | \ `--.| |_/ / | / \/ ___ _ __ | |_ _ __ _<br>
            | | `--. \ __/ | | / _ \| '_ \| _| |/ _` |<br>
            _| |_/\__/ / | | \__/\ (_) | | | | | | | (_| |<br>
            \___/\____/\_| \____/\___/|_| |_|_| |_|\__, |<br>
            __/ |<br>
            |___/<br>
            --------------------------------------------------------------------------------</span></p>
            <p><span style="color: rgb(255, 255, 255);"><br>
            &gt;&gt; Initial configuration</span></p>
            <p><span style="color: rgb(255, 255, 255);">Operating System: Debian Lenny/Sid or compatible</span></p>
            <p><span style="color: rgb(255, 255, 255);">Following will be a few questions for primary configuration so be careful.<br>
            Default values are in [brackets] and can be accepted with &lt;ENTER&gt;.<br>
            Tap in "quit" (without the quotes) to stop the installer.</span></p>
            <p><span style="color: rgb(255, 255, 255);"><br>
            Select language (en,de) [en]: </span><span style="color: rgb(255, 0, 0);">&lt;-- ENTER</span></p>
            <p><span style="color: rgb(255, 255, 255);">Installation mode (standard,expert) [standard]: </span><span style="color: rgb(255, 0, 0);">&lt;-- ENTER</span></p>
            <p><span style="color: rgb(255, 255, 255);">Full qualified hostname (FQDN) of the server, eg server.ispcpcn.com [server.ispcpcn.com]: </span><span style="color: rgb(255, 0, 0);">&lt;-- ENTER</span></p>
            <p><span style="color: rgb(255, 255, 255);">MySQL server hostname [localhost]: </span><span style="color: rgb(255, 0, 0);">&lt;-- ENTER</span></p>
            <p><span style="color: rgb(255, 255, 255);">MySQL root username [root]: </span><span style="color: rgb(255, 0, 0);">&lt;-- ENTER</span></p>
            <p><span style="color: rgb(255, 255, 255);">MySQL root password []: </span><span style="color: rgb(255, 0, 0);">&lt;-- 输入MySQL的root用户密码</span></p>
            <p><span style="color: rgb(255, 255, 255);">MySQL database to create [dbispconfig]: </span><span style="color: rgb(255, 0, 0);">&lt;-- ENTER</span></p>
            <p><span style="color: rgb(255, 255, 255);">MySQL charset [utf8]: </span><span style="color: rgb(255, 0, 0);">&lt;-- ENTER</span></p>
            <p><span style="color: rgb(255, 255, 255);">Generating a 2048 bit RSA private key<br>
            ..........................................................+++<br>
            .+++<br>
            writing new private key to 'smtpd.key'<br>
            -----<br>
            You are about to be asked to enter information that will be incorporated<br>
            into your certificate request.<br>
            What you are about to enter is what is called a Distinguished Name or a DN.<br>
            There are quite a few fields but you can leave some blank<br>
            For some fields there will be a default value,<br>
            If you enter '.', the field will be left blank.<br>
            -----</span><br>
            <span style="color: rgb(255, 255, 255);">Country Name (2 letter code) [AU]: </span><span style="color: rgb(255, 0, 0);">&lt;-- 中国输入CN<br>
            </span><span style="color: rgb(255, 255, 255);">State or Province Name (full name) [Some-State]: </span><span style="color: rgb(255, 0, 0);">&lt;-- 省份</span><br>
            <span style="color: rgb(255, 255, 255);">Locality Name (eg, city) []: </span><span style="color: rgb(255, 0, 0);">&lt;-- 城市</span><br>
            <span style="color: rgb(255, 255, 255);">Organization Name (eg, company) [Internet Widgits Pty Ltd]: </span><span style="color: rgb(255, 0, 0);">&lt;-- 公司</span><br>
            <span style="color: rgb(255, 255, 255);">Organizational Unit Name (eg, section) []: </span><span style="color: rgb(255, 0, 0);">&lt;-- 组织</span><br>
            <span style="color: rgb(255, 255, 255);">Common Name (eg, YOUR name) []:</span> <span style="color: rgb(255, 0, 0);">&lt;-- 注释名</span><br>
            <span style="color: rgb(255, 255, 255);">Email Address []:</span> <span style="color: rgb(255, 0, 0);">&lt;-- 电子邮件地址<br>
            </span><span style="color: rgb(255, 255, 255);">Configuring Jailkit<br>
            Configuring SASL<br>
            Configuring PAM<br>
            Configuring Courier<br>
            Configuring Spamassassin<br>
            Configuring Amavisd<br>
            Configuring Getmail<br>
            Configuring Pureftpd<br>
            Configuring MyDNS<br>
            Configuring Apache<br>
            Configuring Firewall<br>
            Installing ISPConfig<br>
            ISPConfig Port [8080]:</span> <span style="color: rgb(255, 0, 0);">&lt;-- 端口号,可以默认</span></p>
            <p><span style="color: rgb(255, 255, 255);">Configuring DBServer<br>
            Installing Crontab<br>
            no crontab for root<br>
            no crontab for getmail<br>
            Restarting services ...<br>
            * Stopping MySQL database server mysqld<br>
            ...done.<br>
            * Starting MySQL database server mysqld<br>
            ...done.<br>
            * Checking for corrupt, not cleanly closed and upgrade needing tables.<br>
            * Stopping Postfix Mail Transport Agent postfix<br>
            ...done.<br>
            * Starting Postfix Mail Transport Agent postfix<br>
            ...done.<br>
            * Stopping SASL Authentication Daemon saslauthd<br>
            ...done.<br>
            * Starting SASL Authentication Daemon saslauthd<br>
            ...done.<br>
            Stopping amavisd: amavisd-new.<br>
            Starting amavisd: amavisd-new.<br>
            * Stopping ClamAV daemon clamd<br>
            ...done.<br>
            * Starting ClamAV daemon clamd<br>
            LibClamAV Warning: ***********************************************************<br>
            LibClamAV Warning: *** This version of the ClamAV engine is outdated. ***<br>
            LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***<br>
            LibClamAV Warning: ***********************************************************<br>
            ...done.<br>
            * Stopping Courier authentication services authdaemond<br>
            ...done.<br>
            * Starting Courier authentication services authdaemond<br>
            ...done.<br>
            * Stopping Courier IMAP server...<br>
            ...done.<br>
            * Starting Courier IMAP server...<br>
            ...done.<br>
            * Stopping Courier IMAP-SSL server...<br>
            ...done.<br>
            * Starting Courier IMAP-SSL server...<br>
            ...done.<br>
            * Stopping Courier POP3 server...<br>
            ...done.<br>
            * Starting Courier POP3 server...<br>
            ...done.<br>
            * Stopping Courier POP3-SSL server...<br>
            ...done.<br>
            * Starting Courier POP3-SSL server...<br>
            ...done.<br>
            * Restarting web server apache2<br>
            ... waiting ...done.<br>
Restarting ftp server: Running: /usr/sbin/pure-ftpd-mysql-virtualchroot
-l mysql:/etc/pure-ftpd/db/mysql.conf -l pam -E -u 1000 -O
clf:/var/log/pure-ftpd/transfer.log -b -A -B<br>
            Installation completed.</span></p>
            </td>
        </tr>
    </tbody>
</table>
至此安装完毕,使用http://server.ispcpcn.com:8080或者http://192.168.0.100:8080就可以访问你
的ISPConfig 3了,默认用户名和密码都是admin!!欢迎转载,转载时请注明转自:开源虚拟主机社区,并注明转载地址<a href="http://www.ispcpcn.com/">http://www.ispcpcn.com</a>。谢谢!!
                                <br>
頁: [1]
查看完整版本: [轉貼]Ubuntu Server 8.10下安装ispconfig 3教程