如何在 Debian 上安装 ISPConfig 12

Linux命令 Edge插件网 1年前 (2023-11-17) 291次浏览 已收录 0个评论

ISPConfig 是 Internet Service Provider Configuration 的首字母缩写词,是具有多服务器管理功能的多功能控制面板。它拥有用户友好的界面和开源的灵活性,使其成为初学者和经验丰富的管理员的理想选择。

如何在 Debian 上安装 ISPConfig 12

在 Debian 上安装 ISPConfig 12 Bookworm

步骤 1。更新您的 Debian 12 系统,以确保您拥有最新的安全补丁和软件更新。执行以下命令:

<span class="pln">sudo apt update
sudo apt upgrade</span>

第2步。设置主机名。

现在确保设置了主机名:

<span class="pln">sudo hostnamectl </span><span class="kwd">set</span><span class="pun">-</span><span class="pln">hostname ispconfig</span><span class="pun">.</span><span class="pln">idroot</span><span class="pun">.</span><span class="pln">us</span>

在继续之前,我们将检查主机名是否正确:

<span class="pln">hostname </span><span class="pun">-</span><span class="pln">f</span>

输出:

<span class="pln">root@idroot</span><span class="pun">:~</span><span class="pln">$ hostname </span><span class="pun">-</span><span class="pln">f</span>

在继续之前,我们将检查主机名是否正确:

<span class="pln">hostname </span><span class="pun">-</span><span class="pln">f</span>

输出:

<span class="pln">root@idroot</span><span class="pun">:~</span><span class="pln">$ hostname </span><span class="pun">-</span><span class="pln">f
idroot</span><span class="pun">.</span><span class="pln">example</span><span class="pun">.</span><span class="pln">com</span>

第 3 步。安装必要的依赖项。

现在更新 Debian 12 软件库以包含非自由软件包:

<span class="pln">sudo tee </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">apt</span><span class="pun">/</span><span class="pln">sources</span><span class="pun">.</span><span class="pln">list</span><span class="pun"><<</span><span class="pln">EOF
deb http</span><span class="pun">:</span><span class="com">//deb.<a href="https://www.edge66.com/edgetag/debian" title="查看更多关于debian的文章" target="_blank">debian</a>.org/<a href="https://www.edge66.com/edgetag/debian" title="查看更多关于debian的文章" target="_blank">debian</a> bookworm main contrib non-free non-free-firmware</span><span class="pln">
deb http</span><span class="pun">:</span><span class="com">//deb.<a href="https://www.edge66.com/edgetag/debian" title="查看更多关于debian的文章" target="_blank">debian</a>.org/<a href="https://www.edge66.com/edgetag/debian" title="查看更多关于debian的文章" target="_blank">debian</a> bookworm-updates main non-free contrib non-free-firmware</span><span class="pln">
deb http</span><span class="pun">:</span><span class="com">//security.<a href="https://www.edge66.com/edgetag/debian" title="查看更多关于debian的文章" target="_blank">debian</a>.org/<a href="https://www.edge66.com/edgetag/debian" title="查看更多关于debian的文章" target="_blank">debian</a>-security bookworm-security main contrib non-free non-free-firmware</span><span class="pln">
EOF</span>

目前,ISPConfig 与 Debian 12 不兼容。因此,我们将对我们的安装程序进行调整,使我们的安装程序能够使用 Debian 11 软件包:/etc/os-release

<span class="pln">sudo sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'s/12/11/g'</span> <span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">os</span><span class="pun">-</span><span class="pln">release</span>

源文件:

<span class="pln">source </span><span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">os</span><span class="pun">-</span><span class="pln">release</span>

请记住在安装完成后还原更改。

第 4 步。在 Debian 上安装 ISPConfig 12.

官方 ISPConfig 脚本安装程序简化了安装过程,并确保与最新功能和安全更新兼容。使用以下命令从 ISPConfig 官方网站获取脚本:

