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
Комментариев нет:
Отправить комментарий