Plesk 镜像制作(脚本)

2017-03-10 16:08:40 +08:00
 cloudL

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

保存为一个可执行的 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 admin@example.com -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 admin@example.com -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

7342 次点击
所在节点   Unix
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/346482

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX