- Install SQL Server: https://www.microsoft.com/en-us/sql-server/sql-server-downloads
- Install Redis: https://redis.io/docs/getting-started/installation/install-redis-on-windows/
- Visual Studio 2022
- .NET Corre SDK 6.0
- Redis management tool: https://goanother.com/
- Visual Studio Code
- NodeJS
- Open Project Solution
- Set Startup Project: TeduEcommerce.Migrator
- Open Package Manager Console windows
- Set Default Project TeduEcommerce.EntityFrameworkCore
- Run command: Update-Database -Context TeduEcommerceDbContext
- Install global tool: dotnet tool install -g Volo.Abp.Cli
- Run command on folder: TeduEcommerce.AuthServer and run abp install-libs
- Set startup project: TeduEcommerce.Admin.HttpApi.Host or set multiple startup projects
- Add .NET Source
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c 'echo -e "[packages-microsoft-com-prod]\nname=packages-microsoft-com-prod \nbaseurl= https://packages.microsoft.com/yumrepos/microsoft-rhel7.3-prod\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/dotnetdev.repo'
sudo yum update -y
sudo yum install libunwind libicu -y
sudo yum install dotnet-sdk-6.0
sudo yum install aspnetcore-runtime-6.0
sudo yum install redis -y
sudo systemctl start redis.service
sudo systemctl enable redis
sudo systemctl status redis.service
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2019.repo
sudo yum makecache
sudo yum install -y mssql-server mssql-tools unixODBC-devel
rpm -qi mssql-server
sudo /opt/mssql/bin/mssql-conf setup
sudo systemctl status sqlserver.service
sudo firewall-cmd --add-port=1433/tcp --permanent
sudo firewall-cmd --reload
- Fill password system: Abcd@123$
- Run command: sqlcmd -S localhost -U sa
- Fill passsword
- Try a command: select * from sys.database and type 'go'
sudo yum install nginx -y
sudo systemctl start nginx.service
sudo systemctl enable nginx
sudo systemctl status nginx.service
sudo systemctl reload nginx
- Go to /etc/nginx/config.d folder
- Create a new file teduecom_auth_server.conf
- Populate file content:
map $http_x_forwarded_for $real_ip {
~^(\d+\.\d+\.\d+\.\d+) $1;
default $remote_addr;
}
server {
listen 25000;
server_name _;
client_max_body_size 100M;
location / {
proxy_pass http://localhost:5000;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
fastcgi_param REMOTE_ADDR $real_ip;
}
}
- Reload NGINX
sudo systemctl reload nginx
- Create a new service and folder /home/vhost/www
cd /home/vhost/www
sudo chown nginx:nginx -R /home/vhost/www/teduecom_auth_server
sudo vi /etc/systemd/system/teduecom_auth_server.service
- Upload file
- Edit file teduecom_auth_server.service.conf:
[Unit]
Description=TEDU Auth Server
[Service]
WorkingDirectory=/home/vhost/www/teduecom_auth_server
ExecStart=/usr/bin/dotnet /home/vhost/www/teduecom_auth_server/TeduEcommerce.AuthServer.dll --urls http://localhost:5000
Restart=always
RestartSec=20 # Restart service after 10 seconds if dotnet service crashes
SyslogIdentifier=dotnet-teduecom_admin_api
User=nginx
Environment=ASPNETCORE_ENVIRONMENT=Production
[Install]
WantedBy=multi-user.target
- Start service:
sudo systemctl start teduecom_auth_server
sudo systemctl enable teduecom_auth_server.service
sudo systemctl status teduecom_auth_server
- Change service config:
systemctl daemon-reload
sudo systemctl restart teduecom_auth_server
- List all servcies with teduecom prefix:
systemctl | grep teduecom
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-service=https
sudo firewall-cmd --reload
sudo systemctl enable firewalld.service
- Run add or remove IP in CentOS
firewall-cmd --permanent --zone=public --add-port=25000/tcp
firewall-cmd --zone=public --list-ports
sudo firewall-cmd --reload
firewall-cmd --permanent --zone=public --remove-port=1431/tcp
- Update code need restart
sudo systemctl restart teduecom_auth_server
- Disable Selinux: Turn off access management in Linux
sudo vi /etc/sysconfig/selinux
- Find SELINUX=enforcing and replace it with SELINUX=disabled
- Save file: Press ESC and type :w and :q to save and quit.
- Reboot system
sudo reboot