1
0

Обновить hestiacp_install

This commit is contained in:
kosenka 2025-04-08 14:21:41 +03:00
parent d0adcaeec9
commit 9f8722c75e

View File

@ -67,6 +67,10 @@ save and exit
# v-change-web-domain-backend-tpl $USERNAME $DOMAIN $TEMPLATE
get password for Postgres
# grep -Eo "PASSWORD='[a-zA-Z0-9]+'" /usr/local/hestia/conf/pgsql.conf | awk -F "PASSWORD=" '{print $2}' | awk -F "'" '{print $2}'
*** relogin as $USERNAME
# cd /home/$USERNAME/web/$DOMAIN/public_html/
@ -76,8 +80,80 @@ save and exit
# php composer.phar install
# touch /home/$USERNAME/web/$DOMAIN/public_html/config/params-local.php
# touch /home/$USERNAME/web/$DOMAIN/public_html/config/dbEIS.php
<?php
use yii\db\Connection;
use yii\db\pgsql\Schema;
return [
'class' => Connection::class,
'dsn' => 'pgsql:host=localhost;dbname=$DB_NAME',
'username' => '$DB_USER',
'password' => '$DB_PASSWORD',
'schemaMap' => [
'pgsql' => [
'class' => Schema::class,
'defaultSchema' => 'public', //specify your schema here, public is the default schema
],
],
// Schema cache options (for production environment)
'enableSchemaCache' => !YII_DEBUG,
'schemaCacheDuration' => 3600,
'schemaCache' => 'cache',
'enableQueryCache' => true,
'queryCacheDuration' => 3600,
];
# touch /home/$USERNAME/web/$DOMAIN/public_html/config/dbPG.php
<?php
use yii\db\Connection;
use yii\db\pgsql\Schema;
return [
'class' => Connection::class,
'dsn' => 'pgsql:host=localhost;dbname=$DB_NAME',
'username' => '$DB_USER',
'password' => '$DB_PASSWORD',
'schemaMap' => [
'pgsql' => [
'class' => Schema::class,
'defaultSchema' => 'public', //specify your schema here, public is the default schema
],
],
// Schema cache options (for production environment)
'enableSchemaCache' => !YII_DEBUG,
'schemaCacheDuration' => 3600,
'schemaCache' => 'cache',
'enableQueryCache' => true,
'queryCacheDuration' => 3600,
];
# sudo su -
# v-change-web-domain-docroot $USERNAME $DOMAIN $DOMAIN web
# touch /home/admin/conf/web/$DOMAIN/nginx.ssl.conf_my
# mcedit /home/admin/conf/web/$DOMAIN/nginx.ssl.conf_my
location ~* ^.+\.(pdf|doc|docx|xls|xlsx|ppt|pptx)$ {
proxy_pass https://$IP_ADDRESS:8443;
add_header Last-Modified "";
add_header Cache-Control 'no-store, no-cache';
if_modified_since off;
expires off;
etag off;
try_files $uri @fallback;
}
add_header X-Frame-Options SAMEORIGIN;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy "no-referrer-when-downgrade";
add_header X-XSS-Protection "1; mode=block";
add_header Permissions-Policy "geolocation=(),midi=(),microphone=(),camera=(),magnetometer=(),gyroscope=(),fullscreen=*,payment=()";
add_header Content-Secutiry-Policy "upgrade-insecure-requests";
save and exit
# exit