Фикс
This commit is contained in:
25
install.sh
25
install.sh
@@ -494,10 +494,6 @@ cat > "$APACHE_CONF" <<EOF
|
||||
<Files "*.conf">
|
||||
Require all denied
|
||||
</Files>
|
||||
|
||||
<Files "db_config.php">
|
||||
Require all denied
|
||||
</Files>
|
||||
|
||||
<Files ".htaccess">
|
||||
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'
|
||||
<Files "db_config.php">
|
||||
Require all denied
|
||||
</Files>
|
||||
|
||||
<Files "*.conf">
|
||||
Require all denied
|
||||
|
||||
Reference in New Issue
Block a user