1
0
mirror of https://github.com/tommytran732/Linux-Setup-Scripts synced 2024-11-08 19:21:33 -05:00
Linux-Setup-Scripts/sample-scripts/RHEL-9-LEMP.sh

53 lines
1.7 KiB
Bash
Raw Normal View History

2024-07-26 10:28:58 -04:00
#!/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 > /dev/null
2024-07-26 10:28:58 -04:00
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"
2024-07-26 10:28:58 -04:00
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