#!/bin/bash VERSION="1.1.7" SCRIPT_NAME="Apache Install" . /usr/src/k_framework/main.sh k_config_details k_detect_os k_start yum -y install httpd httpd-devel anacron apr-util-devel chmod 555 /var/log/httpd chmod -R 666 /var/log/httpd if [[ "$GUI_PRESENT" == "1" ]]; then k_service_enable httpd fi if [[ $SYSTEM_CONFIG_DIR="m2" && $ROCKY9 == 1 ]]; then ln -s /home/m4/public /var/www/html/billing else ln -s /home/$SYSTEM_CONFIG_DIR/public /var/www/html/billing fi if [[ $centos_version == 7 || $ROCKY9 == 1 ]]; then report "Fixing PrivateTmp" 3 if grep -Fq 'PrivateTmp=true' /usr/lib/systemd/system/httpd.service 2>/dev/null; then sed -i "s|PrivateTmp=true\+|PrivateTmp=false|g" /usr/lib/systemd/system/httpd.service if grep -Fq 'PrivateTmp=false' /usr/lib/systemd/system/httpd.service; then systemctl daemon-reload systemctl restart httpd.service report "PrivateTmp set to false in /usr/lib/systemd/system/httpd.service" 0 else report "Unable to set PrivateTmp=false in /usr/lib/systemd/system/httpd.service" 2 EXIT_CODE=1 fi fi chmod +t /tmp fi # proper logrotate cp -fr /usr/src/k_framework/helpers/gui/httpd_logrotate /etc/logrotate.d/httpd if [[ "$GUI_PRESENT" == "1" ]]; then systemctl restart httpd fi k_exit $EXIT_CODE