Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add feature to Windows Server Configuration by AWS Elastic Beanstalk

My application uses the WebSocket protocol, and I want to deploy it to the AWS using AWS Elastic Beanstalk. But the pre-build Windows Server configuration not including this protocol by default.

Manually i can enable it by setting according item in the Server Manager via Add Roles and Features Wizard (Web Server (IIS) -> Web Server -> Application Development -> Web Socket Protocol).

If I want my app to work, i need connect by RDP and manually check in this option. But it is a terrible approach..

I think this task can be accomplished by deploy setting (.ebextensions)? But how can i get it?

I would be very grateful for the answer!

like image 429
Pavel Karpovich Avatar asked Sep 18 '25 04:09

Pavel Karpovich


1 Answers

Add .ebextensions to your EB environment and customize your server software

You may want to customize and configure the software that your application depends on. These files could be either dependencies required by the application—for example, additional packages or services that need to be run.

For your needs use commands option:

Use the commands key to execute commands on the EC2 instance. The commands are processed in alphabetical order by name, and they run before the application and web server are set up and the application version file is extracted.

The specified commands run as the Administrator user.

For example this command will install WebSocket protocol feature:

%SystemRoot%\system32\dism.exe /online /enable-feature /featurename:IIS-WebSockets

in .ebextensions config it may look like:

commands:
   01_install_websockets_feature:
     command: "%SystemRoot%\\System32\\dism.exe /online /enable-feature /featurename:IIS-WebSockets"
     ignoreErrors: true
like image 108
Igor K. Avatar answered Sep 19 '25 18:09

Igor K.