From 338694f565bbd493cd4a88fa6391eefff9b618cc Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Mon, 22 Dec 2025 21:37:28 +0000 Subject: [PATCH] wip: 2025-12-22T21:37:28+0000 (1766439448) --- .local/bin/vlw_install_programs | 76 +++++++++++---------------------- 1 file changed, 24 insertions(+), 52 deletions(-) diff --git a/.local/bin/vlw_install_programs b/.local/bin/vlw_install_programs index 71d70f9..3ef9e23 100755 --- a/.local/bin/vlw_install_programs +++ b/.local/bin/vlw_install_programs @@ -1,26 +1,12 @@ #!/bin/bash install_packages() { - local PACKAGES=( - "jq" - "git" - "curl" - ) - - # Create a string with the package names separated by spaces - local package_list="${PACKAGES[*]}" - sudo apt update - sudo apt install -y $package_list + sudo apt install -y jq git curl tmux } install_mariadb() { - local PACKAGES=( - "mysql-client" - "mariadb-server" - ) - - sudo apt install $PACKAGES[*] + sudo apt install -y default-mysql-client mariadb-server # Create a database user for the webserver sudo mysql -u root -e "CREATE USER 'www-data'@'localhost' IDENTIFIED WITH unix_socket; GRANT ALL PRIVILEGES ON *.* TO 'www-data'@'localhost' WITH GRANT OPTION; FLUSH PRIVILEGES;" @@ -68,16 +54,8 @@ install_reflect() { install_webserver() { local WWW_PATH="/var/www" local PATH_NGINX="/etc/nginx" - local PACKAGES=( - "nginx" - "composer" - ) - #sudo apt install $PACKAGES[*] - # Create a string with the package names separated by spaces - local package_list="${PACKAGES[*]}" - - sudo apt install -y $package_list + sudo apt install -y nginx composer sudo mkdir $WWW_PATH/fw sudo mkdir $WWW_PATH/libs @@ -89,18 +67,21 @@ install_webserver() { # Download default configs sudo curl -o $PATH_NGINX/snippets/vlw.se-ssl.conf https://git.vlw.se/config/nginx-dev/raw/branch/master/snippets/vlw.se-ssl.conf - sudo curl -o $PATH_NGINX/sites-available/44300.conf https://git.vlw.se/config/nginx-dev/raw/branch/master/sites-available/44300.conf - sudo curl -o $PATH_NGINX/sites-available/44301.conf https://git.vlw.se/config/nginx-dev/raw/branch/master/sites-available/44301.conf - sudo curl -o $PATH_NGINX/sites-available/44302.conf https://git.vlw.se/config/nginx-dev/raw/branch/master/sites-available/44302.conf + sudo curl -o $PATH_NGINX/snippets/fastcgi-php.conf https://git.vlw.se/config/nginx-dev/raw/branch/master/snippets/fastcgi-php.conf + sudo curl -o $PATH_NGINX/sites-available/8001.conf https://git.vlw.se/config/nginx-dev/raw/branch/master/sites-available/8001.conf + sudo curl -o $PATH_NGINX/sites-available/8002.conf https://git.vlw.se/config/nginx-dev/raw/branch/master/sites-available/8002.conf + sudo curl -o $PATH_NGINX/sites-available/8003.conf https://git.vlw.se/config/nginx-dev/raw/branch/master/sites-available/8003.conf - sudo rm /etc/nginx/sites-enabled/44300.conf - sudo rm /etc/nginx/sites-enabled/44301.conf - sudo rm /etc/nginx/sites-enabled/44302.conf - sudo ln -s /etc/nginx/sites-available/44300.conf /etc/nginx/sites-enabled - sudo ln -s /etc/nginx/sites-available/44301.conf /etc/nginx/sites-enabled - sudo ln -s /etc/nginx/sites-available/44302.conf /etc/nginx/sites-enabled + sudo rm /etc/nginx/sites-enabled/8001.conf + sudo rm /etc/nginx/sites-enabled/8002.conf + sudo rm /etc/nginx/sites-enabled/8003.conf + sudo ln -s /etc/nginx/sites-available/8001.conf /etc/nginx/sites-enabled + sudo ln -s /etc/nginx/sites-available/8002.conf /etc/nginx/sites-enabled + sudo ln -s /etc/nginx/sites-available/8003.conf /etc/nginx/sites-enabled sudo chown $(whoami):www-data -R $WWW_PATH + + sudo systemctl restart nginx } install_pma() { @@ -115,15 +96,6 @@ install_pma() { install_php_fpm() { local PHP_VERSION="8.4" local PHP_INI_PATH="/etc/php/$PHP_VERSION/fpm/php.ini" - local PACKAGES=( - "lsb-release" - "ca-certificates" - - "php$PHP_VERSION-fpm" - "php$PHP_VERSION-mysql" - "php$PHP_VERSION-xdebug" - "php$PHP_VERSION-mbstring" - ) # https://packages.sury.org/php/README.txt sudo curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb @@ -132,7 +104,7 @@ install_php_fpm() { # Install packages sudo apt update - sudo apt install $PACKAGES[*] + sudo apt -y install lsb-release ca-certificates php$PHP_VERSION-fpm php$PHP_VERSION-mysql php$PHP_VERSION-xdebug php$PHP_VERSION-mbstring php$PHP_VERSION-intl # Make a backup of the php.ini file sudo cp -p "$PHP_INI_PATH" "$PHP_INI_PATH~" @@ -154,11 +126,11 @@ install_code_server() { done } -#install_packages -#install_php_fpm -#install_webserver -#install_vegvisir -#install_reflect -#install_pma -#install_mariadb -#install_code_server +install_packages +install_php_fpm +install_webserver +install_vegvisir +install_reflect +install_pma +install_mariadb +install_code_server