0% found this document useful (0 votes)
23 views8 pages

Deployment Guide

This document is a comprehensive deployment guide for applications built with Spring Boot, Angular, and .NET on a Windows Server 2016 environment. It covers preparation steps, software installation, database setup, application deployment, security configuration, automation, monitoring, testing, troubleshooting, and maintenance procedures. The guide provides detailed instructions for each step to ensure a successful deployment and operation of the applications.

Uploaded by

Sushant Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views8 pages

Deployment Guide

This document is a comprehensive deployment guide for applications built with Spring Boot, Angular, and .NET on a Windows Server 2016 environment. It covers preparation steps, software installation, database setup, application deployment, security configuration, automation, monitoring, testing, troubleshooting, and maintenance procedures. The guide provides detailed instructions for each step to ensure a successful deployment and operation of the applications.

Uploaded by

Sushant Kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Comprehensive Deployment Guide for Spring

Boot, Angular, and .NET Application

1. Preparing the Windows Server 2016 Environment

1.1 Connect to Your Azure Windows Server

• Use Remote Desktop to connect to your VM with credentials provided by


your DevOps team
• Ensure the server has internet connectivity
• Check server specifications (RAM, CPU, Disk space) to ensure they meet
your application requirements

1.2 Install Required Software

1.2.1 Install SQL Server


1. Download SQL Server 2019 or 2022 Express/Standard (or the version
matching your development environment)
2. Run the installer and select:
• Database Engine Services
• Management Tools
3. Choose Mixed Mode Authentication during setup
4. Set a strong password for the ‘sa’ account
5. Complete the installation

1.2.2 Install Java for Spring Boot


1. Download JDK 11 (matching your pom.xml configuration) from Oracle or
AdoptOpenJDK
2. Run the installer with default settings
3. Set environment variables: JAVA_HOME=C:\Program Files\Java\jdk-11
PATH=%PATH%;%JAVA_HOME%\bin
4. Verify installation with: java -version

1.2.3 Install .NET 6 SDK


1. Download .NET 6 SDK from Microsoft
2. Run the installer with default options
3. Verify installation with: dotnet --version

1
1.2.4 Install Web Server - IIS
1. Open Server Manager
2. Click “Add roles and features”
3. Select “Web Server (IIS)”
4. Include basic authentication and all required features
5. Complete the installation

1.2.5 Install Node.js (for Angular)


1. Download Node.js 16.x LTS (based on your package.json)
2. Run the installer with default options
3. Verify installation with: node -v and npm -v

1.3 Configure Windows Firewall

1. Open Windows Firewall with Advanced Security


2. Create inbound rules for:
• SQL Server (TCP 1433)
• HTTP (TCP 80)
• HTTPS (TCP 443)
• Custom ports for your applications as needed

2. Database Setup

2.1 Database Restoration/Creation

1. Open SQL Server Management Studio (SSMS)


2. Connect to the local SQL Server instance
3. Create three databases matching your development environment:
• Shiksha
• Student
• Employee

2.1.1 Option 1: Restore from Backup


If you have a backup: 1. Right-click “Databases” and select “Restore Database”
2. Select your backup file and complete restoration

2.1.2 Option 2: Create from Scripts


If you have scripts: 1. Connect to the server in SSMS 2. Create the three
databases 3. Execute your SQL scripts to create schema and load data

2
2.2 Create Database Users

Create a dedicated user for your application: 1. In SSMS, expand Security →


Logins 2. Right-click Logins → New Login 3. Create a user named db_admin
with password [strong-password] 4. Grant appropriate permissions to each
database 5. Update your configuration files with these credentials

3. Spring Boot Application Deployment

3.1 Build the Application

On your development machine: 1. Update application.properties with


production database settings 2. Build the WAR file using Maven: mvn clean
package -DskipTests 3. This creates rsk.war in the target directory

3.2 Deploy to Tomcat

Two options for deployment:

3.2.1 Option 1: Standalone Tomcat (Recommended)


1. Download and install Apache Tomcat 9.x on the server
2. Configure Tomcat:
• Set environment variables: CATALINA_HOME=C:\path\to\tomcat
• Update memory settings in catalina.bat if needed
3. Deploy the application:
• Copy rsk.war to %CATALINA_HOME%\webapps\
• Start Tomcat: %CATALINA_HOME%\bin\startup.bat
4. Configure as Windows Service:
• Run %CATALINA_HOME%\bin\service.bat install

3.2.2 Option 2: Using Spring Boot Embedded Tomcat


1. Create a directory on the server: C:\Applications\rsk
2. Copy the WAR file to this directory
3. Create a batch file to start the application: @echo off java -jar
C:\Applications\rsk\rsk.war
4. Create a Windows service using NSSM:
• Download NSSM (Non-Sucking Service Manager)
• Run: nssm install RSKService
• Set path to your batch file

3
• Configure service details

3.3 Configure File Storage

