sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get update
wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y dotnet-sdk-6.0
sudo apt-get install apache2
cd /etc/apache2
mkdir ssl
cd ssl
sudo openssl req -new -x509 -days 1461 -nodes -out cert.pem -keyout cert.key -subj "/C=RU/ST=Msk/L=Msk/O=YourCompany/OU=IT Department/CN=master.yourcompany.local/CN=master"
sudo a2enmod proxy_http proxy_html proxy_wstunnel ssl
sudo a2enmod rewrite
sudo systemctl restart apache2
sudo nano /etc/apache2/conf-enabled/netcore.conf
<VirtualHost *:443>
ServerName www.CurrentDomain.com
DocumentRoot /var/pixmaster
SSLEngine on
SSLCertificateFile ssl/cert.pem
SSLCertificateKeyFile ssl/cert.key
#SSLCertificateChainFile ssl/cert.ca-bundle
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:5000/
ProxyPassReverse / http://127.0.0.1:5000/
RewriteEngine on
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteCond %{HTTP:UPGRADE} ^WebSocket$ [NC]
RewriteCond %{HTTP:CONNECTION} Upgrade$ [NC]
RewriteRule /(.*) ws://127.0.0.1:5000/$1 [P]
ErrorLog /var/log/apache2/netcore-error.log
CustomLog /var/log/apache2/netcore-access.log common
</VirtualHost>
sudo apachectl configtest
sudo service apache2 restart
sudo service apache2 status
sudo apt update
sudo apt install docker.io
sudo systemctl start docker
sudo systemctl enable docker
sudo docker pull postgres
sudo docker run -d --restart unless-stopped --name pix-postgres -e POSTGRES_PASSWORD=123456789 -d -p 5432:5432 -v $HOME/docker/volumes/postgres:/var/lib/postgresql/data postgres
{
"Provider": "PostgreSQL",
"CryptographyKeysFolder": "Keys",
"ConnectionStrings": {
"DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=master_test;Trusted_Connection=True;MultipleActiveResultSets=true;Persist Security Info=False;",
"PostgreSqlConnection": "User ID=postgres;Password=123456789;Host=localhost;Port=5432;Database=master_test;Pooling=true;"
},
"Logging": {
"LogLevel": {
"Default": "Warning",
"Hangfire": "Information"
}
},
"AllowedHosts": "*",
"PasswordValidationOptions": {
"RequiredLength": "8",
"RequireNonAlphanumeric": "true",
"RequireLowercase": "true",
"RequireUppercase": "true",
"RequireDigit": "true"
},
"UseSwagger": "false"
}
sudo mkdir /var/pixmaster/Keys
sudo chmod 777 /var/pixmaster/Keys
sudo mkdir MasterLog
sudo chmod 777 MasterLog
sudo cp -a <folder> <target folder>
sudo cp -a /home/user/pix-master/ /var/pixmaster
sudo nano /etc/systemd/system/Master.service
# Master.service - the name of the service for the project.
[Unit]
Description=ASP .NET Web Application
[Service]
#Specify the path to the directory where the Master is installed
WorkingDirectory=/var/pixmaster
ExecStart=/usr/bin/dotnet /var/pixmaster/Master.dll
Restart=always
RestartSec=10
SyslogIdentifier=netcore-demo
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target
sudo systemctl enable Master.service
sudo systemctl start Master.service
sudo service apache2 status
sudo journalctl -fu Master.service