V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
cloudL
V2EX  ›  Unix

Plesk 镜像制作(脚本)

  •  
  •   cloudL · 2017-03-10 16:08:40 +08:00 · 7325 次点击
    这是一个创建于 2604 天前的主题,其中的信息可能已经有所发展或是发生改变。

    安装完系统后,执行以下代码后关机。然后把系统制作成镜像即可

    保存为一个可执行的 bash 文件,最好在 screen 中运行

    #把下面的 key 换成有效的 Plesk key

    key=A00100-C11604-BP7806-BP7662-SE5R68

    #一键安装 Plesk

    sh <(curl https://autoinstall.plesk.com/one-click-installer || wget -O - https://autoinstall.plesk.com/one-click-installer)

    #获取一个本机 ip 地址

    ip=ifconfig eth0 | grep "inet addr" | awk '{ print $2}' | awk -F: '{print $2}'

    if [ "$ip" = "" ]; then

    ip=`ifconfig eth0 | grep "inet" | awk '{ print $2}'`
    

    fi

    #初始化配置 Plesk

    plesk bin init_conf --init -default-ip $ip -netmask 255.255.255.0 -iface eth0 -ip-type shared -license_agreed true -hostname example.com -shared_ips add:$ip -name "John Doe" -passwd mypass -phone 555-5555 -fax 333-3333 -email [email protected] -company "Megacompany Inc." -address "45 Trail street" -city "New York" -zip 10292 -country US -state NY

    #激活 key

    plesk bin license -i $key

    #设置 Plesk 默认语言

    plesk bin locales --set-default zh-CN

    #更改域名注册或域名管理的链接

    if [ ! -f "/etc/centos-release" ]; then

    path='/opt'
    

    else

    path='/usr/local'
    

    fi

    $path/psa/bin/panel_gui -p -domain_registration_url https://www.bisend.cn/domain

    $path/psa/bin/panel_gui -p -domain_management_url https://my.bisend.cn

    #不显示 Facebook Like 链接以加快 Plesk 页面加载速度

    sed 's/;showLikeLink/showLikeLink/' $path/psa/admin/conf/panel.ini.sample > $path/psa/admin/conf/panel.ini

    #安装额外的 extension

    wget https://my.bisend.cn/downloads/trustasiassltool-1.1.9-10.zip -P /root/

    plesk bin extension --install /root/trustasiassltool-1.1.9-10.zip

    #清除安装 Key 的信息

    plesk bin cloning -u -prepare-public-image true -reset-license true -reset-init-conf true -skip-update true

    #下次启动 Plesk 的时候重新映射 ip

    plesk bin ipmanage --auto-remap-ip-addresses true

    #終わり

    echo "finished"

    windows 中只把部分操作脚本化

    #浏览器下载 http://autoinstall-win.plesk.com/plesk-installer.exe

    #双击打开或者 cmd 打开 plesk-installer.exe --console

    #LINUX: sh <(curl https://autoinstall.plesk.com/one-click-installer || wget -O - https://autoinstall.plesk.com/one-click-installer)

    #ip=ifconfig eth0 | grep "inet addr" | awk '{ print $2}' | awk -F: '{print $2}' #手动获得 ip 并替换下面命令中的 ip

    plesk bin init_conf --init -license_agreed true -hostname example.com -shared_ips add:172.31.34.196 -name "John Doe" -passwd MyPass@123 -phone 555-5555 -fax 333-3333 -email [email protected] -company "Megacompany Inc." -address "45 Trail street" -city "New York" -zip 10292 -country US -state NY

    plesk bin license -i A00100-C11604-BP7806-BP7662-SE5R68

    plesk bin locales --set-default zh-CN #设置中文为默认语言

    "C:\Program Files (x86)\Plesk\bin\panel_gui" -p -domain_registration_url https://www.bisend.cn/domain

    "C:\Program Files (x86)\Plesk\bin\panel_gui" -p -domain_management_url https://my.bisend.cn

    #手动操作代替下面的句子

    #sed "s/;showLikeLink/showLikeLink/" "C:\Program Files (x86)\Plesk\admin\conf\panel.ini.sample" > "C:\Program Files (x86)\Plesk\admin\conf\panel.ini"

    #手动操作代替下面的句子

    #wget https://my.bisend.cn/downloads/trustasiassltool-1.1.9-10.zip -P /root/

    #plesk bin extension --install /root/trustasiassltool-1.1.9-10.zip

    plesk bin cloning -u -prepare-public-image true -reset-license true -reset-init-conf true -skip-update true

    plesk bin ipmanage --auto-remap-ip-addresses true

    #windows 中不需要

    #-default-ip 172.31.34.196 -netmask 255.255.255.0 -iface eth0 -ip-type shared

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2869 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 03:31 · PVG 11:31 · LAX 20:31 · JFK 23:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.