From 4559aefe5aff5ecbd26e4f0c2b4dfffd7349e9cb Mon Sep 17 00:00:00 2001 From: hosh1 Date: Mon, 11 Aug 2025 01:30:33 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- install.sh | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/install.sh b/install.sh index f6c2941..13d3055 100644 --- a/install.sh +++ b/install.sh @@ -494,10 +494,6 @@ cat > "$APACHE_CONF" < Require all denied - - - Require all denied - Require all denied @@ -575,8 +571,23 @@ define('DB_CHARSET', 'utf8mb4'); define('OFFICE', '/usr/bin/libreoffice'); ?> EOF + +chown $WEBSERVER_USER:$WEBSERVER_USER "$WEBROOT/db_config.php" +chmod 644 "$WEBROOT/db_config.php" + log_success "Конфигурация БД создана" +if [ ! -f "$WEBROOT/db_config.php" ]; then + log_error "Не удалось создать файл db_config.php" + exit 1 +fi + +if ! sudo -u $WEBSERVER_USER test -r "$WEBROOT/db_config.php"; then + log_warning "Веб-сервер не может прочитать db_config.php, исправляем права..." + chown $WEBSERVER_USER:$WEBSERVER_USER "$WEBROOT/db_config.php" + chmod 644 "$WEBROOT/db_config.php" +fi + DOWNLOAD_URL="https://cloud.altcor.ru/setup/download.php" TEMP_DOWNLOAD="/tmp/web_files_$(date +%s)" @@ -654,12 +665,10 @@ fi log_step "Настройка прав доступа к файлам..." chown $WEBSERVER_USER:$WEBSERVER_USER "$WEBROOT/index.php" -chmod 644 "$WEBROOT/index.php" +chmod 644 "$WEBROOT/db_config.php" +chown $WEBSERVER_USER:$WEBSERVER_USER "$WEBROOT/db_config.php" cat > "$WEBROOT/.htaccess" << 'EOF' - - Require all denied - Require all denied