среда, 7 июня 2017 г.

GCP Infrastructure: Deploy Instances and Apps by Console and Command-Line

Under Management, disk, networking, SSH keys > Management copy the following lines to the startup script to install and configure an Apache web server with a custom welcome page.
#! /bin/bash
VALUE_OF_GREETING=$(curl http://metadata.google.internal/computeMetadata/v1/instance/attributes/greeting -H "Metadata-Flavor: Google")
apt-get update
apt-get install -y apache2
cat <<EOF > /var/www/html/index.html
<html><body><h1>Hello from $VALUE_OF_GREETING</h1>
<p>This page was created from a simple startup script!</p>
</body></html>
EOF

Комментариев нет:

Отправить комментарий

Bash: MySql backup (file per db), restore+ users and privileges

Backup Mysql DB (file per db) #!/bin/bash USER="root" databases=`mysql -u $USER -e "SHOW DATABASES;" | tr -d "|...