Fixing vhost
This commit is contained in:
22
installer.sh
22
installer.sh
@ -43,15 +43,16 @@ set -e
|
|||||||
# Variables
|
# Variables
|
||||||
DEBIAN_FRONTEND=noninteractive
|
DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# Add OpenLiteSpeed repository
|
|
||||||
wget -qO - https://repo.litespeed.sh | bash
|
|
||||||
|
|
||||||
# Update system
|
# Update system
|
||||||
apt upgrade -y
|
apt update && apt upgrade -y
|
||||||
|
|
||||||
# Install essentials
|
# Install essentials
|
||||||
apt install -y curl wget gnupg2 software-properties-common lsb-release unzip htop ufw fail2ban
|
apt install -y curl wget gnupg2 software-properties-common lsb-release unzip htop ufw fail2ban
|
||||||
|
|
||||||
|
# Add OpenLiteSpeed repository
|
||||||
|
# Needs to happen after curl is installed
|
||||||
|
wget -qO - https://repo.litespeed.sh | bash
|
||||||
|
|
||||||
# Required to compile PHP
|
# Required to compile PHP
|
||||||
apt install -y pkg-config build-essential libxml2 libxml2-dev php-dev autoconf automake libtool
|
apt install -y pkg-config build-essential libxml2 libxml2-dev php-dev autoconf automake libtool
|
||||||
# Required by virtual:world
|
# Required by virtual:world
|
||||||
@ -76,8 +77,11 @@ systemctl start lsws
|
|||||||
sleep 2
|
sleep 2
|
||||||
|
|
||||||
# PHP and extensions
|
# PHP and extensions
|
||||||
PHPVER='8.2'
|
PHPVER='8.3'
|
||||||
apt install -y lsphp${PHPVER//./} lsphp${PHPVER//./}-{common,mysql,curl,imagick,intl,opcache,redis} php$PHPVER-cli
|
apt install -y lsphp${PHPVER//./} lsphp${PHPVER//./}-{common,mysql,curl,imagick,intl,opcache,redis}
|
||||||
|
|
||||||
|
# Create a symlink that gives PHP CLI capability but uses the LSPHP version of PHP to coincide with server
|
||||||
|
ln -s /usr/local/lsws/lsphp83/bin/php /usr/local/bin/php
|
||||||
|
|
||||||
systemctl stop lsws
|
systemctl stop lsws
|
||||||
# Set lsphp as default for LiteSpeed
|
# Set lsphp as default for LiteSpeed
|
||||||
@ -161,7 +165,7 @@ chmod 700 /usr/local/lsws/conf/vhosts/${HTMLSITE_CONF}
|
|||||||
chmod 600 /usr/local/lsws/conf/vhosts/${HTMLSITE_CONF}/vhconf.conf
|
chmod 600 /usr/local/lsws/conf/vhosts/${HTMLSITE_CONF}/vhconf.conf
|
||||||
|
|
||||||
# Map listeners to html-site instead of Example
|
# Map listeners to html-site instead of Example
|
||||||
sed -i 's/vhMap.*Example.*/vhMap ${HTMLSITE_CONF} */' /usr/local/lsws/conf/httpd_config.conf
|
##sed -i "s|^[[:space:]]*vhMap[[:space:]]\\+Example[[:space:]]\\+| vhMap ${HTMLSITE_CONF} *|" /usr/local/lsws/conf/httpd_config.conf
|
||||||
|
|
||||||
# Delete the broken Example vhost
|
# Delete the broken Example vhost
|
||||||
if [[ -e /usr/local/lsws/conf/vhosts/Example ]]; then
|
if [[ -e /usr/local/lsws/conf/vhosts/Example ]]; then
|
||||||
@ -209,8 +213,8 @@ listener SSL {
|
|||||||
secure 1
|
secure 1
|
||||||
keyFile /etc/ssl/litespeed/selfsigned.key
|
keyFile /etc/ssl/litespeed/selfsigned.key
|
||||||
certFile /etc/ssl/litespeed/selfsigned.crt
|
certFile /etc/ssl/litespeed/selfsigned.crt
|
||||||
vhRoot /var/www/html/
|
vhRoot /var/www/html
|
||||||
vhMap Example *
|
vhMap $HTMLSITE_CONF *
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user