<span class="pln">wget </span><span class="pun">-</span><span class="pln">O </span><span class="pun">-</span><span class="pln"> https</span><span class="pun">:</span><span class="com">//get.ispconfig.org | sudo sh -s -- --help</span>

输出:

<span class="typ">ISPConfig</span> <span class="lit">3</span> <span class="typ">Autoinstaller</span>
<span class="pun">**********************************************************************************************************************************************************************************************</span>

<span class="typ">Usage</span><span class="pun">:</span><span class="pln"> ispc3</span><span class="pun">-</span><span class="pln">ai</span><span class="pun">.</span><span class="pln">sh </span><span class="pun">[<</span><span class="pln">argument</span><span class="pun">>]</span> <span class="pun">[...]</span>

<span class="typ">This</span><span class="pln"> script automatically installs all needed packages </span><span class="kwd">for</span><span class="pln"> an </span><span class="typ">ISPConfig</span> <span class="lit">3</span><span class="pln"> setup </span><span class="kwd">using</span><span class="pln"> the guidelines </span><span class="kwd">from</span><span class="pln"> the </span><span class="str">"Perfect Server Setup"</span><span class="pln"> howtos on www</span><span class="pun">.</span><span class="pln">howtoforge</span><span class="pun">.</span><span class="pln">com</span><span class="pun">.</span>

