Akzium
  • Home
  • Solutions
    • Distributed File Systems
    • Security
    • Cloud Computing >
      • Enterprise File Sync and Sharing
    • SD-WAN
    • Secure Internet
    • Virtualization
    • Backup and Replication >
      • AS400 Backup and Replication
      • DICOM Image Backup and Archival
    • Disaster Recovery
  • Services
    • Cloud Migration Services
  • About
  • Blog

Use AWS EC2 VM and IIS to Share Files

3/27/2025

0 Comments

 
Picture
If you need to share large files over an internet connection, one easy way to do that is to spin up an Amazon AWS EC2 virtual server running Windows and the IIS Role and use the virtual directory feature in Microsoft IIS. The real key to ensuring that the files in the shared folder linked to the virtual directory default to "file -> download" when clicked on is to edit the MIME Types function. For each type of file in the virtual directory shared folder (e.g.: .ISO, .EXE, .MSI, .DOC, .PDF, .ZIP, .TGZ, etc.) change the MIME Type flag to file/download. Once you do this, when the user clicks on the file in the browser it will open the file download window. If you don't edit the MIME Type for each file extension that will be in your shared folder, when you click on the file you will get a 404 Error.

One note here is that if using Chrome or Edge and you do NOT install an SSL certificate on the IIS server, it will flag the download as unsecure. If the "Keep" option isn't working properly, you can click on the download icon in the browser toolbar to close the download window and then click it again to re-open the download option window, click on the > to expand the download item prompt, which should give you the option to "Download Insecure File".

One way to restrict access to this publicly-facing IIS file hosting server is to use the AWS EC2 Security Groups - Inbound Rules to only allow HTTP access to the EC2 VM from specific public IP addresses. Once in place, only those public IPs on the Inbound - Allow rules list will have HTTP (port 80) access to the EC2 VM. **NOTE: Be sure to give YOUR public IP address HTTP Allow access for testing. The default rule allows RDP access, which should be edited to restrict access from only YOUR public IP address.**

**EDIT**: I took this "easy" file sharing up a notch by creating a self-signed SSL certificate using Git Bash, importing the certificate into IIS and also into my personal certificates store on my local PC, and binding SSL in IIS using the new self-signed certificate. Now I can access the site using HTTPS and the browser doesn't prompt the download as "insecure".
Launch Git Bash for Windows
$ winpty openssl genrsa -out awsserver.key 4096
$ winpty openssl req -key awsserver.key -out awsserver.csr
*answer prompts*
$ winpty openssl x509 -req -days 3650 -in awsserver.csr -signkey awsserver.key -out awsserver.crt
$ winpty openssl x509 -in awsserver.crt -text -noout (*this verifies certificate)
$ winpty openssl pkcs12 -export -out awsserver.pfx -inkey awsserver.key -in awsserver.crt
*this creates PFX file to import into IIS
** Don't forget to add a DNS entry, either into your local DNS server or your PC's hosts file (Windows/system32/drivers/etc)
0 Comments

Moving Windows Server 2022 Recovery Partition

3/13/2025

0 Comments

 
Picture
When doing a scratch install of Windows Server 2022, some brainiac at Microsoft thought it was a good idea to place the recovery partition at the end of the Disk 0 Volume. So, when you need to extend your "C" drive, you end up with the recovery partition blocking the way. Here are the steps to resolve this issue (and I'm assuming you've already added space to the virtual disk).

Step1: Remove Existing Recovery Partition
Run CMD as Administrator and execute the following command: reagentc /disable
C:\>reagentc /disable
Next, run DiskPart and execute the following commands:
diskpart
list disk
select disk 0 (or whatever happens to be the disk ID with the recovery partition)
list partition
select partition 4 (again, select the appropriate partition listed as the Recovery Partition)
list partition (ensure the recovery partition has a * beside it)
delete partition override (this deletes the recovery partition)
list partition (the recovery partition should now be deleted)
​


Picture
Step #2: Go into Computer Management and navigate to Disk Management

Right click on the "C" partition and select "extend" and click Next

Reduce the size of the extension by 1GB (see image below as example) to reserve space for the new recovery partition.

Finish task. Now, the "C" partition should be larger and there should be at least 1GB left at the end.
Picture
Picture
Step #3: Create a New Recovery Volume
Right-click on unallocated space
Choose Simple Volume
NTFS
No Drive Letter
Leave Partition Name Blank
Finish task.
Step #5: Return to CMD as Administrator and DiskPart
Run the following commands:
List Disk
Select Disk 0 (or other as appropriate)
List Partition
Select Partition 4 (this should be the new partition you just created in disk manager)
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
gpt attributes=0x8000000000000001
Picture
Step #6: Exit DiskPart and Return to Administrative Command Prompt; Re-Enable Recovery Partition

C:\>reagentc /enable

Return to Computer Management->Disk Management

Partition should now show as Healthy (Recovery Partition)
Picture
0 Comments

    Author

    Akzium team blog

    Archives

    February 2026
    May 2025
    April 2025
    March 2025
    January 2025
    December 2024
    November 2024
    October 2024
    July 2024
    November 2022
    September 2022
    August 2022
    July 2022

    Categories

    All
    Alias Gmail
    Apache Log4J
    AWS EC2 IIS File Share
    BypassNRO
    Chrome Browser GPU
    Default Gateway
    DHCP
    DHCP Backup
    DHCP Restore
    DHCP Scopes
    DiskPart
    Endpoint Security
    File Server Migrations
    File Server Registry Key
    File Server Resource Manager
    File Shares Registry Key
    Ghost Network Adapters
    Gmail Alias
    Gmail Email Alias
    IBM 5250 Terminal
    IBM BOMC
    IBM Firmware Updater
    IBM FlashSystem Firmware Update
    IIS
    Internet Information Services
    Lenovo BOMC
    Lenovo Firmware Updater
    NTP
    RaspberryPi 4b
    RaspberryPi 4b 5250
    Recovery Partition Relocate
    Security Registry Edits
    Self Signed SSL
    Set Chrome To Use GPU
    Time Server Change
    Uptime Kuma
    Uptime Kuma Ubuntu Install
    Virus Scanner
    VMware
    Windows 11
    Windows 11 Developer Console
    Windows File Server
    Windows IIS File Sharing
    Windows Quick Assist
    Windows Route Command
    Windows Sandbox
    Windows Script Host
    Windows Server 2022 Recovery Partition
    Windows Shared Experiences
    Windows Time

    RSS Feed

Akzium, LLC | 601-841-2499     .     [email protected]
Copyright 2011-2025, Akzium, LLC.  All rights reserved.