From 9c520392862a3ff622fc811fa3e401ebdbf69962 Mon Sep 17 00:00:00 2001 From: Tommy Date: Fri, 26 Jul 2024 07:28:58 -0700 Subject: [PATCH] Add RHEL 9 LEMP setup --- sample-scripts/RHEL-9-LEMP.sh | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 sample-scripts/RHEL-9-LEMP.sh diff --git a/sample-scripts/RHEL-9-LEMP.sh b/sample-scripts/RHEL-9-LEMP.sh new file mode 100644 index 0000000..15c797f --- /dev/null +++ b/sample-scripts/RHEL-9-LEMP.sh @@ -0,0 +1,52 @@ +#!/bin/sh + +# Copyright (C) 2024 Thien Tran +# +# Licensed under the Apache License, Version 2.0 (the "License"); you may not +# use this file except in compliance with the License. You may obtain a copy of +# the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations under +# the License. + +# Assumes that it is run AFTER https://github.com/TommyTran732/Linux-Setup-Scripts/blob/main/RHEL.sh + +set -eu + +output(){ + printf '\e[1;34m%-6s\e[m\n' "${@}" +} + +unpriv(){ + sudo -u nobody "$@" +} + +# Remove hardened_malloc (It breaks php-fpm) +sudo dnf remove hardened_malloc + +# Install NGINX +unpriv curl -s https://raw.githubusercontent.com/TommyTran732/Linux-Setup-Scripts/main/etc/yum.repos.d/nginx.repo | sudo tee /etc/yum.repos.d/nginx.repo +sudo chmod 644 /etc/yum.repos.d/nginx.repo +sudo dnf install -y nginx + +# Install certbot +sudo dnf install -y certbot + +# Install PHP +sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms +sudo dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-9.rpm +sudo dnf module install -y php:remi-8.3/common +sudo systemctl enable --now php-fpm + +# Install MariaDB +unpriv curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash +sudo dnf install -y MariaDB-server + +# Run NGINX Setup script +unpriv curl -LsS https://raw.githubusercontent.com/TommyTran732/NGINX-Configs/main/setup.sh | sudo bash \ No newline at end of file