#!/usr/bin/env bash # Copyright (c) 2021-2026 community-scripts ORG # Author: NĂ­colas Pastorello (opastorello) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://www.glpi-project.org/ source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 catch_errors setting_up_container network_check update_os msg_info "Installing Dependencies" $STD apt install -y \ git \ apache2 \ php8.4-{apcu,cli,common,curl,gd,ldap,mysql,xmlrpc,xml,mbstring,bcmath,intl,zip,redis,bz2,soap} \ php-cas \ libapache2-mod-php msg_ok "Installed Dependencies" setup_mariadb mariadb-tzinfo-to-sql /usr/share/zoneinfo | mariadb mysql MARIADB_DB_NAME="glpi_db" MARIADB_DB_USER="glpi" MARIADB_DB_EXTRA_GRANTS="GRANT SELECT ON \`mysql\`.\`time_zone_name\`" MARIADB_DB_CREDS_FILE="$HOME/glpi_db.creds" setup_mariadb_db fetch_and_deploy_gh_release "glpi" "glpi-project/glpi" "prebuild" "latest" "/opt/glpi" "glpi-*.tgz" msg_info "Setting Downstream file" cat </opt/glpi/inc/downstream.php /etc/glpi/local_define.php /etc/apache2/sites-available/glpi.conf ServerName localhost DocumentRoot /opt/glpi/public Require all granted RewriteEngine On RewriteCond %{HTTP:Authorization} ^(.+)$ RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L] ErrorLog \${APACHE_LOG_DIR}/glpi_error.log CustomLog \${APACHE_LOG_DIR}/glpi_access.log combined EOF $STD a2dissite 000-default.conf $STD a2enmod rewrite $STD a2ensite glpi.conf rm -rf /opt/glpi/install/install.php msg_ok "Setup Service" msg_info "Setup Cronjob" echo "* * * * * php /opt/glpi/front/cron.php" | crontab -u www-data - msg_ok "Setup Cronjob" msg_info "Update PHP Params" PHP_VERSION=$(ls /etc/php/ | grep -E '^[0-9]+\.[0-9]+$' | head -n 1) PHP_INI="/etc/php/$PHP_VERSION/apache2/php.ini" sed -i 's/^upload_max_filesize = .*/upload_max_filesize = 20M/' $PHP_INI sed -i 's/^post_max_size = .*/post_max_size = 20M/' $PHP_INI sed -i 's/^max_execution_time = .*/max_execution_time = 60/' $PHP_INI sed -i 's/^max_input_vars = .*/max_input_vars = 5000/' $PHP_INI sed -i 's/^memory_limit = .*/memory_limit = 256M/' $PHP_INI sed -i 's/^;\?\s*session.cookie_httponly\s*=.*/session.cookie_httponly = On/' $PHP_INI systemctl restart apache2 msg_ok "Update PHP Params" motd_ssh customize cleanup_lxc