<span class="typ">Possible</span><span class="pln"> arguments are</span><span class="pun">:</span>
    <span class="pun">--</span><span class="pln">help          </span><span class="typ">Show</span> <span class="kwd">this</span><span class="pln"> help page
    </span><span class="pun">--</span><span class="pln">debug         </span><span class="typ">Enable</span><span class="pln"> verbose logging </span><span class="pun">(</span><span class="pln">logs each command </span><span class="kwd">with</span><span class="pln"> the </span><span class="kwd">exit</span><span class="pln"> code</span><span class="pun">)</span>
    <span class="pun">--</span><span class="pln">channel       </span><span class="typ">Choose</span><span class="pln"> the channel to </span><span class="kwd">use</span> <span class="kwd">for</span> <span class="typ">ISPConfig</span><span class="pun">.</span> <span class="pun">--</span><span class="pln">channel</span><span class="pun">=<</span><span class="pln">stable</span><span class="pun">|</span><span class="pln">dev</span><span class="pun">></span>
                    <span class="str">"stable"</span> <span class="kwd">is</span><span class="pln"> the latest </span><span class="typ">ISPConfig</span><span class="pln"> release available on www</span><span class="pun">.</span><span class="pln">ispconfig</span><span class="pun">.</span><span class="pln">org
                    </span><span class="str">"dev"</span> <span class="kwd">is</span><span class="pln"> the latest dev</span><span class="pun">-</span><span class="pln">branch </span><span class="kwd">from</span><span class="pln"> the </span><span class="typ">ISPConfig</span><span class="pln"> git repository</span><span class="pun">:</span><span class="pln"> https</span><span class="pun">:</span><span class="com">//git.ispconfig.org/ispconfig/ispconfig3/tree/develop</span>
                    <span class="pun">-></span> <span class="typ">The</span><span class="pln"> dev channel might contain bugs </span><span class="kwd">and</span><span class="pln"> less</span><span class="pun">-</span><span class="pln">tested features </span><span class="kwd">and</span><span class="pln"> should only be used </span><span class="kwd">in</span><span class="pln"> production </span><span class="kwd">by</span><span class="pln"> very experienced users</span><span class="pun">.</span>
    <span class="pun">--</span><span class="pln">lang          </span><span class="typ">Use</span><span class="pln"> language </span><span class="kwd">for</span> <span class="typ">ISPConfig</span><span class="pln"> installation</span><span class="pun">.</span> <span class="typ">Specify</span> <span class="kwd">with</span> <span class="pun">--</span><span class="pln">lang</span><span class="pun">=</span><span class="pln">en</span><span class="pun">|</span><span class="pln">de </span><span class="pun">(</span><span class="pln">only en </span><span class="pun">(</span><span class="typ">English</span><span class="pun">)</span> <span class="kwd">and</span><span class="pln"> de </span><span class="pun">(</span><span class="typ">German</span><span class="pun">)</span><span class="pln"> supported currently</span><span class="pun">).</span>
    <span class="pun">--</span><span class="pln">interactive   </span><span class="typ">Don</span><span class="str">'t install ISPConfig in non-interactive mode. This is needed if you want to use expert mode, e. g. to install a slave server that shall be integrated into an existing
                    multiserver setup.
    --use-nginx     Use nginx webserver instead of apache2
    --use-amavis    Use amavis instead of rspamd for mail filtering
    --use-unbound   Use unbound instead of bind9 for local resolving. Only allowed if --no-dns is set.
    --use-php       Use specific PHP versions, comma separated, instead of installing multiple PHP, e.g. --use-php=7.4,8.0 (5.6, 7.0, 7.1, 7.2, 7.3, 7.4, 8.0 and 8.1 available).
                    --use-php=system disables the sury repository and just installs the system'</span><span class="pln">s </span><span class="kwd">default</span><span class="pln"> PHP version</span><span class="pun">.</span><span class="pln">
                    ommiting the argument </span><span class="pun">(</span><span class="kwd">use</span><span class="pln"> all versions</span><span class="pun">)</span>
    <span class="pun">--</span><span class="kwd">use</span><span class="pun">-</span><span class="pln">ftp</span><span class="pun">-</span><span class="pln">ports </span><span class="typ">This</span><span class="pln"> option sets the passive port range </span><span class="kwd">for</span><span class="pln"> pure</span><span class="pun">-</span><span class="pln">ftpd</span><span class="pun">.</span> <span class="typ">You</span><span class="pln"> have to specify the port range separated </span><span class="kwd">by</span><span class="pln"> hyphen</span><span class="pun">,</span><span class="pln"> e</span><span class="pun">.</span><span class="pln"> g</span><span class="pun">.</span> <span class="pun">--</span><span class="kwd">use</span><span class="pun">-</span><span class="pln">ftp</span><span class="pun">-</span><span class="pln">ports</span><span class="pun">=</span><span class="lit">40110</span><span class="pun">-</span><span class="lit">40210.</span>
                    <span class="typ">If</span> <span class="kwd">not</span><span class="pln"> provided the passive port range will </span><span class="kwd">not</span><span class="pln"> be configured</span><span class="pun">.</span>
    <span class="pun">--</span><span class="kwd">use</span><span class="pun">-</span><span class="pln">certbot   </span><span class="typ">Use</span> <span class="typ">Certbot</span><span class="pln"> instead </span><span class="kwd">of</span><span class="pln"> acme</span><span class="pun">.</span><span class="pln">sh </span><span class="kwd">for</span><span class="pln"> issuing </span><span class="typ">Let</span><span class="str">'s Encrypt certificates. Not adviced unless you are migrating from a old server that uses Certbot.
    --no-web        Do not use ISPConfig on this server to manage webserver setting and don'</span><span class="pln">t install nginx</span><span class="pun">/</span><span class="pln">apache </span><span class="kwd">or</span><span class="pln"> pureftpd</span><span class="pun">.</span> <span class="typ">This</span><span class="pln"> will also prevent installing an </span><span class="typ">ISPConfig</span><span class="pln"> UI </span><span class="kwd">and</span><span class="pln"> implies
                    </span><span class="pun">--</span><span class="kwd">no</span><span class="pun">-</span><span class="pln">roundcube </span><span class="kwd">as</span><span class="pln"> well </span><span class="kwd">as</span> <span class="pun">--</span><span class="kwd">no</span><span class="pun">-</span><span class="pln">pma
    </span><span class="pun">--</span><span class="kwd">no</span><span class="pun">-</span><span class="pln">mail       </span><span class="typ">Do</span> <span class="kwd">not</span> <span class="kwd">use</span> <span class="typ">ISPConfig</span><span class="pln"> on </span><span class="kwd">this</span><span class="pln"> server to manage mailserver settings</span><span class="pun">.</span> <span class="typ">This</span><span class="pln"> will install postfix </span><span class="kwd">for</span><span class="pln"> sending system mails</span><span class="pun">,</span><span class="pln"> but </span><span class="kwd">not</span><span class="pln"> dovecot </span><span class="kwd">and</span> <span class="kwd">not</span><span class="pln"> configure any settings </span><span class="kwd">for</span>
                    <span class="typ">ISPConfig</span><span class="pln"> mail</span><span class="pun">.</span> <span class="typ">It</span><span class="pln"> implies </span><span class="pun">--</span><span class="kwd">no</span><span class="pun">-</span><span class="pln">mailman</span><span class="pun">.</span>
