mirror of
https://github.com/crivion/laranode.git
synced 2026-09-03 06:24:09 +08:00
installer + create website select php version fix
This commit is contained in:
@@ -3,17 +3,9 @@
|
||||
# Exit on any error
|
||||
# set -e
|
||||
|
||||
# Prevent interactive prompts during installation
|
||||
# ONLY CHANGE: Add this line to avoid interactive prompts
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Create policy-rc.d to prevent automatic service restarts
|
||||
echo '#!/bin/sh
|
||||
exit 101' > /usr/sbin/policy-rc.d
|
||||
chmod +x /usr/sbin/policy-rc.d
|
||||
|
||||
# Configure apt to use default answers for configuration prompts
|
||||
echo 'DPkg::options { "--force-confdef"; "--force-confold"; }' > /etc/apt/apt.conf.d/local
|
||||
|
||||
echo -e "\033[34m"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Installing software-properties-common and git"
|
||||
@@ -40,8 +32,8 @@ echo -e "\033[0m"
|
||||
|
||||
apt-get install -y sysstat
|
||||
sed -i 's/ENABLED="false"/ENABLED="true"/' /etc/default/sysstat
|
||||
# Store restart for later
|
||||
SERVICES_TO_RESTART="sysstat"
|
||||
systemctl restart sysstat
|
||||
systemctl enable sysstat
|
||||
|
||||
|
||||
echo -e "\033[34m"
|
||||
@@ -52,7 +44,6 @@ echo -e "\033[0m"
|
||||
|
||||
systemctl enable apache2
|
||||
systemctl start apache2
|
||||
SERVICES_TO_RESTART="$SERVICES_TO_RESTART apache2"
|
||||
|
||||
echo -e "\033[34m"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
@@ -60,14 +51,9 @@ echo "Installing MySQL Server"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo -e "\033[0m"
|
||||
|
||||
# Pre-set MySQL root password to blank for non-interactive installation
|
||||
debconf-set-selections <<< "mysql-server mysql-server/root_password password ''"
|
||||
debconf-set-selections <<< "mysql-server mysql-server/root_password_again password ''"
|
||||
|
||||
apt install -y mysql-server
|
||||
systemctl enable mysql
|
||||
systemctl start mysql
|
||||
SERVICES_TO_RESTART="$SERVICES_TO_RESTART mysql"
|
||||
|
||||
|
||||
echo -e "\033[34m"
|
||||
@@ -109,7 +95,6 @@ apt install -y php8.4 php8.4-fpm php8.4-cli php8.4-common php8.4-curl php8.4-mbs
|
||||
php8.4-gd php8.4-imagick php8.4-intl php8.4-readline php8.4-tokenizer php8.4-fileinfo \
|
||||
php8.4-soap php8.4-opcache unzip curl
|
||||
|
||||
SERVICES_TO_RESTART="$SERVICES_TO_RESTART php8.4-fpm"
|
||||
|
||||
echo -e "\033[34m"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
@@ -163,8 +148,7 @@ echo "Restarting apache2"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo -e "\033[0m"
|
||||
|
||||
# We'll restart Apache at the end, not here
|
||||
# systemctl restart apache2
|
||||
systemctl restart apache2
|
||||
|
||||
echo -e "\033[34m"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
@@ -228,6 +212,7 @@ php artisan storage:link
|
||||
php artisan reverb:install
|
||||
|
||||
sed -i "s#VITE_REVERB_HOST=.*#VITE_REVERB_HOST=$(curl icanhazip.com)#" ".env"
|
||||
sed -i "s#REVERB_HOST=.*#REVERB_HOST=$(curl icanhazip.com)#" ".env"
|
||||
|
||||
chown -R laranode_ln:laranode_ln /home/laranode_ln/panel
|
||||
find /home/laranode_ln -type d -exec chmod 770 {} \;
|
||||
@@ -258,17 +243,9 @@ systemctl enable laranode-queue-worker.service
|
||||
systemctl enable laranode-reverb.service
|
||||
systemctl start laranode-queue-worker.service
|
||||
systemctl start laranode-reverb.service
|
||||
systemctl restart apache2
|
||||
systemctl restart php8.4-fpm
|
||||
|
||||
# Now restart all services at once
|
||||
echo -e "\033[34m"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo "Restarting all services"
|
||||
echo "--------------------------------------------------------------------------------"
|
||||
echo -e "\033[0m"
|
||||
systemctl restart apache2 php8.4-fpm
|
||||
|
||||
# Remove the policy-rc.d file to restore normal service behavior
|
||||
rm -f /usr/sbin/policy-rc.d
|
||||
|
||||
echo "================================================================================"
|
||||
echo "================================================================================"
|
||||
|
||||
@@ -175,6 +175,7 @@ export default function CreateWebsiteForm({ serverIp }) {
|
||||
onChange={(e) => setData('php_version_id', e.target.value)}
|
||||
className="mt-1 block w-full flex-1 border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 dark:focus:border-indigo-600 dark:focus:ring-indigo-600 rounded-md"
|
||||
>
|
||||
<option value={""}>-- Select --</option>
|
||||
{phpVersions.map((phpVersion) => (
|
||||
<option key={`php-version-${phpVersion.id}`} value={phpVersion.id}>{phpVersion.version}</option>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user