Skip to content

Instantly share code, notes, and snippets.

@kstan79
kstan79 / build_ubuntu1804_php7withmariadbclient.sh
Last active August 5, 2019 23:42
This file allow us to use native client instead of mysqlnd so that php can use custom mariadb authentication like pam_unix or pam_gssapi
#!/bin/bash
#preparing mariadb client
sudo apt-get install software-properties-common
sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xF1656F24C74CD1D8
sudo add-apt-repository 'deb [arch=amd64,arm64,i386,ppc64el] http://download.nus.edu.sg/mirror/mariadb/repo/10.3/ubuntu xenial main'
# install basic package, ensure basic function of php/apache/mysql is working properly
sudo apt install apache2 libapache2-mod-php7.2 php7.2 php7.2-cli php7.2-mysql git libmysqlclient20 libmysqlclient-dev php7.2-dev
@kstan79
kstan79 / patchphp_for_percona_pam.sh
Last active March 18, 2023 09:46
Allow Ubuntu PHP application connect to Percona/MariaDB PAM Authenticate Backend
#!/bin/bash
# install basic package, ensure basic function of php/apache/mysql is working properly
sudo apt install apache2 libapache2-mod-php7.0 php7.0 php7.0-cli php7.0-mysql git libmysqlclient20 libmysqlclient-dev php7.0-dev
# to support PAM, we need to use percona server/client
wget https://repo.percona.com/apt/percona-release_0.1-4.$(lsb_release -sc)_all.deb
sudo dpkg -i percona-release_0.1-4.$(lsb_release -sc)_all.deb
sudo apt-get update
@kstan79
kstan79 / setup_ubuntuwebserver_for_enterprise.sh
Created February 8, 2018 11:20
Setup Ubuntu For Enterprise Environment
#!/bin/bash
# this script assume enterprise manage ubuntu web server with following tools
# 1. authenticate credential via freeipa
# 2. monitor by zabbix
# 3. running apache2, with ssl enable
sudo apt update
sudo apt dist-upgrade
sudo apt install freeipa-client zabbix-agent apache2