console
$ curl "https://api.vultr.com/v2/startup-scripts" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"name" : "Sample-Script",
"type" : "pxe",
"script" : "QmFzZTY0IEV4YW1wbGUgRGF0YQ=="
}'
console
$ curl "https://api.vultr.com/v2/startup-scripts" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
console
$ nano scripts.yaml
yaml
mkdir ~/my-apps
chmod 700 ~/my-apps
console
$ echo -n "$(<scripts.yaml)" | base64
console
$ vultr-cli script create \
--name Sample-Script \
--type boot \
--script bWtkaXIgfi9teS1hcHBzCmNobW9kIDcwMCB+L215LWFwcHM=
console
$ vultr-cli script list
console
$ vultr-cli script get script_id
Run vultr-cli script create --help to view all options.terraform
resource "vultr_startup_script" "boot" {
name = "Sample-Script"
type = "boot" # boot | pxe
script = <<-EOT
#!/bin/sh
mkdir -p /opt/my-apps
chmod 700 /opt/my-apps
EOT
}
terraform
resource "vultr_instance" "server" {
region = "ewr"
plan = "vc2-2c-4gb"
label = "scripted"
# Option A: user_data cloud-init
user_data = <<-EOT
#cloud-config
runcmd:
- echo "Hello from cloud-init" > /root/hello.txt
EOT
# Option B: associate the startup script
script_id = vultr_startup_script.boot.id
}
console
$ curl "https://api.vultr.com/v2/startup-scripts" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
console
$ curl "https://api.vultr.com/v2/startup-scripts/script_id" \
-X DELETE \
-H "Authorization: Bearer ${VULTR_API_KEY}"
console
$ vultr-cli script list
console
$ vultr-cli script delete script_id
terraform
resource "vultr_startup_script" "boot" {
name = "Sample-Script"
type = "boot" # boot | pxe
script = "#!/bin/sh\necho hi\n"
}
# host id-00.kaid.plesk.com
id-00.kaid.plesk.com is an alias for ka.plesk.com.
ka.plesk.com has address 195.214.233.82
ka.plesk.com has address 195.214.233.80
ka.plesk.com has address 195.214.233.81
c: /> nslookup id-00.kaid.plesk.com
Server: UnKnown
Address: 2620:0:28a9:4::1
Non-authoritative answer:
Name: ka.plesk.com
Addresses: 195.214.233.81
195.214.233.80
195.214.233.82
Aliases: id-00.kaid.plesk.com
# apt install nmap -y
..........
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Could not connect to archive.ubuntu.com:80 (203.0.113.2), - connection timed out [IP: 203.0.113.2 80]
..........
#wget https://ext.plesk.com
--2024-07-09 22:43:42-- https://ext.plesk.com/
Resolving ext.plesk.com (ext.plesk.com)... 79.127.235.11, 79.127.235.9, 79.127.213.245, ...
Connecting to ext.plesk.com (ext.plesk.com)|79.127.235.11|:443... connected.
WARNING: Could not save SSL session data for socket 3
Failed writing HTTP request: The specified session has been invalidated for some reason..
Retrying.
..........
c: /> curl https://ext.plesk.com
curl: (28) Failed to connect to ext.plesk.com port 443 after 21048 ms: Couldn't connect to server
[Mon Jan 22 13:27:01.735290 2024] [proxy_fcgi:error] [pid 9494:tid 139778703505152] [client 203.0.113.2:33400] AH01071: Got error 'PHP message: PHP Warning: Undefined array key "example" in /var/www/vhosts/example.com/httpdocs/example.php on line 83', referer: https://www.google.com
[Mon Jan 22 13:31:37.083939 2024] [proxy_fcgi:error] [pid 9494:tid 139778703505152] [client 203.0.113.2:35648] AH01071: Got error 'Primary script unknown'
[Mon Jan 22 13:32:44.573579 2024] [proxy_fcgi:error] [pid 9937:tid 139778586007296] [client 23.26.220.23:36104] AH01071: Got error 'Primary script unknown'
[Mon Jan 22 13:45:05.394552 2024] [security2:error] [pid 9494:tid 139778686719744] [client 78.153.140.218:39198] [client 203.0.113.3] ModSecurity: Access denied with code 403 (phase 1). Matched phrase "/.env" at REQUEST_URI. [file "/etc/httpd/conf/modsecurity.d/rules/comodo_free/02_Global_Generic.conf"] [line "117"] [id "210492"] [rev "3"] [severity "CRITICAL"] [tag "CWAF"] [tag "Generic"] [hostname "example.com"] [uri "/.env"] [unique_id "Za5VQR8pThynFWOzfw6jvgAAAIU"]
[Mon Jan 22 14:17:19.763567 2024] [proxy_fcgi:error] [pid 9494:tid 139778560829184] [client 203.0.113.4:45854] AH01071: Got error 'Primary script unknown'
[Mon Jan 22 14:19:21.361552 2024] [proxy_fcgi:error] [pid 9937:tid 139778594400000] [client 203.0.113.4:46832] AH01071: Got error 'PHP message: PHP Warning: Undefined variable $newPass in /var/www/vhosts/example.com/httpdocs/mailfiles/orderConfirm.php on line 17', referer: https://example.com/
[Mon Jan 22 14:23:49.363204 2024] [proxy_fcgi:error] [pid 9937:tid 139778577614592] [client 203.0.113.6:48482] AH01071: Got error 'Primary script unknown', referer: https://example.net/contact-us
[Mon Jan 22 14:23:50.963476 2024] [proxy_fcgi:error] [pid 9563:tid 139778728683264] [client 203.0.113.6:48486] AH01071: Got error 'Primary script unknown', referer: https://example.net/contact
[Mon Jan 22 15:11:20.941118 2024] [proxy_fcgi:error] [pid 27558:tid 139778632750848] [client 203.0.113.3:57112] AH01071: Got error 'Primary script unknown'
[Mon Jan 22 15:24:08.490614 2024] [proxy_fcgi:error] [pid 31177:tid 139778606368512] [client 203.0.113.3:58942] AH01071: Got error 'Primary script unknown', referer: https://example.com/example.php
# systemctl status nginx
* nginx.service - Startup script for nginx service
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
Drop-In: /usr/lib/systemd/system/nginx.service.d
`-limit_nofile.conf
Active: failed (Result: exit-code) since Wed 2022-05-11 12:04:22 CEST; 4s ago
Process: 44106 ExecStartPre=/bin/sh -c [ '${NGINX_ENABLED}' = 'yes' ] || { echo Not starting nginx as it is disabled in Plesk. Run 'plesk sbin nginxmng -e' to enable nginx in Plesk.; exit 1; } (code=exited, status=1/FAILURE)
May 11 12:04:22 publicamedia.net systemd[1]: Starting Startup script for nginx service...
May 11 12:04:22 publicamedia.net sh[44106]: Not starting nginx as it is disabled in Plesk. Run 'plesk sbin nginxmng -e' to enable nginx in Plesk.
May 11 12:04:22 publicamedia.net systemd[1]: nginx.service: control process exited, code=exited status=1
May 11 12:04:22 publicamedia.net systemd[1]: Failed to start Startup script for nginx service.
May 11 12:04:22 publicamedia.net systemd[1]: Unit nginx.service entered failed state.
May 11 12:04:22 publicamedia.net systemd[1]: nginx.service failed.
# docker run ymuski/curl-http3 curl --http3-only -ksSLI https://example.com
HTTP/3 200
server: nginx
date: Tue, 28 May 2024 16:36:45 GMT
content-type: text/html
content-length: 1653
x-accel-version: 0.01
last-modified: Thu, 16 May 2024 10:16:15 GMT
etag: "675-6188f867a0a22"
accept-ranges: bytes
alt-svc: h3=":443"; ma=86400
x-powered-by: PleskLin
[Wed Jul 19 11:25:22.455351 2023] [fcgid:warn] [pid 29789:tid 139629537761024] [client 203.0.113.2:0] mod_fcgid: stderr: Connection refused
[Wed Jul 19 11:25:22.455389 2023] [fcgid:warn] [pid 29789:tid 139629537761024] [client 203.0.113.2:0] mod_fcgid: stderr: Connection refused
[Wed Jul 19 11:25:22.455392 2023] [fcgid:warn] [pid 29789:tid 139629537761024] [client 203.0.113.2:0] mod_fcgid: stderr: Connection refused
[Wed Jul 19 11:25:22.455399 2023] [fcgid:warn] [pid 29789:tid 139629537761024] [client 203.0.113.2:0] mod_fcgid: stderr: Connection refused
[Wed Jul 19 11:25:22.455403 2023] [fcgid:warn] [pid 29789:tid 139629537761024] [client 203.0.113.2:0] mod_fcgid: stderr: Connection refused
203.0.113.2 - - [19/Jul/2023:11:25:24 +0200] "POST /blog/wp-cron.php HTTP/1.0" 200 871 "-" "WordPress/6.2.2; https://example.com/blog"
203.0.113.2 - - [19/Jul/2023:11:25:24 +0200] "GET /blog/ HTTP/1.0" 200 17171 "-" "WordPress/6.2.2; https://example.com/blog"
203.0.113.2 - - [19/Jul/2023:11:25:24 +0200] "GET /blog/ HTTP/1.0" 200 17171 "-" "WordPress/6.2.2; https://example.com/blog"
203.0.113.2 - - [19/Jul/2023:11:25:24 +0200] "GET /blog/ HTTP/1.0" 200 17171 "-" "WordPress/6.2.2; https://example.com/blog"
203.0.113.2 - - [19/Jul/2023:11:25:24 +0200] "GET /blog/ HTTP/1.0" 200 17171 "-" "WordPress/6.2.2; https://example.com/blog"
203.0.113.2 - - [19/Jul/2023:11:25:24 +0200] "GET /blog/ HTTP/1.0" 200 17171 "-" "WordPress/6.2.2; https://example.com/blog"
203.0.113.2 - - [19/Jul/2023:11:25:19 +0200] "POST /blog/wp-cron.php?doing_wp_cron=1689758719.9299299716949462890625 HTTP/1.0" 200 871 "-" "WordPress/6.2.2; https://example.com/blog"