Based on your properties file, set up the required directories: 1. Create all neces-
sary folders: C:\webapps\Documents\TrainingDocs C:\webapps\Documents\MonitorPhotos
C:\webapps\Documents\SelfAssessmentDocuments C:\webapps\Documents\SelfAssessmentPhotos
C:\webapps\Documents\VisitsImages C:\webapps\Documents\ProblemDocuments
C:\webapps\Documents\AgendaDocuments C:\webapps\Documents\SpotAssessment\QuestionImages
C:\webapps\Documents\MeetingImages 2. Grant appropriate permissions to
these folders for the service account

3.4 Configure AWS S3 (If Required)

If you’re using AWS S3 for storage: 1. Install AWS CLI 2. Configure AWS
credentials using: aws configure 3. Enter your AWS access key, secret key,
and region

4. .NET Application Deployment

4.1 Build the .NET Application

On your development machine: 1. Update connection strings in appsettings.json


2. Build the application: dotnet publish -c Release

4.2 Deploy to IIS

1. Create a new application pool in IIS:


• Open IIS Manager
• Right-click “Application Pools” → “Add Application Pool”
• Name: “RSKDotNet”
• .NET CLR version: “No Managed Code”
• Start application pool
2. Create a new website or application:
• Right-click “Sites” → “Add Website” (or add as application under Default
Web Site)
• Site name: “RSK.API”
• Physical path: path to your published .NET application
• Binding: Choose port (e.g., 8080)
• Select the application pool created earlier
3. Configure the application:

4
• Select the site/application
• Double-click “Authentication” icon
• Ensure Anonymous Authentication is enabled
• Configure other IIS settings as needed

5. Angular Frontend Deployment

5.1 Build the Angular Application

On your development machine: 1. Update environment.prod.ts with


production API URLs: typescript export const environment = {
production: true, apiUrl: 'https://yourserver.com/rsk/api',
// Spring Boot API dotnetApiUrl: 'https://yourserver.com/RSK.API'
// .NET API };
2. Build the production bundle: npm run build:prod This creates a dist
folder with the compiled application

5.2 Deploy to IIS

1. Create a new application pool in IIS (or use an existing one)


2. Create a new website:
• Site name: “RSK.Web”
• Physical path: path to your Angular dist folder
• Binding: Default port 80 (or 443 for HTTPS)
3. Configure URL Rewriting:
• Install URL Rewrite module for IIS
• Create a web.config file in the root of your Angular application: xml
<?xml version="1.0" encoding="UTF-8"?> <configuration>
<system.webServer> <rewrite> <rules> <rule
name="Angular Routes" stopProcessing="true"> <match
url=".*" /> <conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"
/> <add input="{REQUEST_FILENAME}" matchType="IsDirectory"
negate="true" /> </conditions> <action
type="Rewrite" url="/" /> </rule> </rules>
</rewrite> </system.webServer> </configuration>
4. Set MIME types:
• In IIS Manager, select your website
• Double-click “MIME Types”
• Add any missing MIME types for your application

5
6. Security Configuration

6.1 JWT Configuration

1. Update JWT secret keys in both applications to strong, unique values


2. Ensure the expiration times are appropriate for your use case
3. Keep the JWT secrets secure and consistent between applications

6.2 HTTPS Configuration

For production environments, configure HTTPS: 1. Obtain an SSL certificate


(self-signed for internal use or from a CA) 2. In IIS Manager, select your site 3.
Click “Bindings” in the Actions panel 4. Add a binding for HTTPS (port 443)
and select your certificate

6.3 Service Account Security

1. Create a dedicated service account for running your applications


2. Grant minimal required permissions to this account

7. Automation and Monitoring

7.1 Create Deployment Scripts

Create batch scripts to automate the deployment process: 1. Database


backup/restore 2. Application deployment 3. Configuration updates

7.2 Set Up Monitoring

1. Configure IIS logs and monitoring


2. Set up SQL Server monitoring
3. Consider tools like Application Insights or other APM solutions

7.3 Configure Backup

1. Set up regular database backups


2. Configure file system backups for uploaded files
3. Document the restore process

6
8. Testing the Deployment

8.1 Functional Testing

1. Test both frontend and backend components


2. Verify database connections
3. Test file uploads and AWS S3 integration
4. Verify authentication and authorization

8.2 Performance Testing

1. Test under expected load


2. Identify bottlenecks
3. Adjust configuration as needed

9. Troubleshooting Guide

9.1 Common Issues and Solutions

Database Connection Issues


• Verify connection strings
• Check SQL Server authentication mode
• Ensure ports are open in the firewall

Spring Boot Application Not Starting


• Check logs in Tomcat’s logs directory
• Verify Java version and environment variables
• Ensure proper WAR file deployment

.NET Application Issues


• Check Application Pool settings
• Verify .NET runtime installation
• Check IIS logs

Angular Application Issues


• Verify build process completed successfully
• Check browser console for errors
• Verify URL rewrite rules

7
10. Maintenance Procedures

10.1 Regular Updates

1. Schedule regular maintenance windows


2. Document update procedures
3. Create rollback plans

10.2 Scaling Considerations

As your application grows: 1. Consider separating services across multiple


servers 2. Implement load balancing for web applications 3. Optimize database
performance

You might also like