<span class="pun">......</span>

执行安装程序时,多个配置选项将变为可用。在这种情况下,我们将选择 Apache、PHP 8、MariaDB、Postfix、Dovecot、Rspamd、BIND、Jailkit、Roundcube、PHPMyAdmin、Mailman、Webalizer、AWStats 和 GoAccess。

<span class="pln">wget </span><span class="pun">-</span><span class="pln">O </span><span class="pun">-</span><span class="pln"> https</span><span class="pun">:</span><span class="com">//get.ispconfig.org | sudo sh -s -- --use-php=8.0 --use-ftp-ports=40110-40210 --lang=en --unattended-upgrades</span>

输出:

<span class="pln">WARNING</span><span class="pun">!</span> <span class="typ">This</span><span class="pln"> script will reconfigure your complete server</span><span class="pun">!</span>
<span class="typ">It</span><span class="pln"> should be run on a freshly installed server </span><span class="kwd">and</span><span class="pln"> all current configuration that you have </span><span class="kwd">done</span><span class="pln"> will most likely be lost</span><span class="pun">!</span>
<span class="typ">Type</span> <span class="str">'yes'</span> <span class="kwd">if</span><span class="pln"> you really want to </span><span class="kwd">continue</span><span class="pun">:</span><span class="pln"> yes</span>

请记住在安装完成后修改以下文件:

<span class="pln">sudo sed </span><span class="pun">-</span><span class="pln">i </span><span class="str">'s/11/12/g'</span> <span class="pun">/</span><span class="pln">etc</span><span class="pun">/</span><span class="pln">os</span><span class="pun">-</span><span class="pln">release</span>

第 5 步。配置防火墙。

在 Debian 上为 ISPConfig 配置防火墙对于确保只打开必要的端口、增强服务器的安全性至关重要。ISPConfig 使用端口 8080 作为其 Web 界面。允许此端口上的流量:

<span class="pln">sudo ufw allow </span><span class="lit">8080</span><span class="pun">/</span><span class="pln">tcp</span>

启用 UFW 以应用更改:

<span class="pln">sudo ufw enable</span>

验证 UFW 现在是否处于活动状态并正确配置:

<span class="pln">sudo ufw status</span>

第 6 步。访问 ISPConfig Web 界面。

访问 ISPConfig Web 界面,网址为 。您将被重定向到 ISPConfig 登录页面:https://ispconfig.idroot.us:8080

如何在 Debian 上安装 ISPConfig 12

感谢您使用本教程在 Debian 12 Bookworm 上安装最新版本的 ISPConfig。如需更多帮助或有用信息,我们建议您查看 ISPConfig 官方网站


Edge插件网 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:如何在 Debian 上安装 ISPConfig 12
喜欢 (0)
发表我的评论
取消评论
表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址