plask 主控 更换ip

原文链接:http://kb.odin.com/943

症状

如何更换IP地址在Parallels Plesk的对象吗?

分析

Note: Before manipulating the database, it is strongly recommended that you create a backup.

注意:在操作数据库之前,强烈建议您创建一个备份。

在最简单的情况下,您的所有域的IP需要更新一个值,你可以使用下面的脚本。用知识产权来代替<IP address>

# mysql -Ns -uadmin -p`cat /etc/psa/.psa.shadow` -D psa -e 'select name from domains' | awk '{print "/usr/local/psa/bin/domain --update " $1 " -ip <IP address> "}' | sh

同时,你可以省略最后一个| SH指令在执行它之前预览命令的输出。

如果您需要执行更复杂的IP改变(例如,如果你有一个以上的目的地IP,你需要指定IP成为),你可以使用reconfigurator.pl脚本。

The utility ${PRODUCT_ROOT_D}/reconfigurator.pl is developed to replace IP addresses assigned to objects (domains/clients/resellers) in the Plesk database and to reconfigure object settings with the new IPs:

本${PRODUCT_ROOT_D}/reconfigurator.pl来取代IP地址分配给对象(区域/客户/经销商)在Plesk数据库并与新的IP地址配置对象的设置:

# /usr/local/psa/bin/reconfigurator.pl
Plesk reconfigurator - utility to change IP addresses used by
Plesk Server Administrator

Usage:
    /usr/local/psa/bin/reconfigurator.pl <map_file>

 If <map_file> doesn't exist, a template will be created. Otherwise,
it will be used to map IP addresses.

按照下列步骤来执行地址替换:

  1. 确保新的IP地址不在 Server > IP Addresses在Plesk注册页面。如果他们是,删除之前进行进一步的。
  2. 运行该实用程序来创建映射模板文件:
    # /usr/local/psa/bin/reconfigurator.pl ipaddresses.map
    

    然后,编辑该文件并设置适当的知识产权映射。在下面的格式中,将当前配置的知识产权地址与新的地址的完整列表中的图档匹配:

    #cat ipaddresses.map
    eth0:192.168.50.60 255.255.255.0 -> eth0:192.168.50.60 255.255.255.0
    eth0:192.168.50.70 255.255.255.0 -> eth0:192.168.50.70 255.255.255.0
    

    编辑该文件并将其替换为一个从新设置的字符串中的一个字符串的地址:

    eth0:192.168.50.60 255.255.255.0 -> eth0:new_ip_address 255.255.255.0
    
  3. 一旦映射文件包含一个适当的安排,再次运行reconfigurator.pl:
    # /usr/local/psa/bin/reconfigurator.pl ipaddresses.map
    

    它将读取映射文件并按其内容进行替换。

  4. 修复Plesk服务配置:
    # /usr/local/psa/bin/repair -r
    

附加信息

If you encounter issues, please refer to: “Changing IP address fails with error: no such network interface”

如果遇到问题,请参考:“更改地址错误:没有这样的网络接口”

 

点赞