Cloud Servers may be deployed as per customer requirements. A custom script server deployment is useful in such cases if your deployed server requires custom commands/services to be enabled and installed as per your needs, that are otherwise not available with the default OS configuration.
The LayerPanel v2.0 offers such an option whereby any server can be easily deployed using the customer’s own script for installing install Apache HTTPD service, MySQL service, etc.
For making use of Custom Script deployment, please follow the below steps and this is only applied for Linux OS
currently.
Log in to LayerPanel v2.0.
In Dashboard, click Deploy
to order/deploy the new Cloud Servers.
In the next page view, scroll down to the Password & Custom Setting
section and then mark the check box near Custom Startup Script
.
The custom script with which the server needs to be deployed can then be entered in the Custom Startup Script field
.
NOTE : Input your script command into the format ' {space}{space}-{space}{cmd} '.
Examples for Custom Script:
To add the resolver nameserver IP addresses
to the server at the time of server deployment, the below commands can be entered in the Custom Script field.
- echo nameserver 8.8.8.8 >> /etc/resolv.conf
- echo nameserver 8.8.4.4 >> /etc/resolv.conf
To update a CentOS server
with the latest security and binary packages, right after the server has been, the below commands can be used in the Custom Script field.
- yum update >> /root/yumupdate.txt
To update an Ubuntu server
with the latest security and binary packages, right after the server has been, the below commands can be used in the Custom Script field.
- sudo apt-get update >> /root/update.txt
To install telnet command
in the server at the time of deployment, use the below command that can be entered in the Custom Script field.
- yum install telnet -y >> /root/telnetinstall.txt
To install Apache HTTPD service
in the server when it is deployed, the below commands can be entered in the Custom Script field.
- yum -y install httpd >> /root/httpdinsall.txt
- systemctl enable httpd >> /root/httpdenable.txt
- systemctl start httpd.service >> /root/httpdstart.txt
To install MySQL service
in an Ubuntu server when it is deployed, the below commands can be used in the Custom Script field.
- sudo apt-get install mysql-server >> /root/mysqlinstall.txt