Skip to content

Instantly share code, notes, and snippets.

@hussainweb
Created October 8, 2024 00:32
Show Gist options
  • Save hussainweb/c9a5e074c229e6c7193c806b8effa377 to your computer and use it in GitHub Desktop.
Save hussainweb/c9a5e074c229e6c7193c806b8effa377 to your computer and use it in GitHub Desktop.
cloud-init config for a server with PHP 8.1 and MariaDB
#cloud-config
users:
- name: hw
shell: /bin/bash
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh_import_id:
- gh:hussainweb
disable_root: true
package_update: true
package_upgrade: true
package_reboot_if_required: true
apt:
preserve_sources_list: true
sources:
mariadb:
keyid: 177F4010FE56CA3336300305F1656F24C74CD1D8
keyserver: keyserver.ubuntu.com
source: deb [arch=amd64,arm64,ppc64el] http://nyc2.mirrors.digitalocean.com/mariadb/repo/11.4/ubuntu jammy main
packages:
- apache2
- bottom
- certbot
- curl
- git
- htop
- jq
- unzip
- vim
- wget
- php8.1
- php8.1-common
- php8.1-mbstring
- php8.1-mysql
- php8.1-xml
- php8.1-zip
- php8.1-curl
- php8.1-gd
- php8.1-intl
- php8.1-opcache
- mariadb-server
- mariadb
runcmd:
- 'systemctl enable apache2'
- 'systemctl start apache2'
- 'a2enmod rewrite'
- 'a2enmod headers'
- 'a2enmod ssl'
- 'systemctl restart apache2'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment