Questions tagged [amazon-ec2]

Amazon EC2, also known as "Amazon Elastic Compute Cloud," forms an integral part of the vast range of services offered by Amazon Web Services (AWS). This remarkable feature enables individuals and businesses alike to easily lease virtual machine instances. Seamlessly deploying and overseeing these instances can be accomplished via a convenient central interface or opting for the web API or console alternatives.

Deploying a ReactJS application on AWS Elastic Compute Cloud (EC2) with a wildcard SSL

After developing a reactjs app with a .net core web API as the backend, I successfully hosted it on a Windows server using IIS with http. However, when attempting to use a wildcard SSL certificate, an error appeared in the Chrome console: "Failed to loa ...

The abrupt end of an HTTP connection occurs in a Node.js application deployed on Amazon EC2

I am currently running a REST API on Amazon EC2 using Node.js (Express). During a specific REST call, the client receives a reply of approximately 5MB. However, before the client can fully receive the reply, an error message is displayed: Premature end o ...

"Encountered an issue while attempting to run the docker-compose script on AWS

Launching my application with sudo docker-compose up works fine, but when I try docker-compose up, it throws the following error: $ docker-compose up Traceback (most recent call last): File "urllib3/connectionpool.py", line 670, in urlopen Fi ...

Express app on Node.js running on ec2 micro instance extremely sluggish

Let's set the scene: Hosting on an EC2 micro instance Running MySQL 5.6 Utilizing a Redis server Node.js powering an Express-based app Nginx serving as a reverse front-end proxy. The performance is sluggish, painfully slow. Understandably, being on a mi ...

Conceal the server's internal file structure to prevent it from being displayed in sources

When I visit my website and inspect the elements in Google Chrome, I am able to see a list of all the folders on my site under the sources tab. This reveals their original names and allows for the downloading of the entire website code. I am concerned abo ...

Implement SSL for securing the REST API connection

My current setup involves running an express js application on an aws ec2 instance to act as a REST API for my application. I am now considering adding SSL certification for my expressjs API, but I'm not sure of the best approach. 1)Should I acquire a dom ...

Comparing Amazon Fargate and EC2 for hosting container-based websites

In a recent project, I was tasked with building a React / NextJS application that will experience occasional high traffic but mostly remain idle. Our goal is to find the most cost-effective options while still creating a scalable and manageable app with a ...

Node.js Express is successfully receiving messages from the WebSocket server but encountering difficulties when attempting to send them out

My setup involves websockets with AWS API Gateway, an EC2 instance running Node.js and Express with WS websockets. I can send a message from wscat to the API Gateway WSS URL and it shows up in the EC2 instance. However, when I send a message from the EC2 i ...

The EC2 instance faced a prolonged delay and rejected the connection attempt

Good day to all, I'm seeking assistance with an issue I've been encountering while attempting to host a test project on AWS EC2. Despite following the recommended procedures from tutorials and properly configuring ports and security groups, the ...

Having trouble getting a React app integrated with WordPress on an NGINX server to function properly over HTTPS?

I am currently in the process of developing a React application that integrates with a WordPress site. The setup I am aiming for is as follows: When users visit example.com, they will be directed to my React app. If they navigate to example.com/blog, they ...

PHP malware files are being generated without manual intervention

We have an AWS ec2 instance running CentOs that hosts 4 sites - one static HTML and PHP site, two Joomla (v3.4.5) sites, and one Opencart (v2.0.1.1) site. Recently, we discovered some unfamiliar files on our server which appear to be malware. After runnin ...

After running a npm run build command and hosting it on nodejs express.static, I attempted to start the app using pm2. However, I encountered an issue when trying to

I needed to set up hosting for 2 different node apps on a single Linux box from AWS EC2. I wanted to create a development environment and a staging environment, each using its own port. However, the issue I am currently facing is not related to port confli ...

Efficient Rotation with AWS Proxy in Conjunction with Amazon API Gateway and Selenium

Looking to scrape websites using selenium. Successfully implemented selenium on ec2, but since ec2 is tied to a specific IP, I'm interested in incorporating Amazon API Gateway rotating proxy into my python selenium script. Came across this helpful t ...

Troubleshooting problems with AWS Elastic Beanstalk deployment

I am encountering an issue while attempting to deploy my Node.js app to Elastic Beanstalk. The app is functioning correctly locally, but when I try to deploy it, I receive the following error: Failed to run npm install. Check snapshot logs for more detail ...

AWS EC2 port has been successfully opened, however access remains unattainable

My TCP port 3000 is enabled, as indicated in the EC2 security settings. However, I am unable to connect to my server through telnet on that port and receive the error message Could not open connection to the host, on port 3000: Connect failed. The server ...

The AWS-lib Node module may encounter issues with its signature if called multiple times

I have a script that is constantly checking for the status of an EC2 instance as it starts up. var checkInstanceStatus = function() { console.log('Checking status'); ec2.call("DescribeInstanceStatus", {InstanceId:['pretend_instance_id']}, function(err ...

Creating a unique Elastic IP address for a single EC2 instance with the AWS CDK

I'm having an issue with my AWS CDK Stack where multiple Elastic IPs are being created for each public subnet in my VPC instead of just one. I only want one Elastic IP to be associated with a single EC2 instance. My simplified code snippet is as follows: ...

Establish a connection between a single EC2 instance running a Node.js application and another EC2 instance acting as a PostgreSQL

Currently, I have two running EC2 instances. One is running a Postgres server and the other is hosting a NodeJS app that needs to connect to the Postgres database. However, it appears that the connection cannot be established as I am unable to ping the P ...

An issue has arisen in the production environment on AWS EC2 due to a problem with Nodemailer

When using nodemailer with node.js to send emails, I have set up the following configuration: var transporter = nodemailer.createTransport({ service: 'gmail', host: 'smtp.gmail.com', auth: { user: '<a ...

Difficulty connecting to the API endpoint in AWS

I created a two-tier MEAN application with the authentication API backend hosted on AWS EC2 and the Angular front-end hosted on AWS S3 as a static site. During development, I ran the auth backend using node/express on http://localhost:5719/. For the front ...

Defend your system from potential PHP file intrusion

Our server recently experienced a cyber attack, as evidenced by the following entries in the system logs: [Mon Feb 18 09:18:43 2019] [IP_ADDRESS] script '/var/www/ynm.php' not found or unable to stat [Mon Feb 18 09:18:43 2019] [IP_ADDRESS] script '/var/ww ...

Encountered an issue loading next.config.js during the build process with GitHub actions

Currently, I am utilizing a straightforward ssh deploy action along with a bash script designed to both build and restart the pm2 frontend process. Everything seems to be running smoothly when executing the script directly on the ec2 instance. However, is ...

Training Scikit-learn machine learning models with the power of multiple CPUs

Looking to reduce the training time of my models, I decided to utilize a high-end EC2 instance. I experimented with the c5.18xlarge instance that has 2 CPUs and ran several models with the parameter n_jobs=-1. However, I noticed that only one CPU was being ...

Execute automated processes on a headless browser within an EC2 instance running Amazon Linux

In my automation framework, I utilize static HTML pages stored within the project directory to execute various AWS operations like DynamoDB scan and AWS Lambda executions. However, we are encountering performance issues with a dependent API component in ou ...

What is the preferred method for preserving environment variables on an AWS EC2 instance?

I'm currently facing an issue with fetching and utilizing environment variables from a .env file in my Node.js application while running it locally using dotenv. Due to security concerns, I cannot commit the .env file to GitHub. When deploying the app to ...

Unable to find npm and pm2 commands during the execution of GitHub actions on EC2 instance

I'm currently utilizing a GitHub Actions workflow. Here's the code snippet: name: Deploy to EC2 on: workflow_dispatch: # Manual trigger jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/ ...

What are the steps for setting up node.js, couchdb, and other tools on Amazon EC2?

Embarking on the journey of server administration for the first time is both daunting and exciting! As a node.js developer, I have relied on Nodejitsu until now. However, with rising prices, I am now exploring setting up my own server using AWS. My develo ...

There was a serious issue: The mark-compacts were not working effectively near the heap limit, resulting in allocation failure - the JavaScript heap ran out of memory during the

I recently set up a t2.micro server on AWS and encountered an issue when running our application with the command "sudo npm start". The error message I received was: "FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript he ...

Establishment of AWS ElasticBeanstalk deployment for Websockets functionality

My objective is to configure Websockets to send messages to AWS, process the message, and then deliver custom responses to clients via cloud resources. Unfortunately, I'm struggling to make this setup work correctly. The primary goal is to send mess ...

Nestjs crashes with "terminated" on an Amazon EC2 instance

https://i.stack.imgur.com/3GSft.jpgMy application abruptly terminates with the error message "killed" without providing any additional information or stack trace. Interestingly, it functions properly when run locally. Any assistance would be greatly appr ...

What could be causing the freezing of a Selenium Python script on an EC2 instance

Whenever I attempt to execute a script, the process freezes. Below is the code snippet: def get_source_content(url): driver_path = f"{settings.BASE_DIR}/geckodriver" options = FirefoxOptions() options.add_argument("--headless") ...

I'm encountering an issue where the npm install process is getting stuck while attempting to extract the xxxx package

When running the sudo npm install command on my local machine, everything works fine. However, once I pulled the code into an EC2 Ubuntu machine, the npm install process gets stuck at a certain point. The output shows "sill doParallel extract 1103" and I ...

Handling an Excel file on a Node.js server

My EC2 nano instance is set up with an endpoint that retrieves data from my MongoDB, converts it to an Excel file, and provides a URL for download. However, when dealing with large amounts of data, the server crashes with a 502 error. Switching to an EC2 m ...

The Node.js application is experiencing unpredictable disconnections from MongoDB

I am currently running a nodejs/ExpressJS/Mongodb/Mongoose application on AWS Elastic Beanstalk. However, I have been experiencing an issue with the health of my Elastic Beanstalk environment degrading randomly (at unspecified times). This degradation occu ...

Running a Bokeh Server with Tornado on Amazon Web Services (AWS)

Is there a way to prevent public IP access to the Bokeh Server when hosting it on AWS with Tornado? ...

AWS: How to deploy a node.js application on EC2 servers

I am new to AWS and currently working on a web application using node.js and react.js. While my application functions smoothly on my laptop, I now wish to migrate it to AWS EC2. When I replicate a production environment on my laptop, I have a /dist folder ...

Experiencing sluggish performance of Node.js application on Amazon EC2 with Amazon Linux

As a newcomer to Amazon EC2 and Node.js, I may be in over my head, but I believe in learning through hands-on experience. While I have managed to get it up and running, the issue lies in the fact that the instance is quite slow. After starting Node once or ...

What is the best method for connecting to the KONG API, hosted on an EC2 instance, from a separate EC2 instance running a Node.js application?

How can I make a call to the KONG API from my node.js application that is running on an EC2 instance? What steps do I need to take in order to establish communication between node.js and the KONG API? ...

establish a connection to a MongoDB database running on a dedicated EC2 instance

I am currently managing two separate instances on AWS, one for a node application and the other for mongoDB. Despite trying to establish a connection to mongoDB from the node application instance, I keep encountering an error reading "504 Gateway timed out ...

Amazon instance experiencing server unavailability issue with Node.js application

I recently encountered an issue with my node.js app running on an Amazon instance. The app was working fine until my credit card expired, resulting in the instance being turned off. However, when I tried to access the instance again, I received a "server n ...

ajax request encountered access denial when attempting to call wcf service

I have set up an Amazon EC2 instance and deployed my .NET web application on port 80, with the WCF service running on port 1212. While I can access both the application and service locally on the remote session, attempting to make Ajax requests over the i ...

Using codedeploy to deploy a Next.js application onto an AWS EC2 instance

After creating a fresh NextJS app with only basic boilerplate files and folders, I uploaded it to a CodeCommit repository. I already had a functional CodePipeline and simply switched the Source stages. However, I am encountering deployment failures during ...

Jenkins does not have the capability to execute npm or pm2 independently

Currently, I have a Jenkins CI setup running on an EC2 server. I've successfully installed nodejs and npm. Interestingly, Jenkins is able to access them via the command line using this command: sudo -u jenkins node -v However, when it comes to actua ...

Error: The command 'sudo npm install' could not be found

After setting up nodejs and npm on my Amazon AMI server using the node version manager, I am currently running node version 7.10.0 and npm version 4.2.0. The nodejs project is located in the var/www/testing folder. When attempting to install dependencies ...

Error: Invalid connection string for ELF Lambda detected

Having an issue with a lambda function that connects to a remote MongoDB on an EC2 instance using TypeScript. While I can connect to the database locally, there is an ELF error when running in lambda. It seems to be related to mismatched binaries of npm pa ...

Issues arise within the Docker container due to an error stating "unable to initiate a new session thread"

My web crawling solution is built using Python and Selenium, running in a Docker container on an m4.2xlarge EC2 instance with multiprocessing implemented using the Pool method. with Pool(processes=(config.no_of_cpus)) as pool: pool.map(func, items) pool. ...

What is the best way to initiate a node.js application automatically on an Amazon Linux AMI instance in AWS?

Could someone provide a simple guide on how to start an application when the instance starts up and is running? If the service was installed using yum, can I use /sbin/chkconfig to add it as a service? But what if I want to run a program that wasn't insta ...

How can I deploy React applications to AWS EC2 using Github Actions and AWS CodeDeploy?

I am currently facing a challenge in setting up a React app within Github Action workflow and deploying it on an EC2 instance. The issue I'm encountering is the inability to access the /build folder that is created during the action process. Below is the ...

Is it possible to operate multiple applications simultaneously on a single Amazon EC2 instance?

Although the answer may be apparent to some, my lack of experience in server administration has left me puzzled. Despite my efforts of researching on Google and reading through Amazon's documentation, I still can't seem to find a clear answer. Is it possi ...

All Pages Except Index in Vue Website Report "404 Error: /path Not Found"

Using Vue with Node.js to host my website on an AWS EC2 instance. I don't have a main index node.js file, just the vue-router file. Utilizing AWS CloudFront to secure my certificate and traffic. The issue arises when accessing the site through the server l ...

Running npm install within the user's data directory

My goal is to set up a launch template in AWS with specific user data included: #!/bin/bash home=/home/ec2-user nodev='8.11.2' nvmv='0.33.11' #install node su - ec2-user -c "curl https://raw.githubusercontent.com/creationix/nvm/v${nvmv}/install.sh | ...

Unable to connect domain name to IP address (No display is shown)

I recently purchased a domain () through Google Domains. However, when I try to open it in Chromium or Firefox, I receive an error message: ERR_CONNECTION_REFUSED. Here is my current setup: I have an EC2 AWS machine running my nodeJS backend on port 3000 ...

Ensuring a continuous operation of Node.js on AWS EC2 even after exiting the console

Currently, I am using aws ec2 for hosting a web server with node.js and apache. I find it inconvenient that I have to log in to ec2 through the terminal each time to run npm start. I want to set it up so that it continues running even when I'm not o ...

Setting up secure https for a node.js server in a Docker container on an AWS EC2 instance involves several steps. Let

I have a dockerized node.js/express application up and running on an AWS EC2 instance container. Currently, the app is accessible via a domain name hosted by AWS Route 53 using the HTTP protocol. I am now looking to configure HTTPS for my node.js server th ...

Leveraging an Octave script within a Heroku application

Currently, I am facing an issue pushing my web application to Heroku that heavily relies on calling an Octave script. In order to carry out development and testing, I am utilizing an EC2 instance along with node.js. Octave has been installed on the EC2 ins ...

How can you access an API hosted on the same EC2 instance but using a different port number?

I have a setup where multiple Node.js servers are running on the same EC2 instance. Whenever I need to call an API that is hosted on a different port of the same instance, I currently use AXIOS for calling. I'm curious if this is the only method avail ...

Encountering a 500 Server Error on an EC2 Ubuntu Instance while using the CakePhp application

I recently created a web app using PHP MySQL in both plain code and also with CakePHP. Everything was working fine until I uploaded the Cake directory to an Ubuntu EC2 instance, which resulted in a 500 server error. I attempted adding / to all three htacc ...

What is the method to retrieve AWS CloudWatch Custom Metrics using the PHP SDK?

Is there a way to retrieve metrics information for custom metrics on a per/instance basis? I'm currently able to get the information for included metrics, but not for custom ones like CPUUtilization. I'm unsure if I'm using the correct NameSpace or if I ne ...

Ways to halt the expressjs server

After deploying my express and nextjs based app on EC2, I encountered an issue where the server automatically starts Nginx and node with different process IDs after I attempt to stop it by killing the process. This is happening even without using tools lik ...

During the execution of a backend script, where exactly is the image or video data stored?

I'm currently developing a web application that allows users to upload videos for processing and formatting, then saving them for download. The plan is to deploy the app on an AWS EC2 instance and utilize an S3 bucket for storing the finalized videos ...

Methods for establishing communication between a React server and a Node server using private IP addresses

I currently have three EC2 Instances on AWS React Server Instance Node Server Instance MongoDB Server Instance My goal is to establish a connection between my React Server and Node Server using the Private IP address. For security purposes, I do not want ...

Secure shell access to Amazon EC2 using PHP

When I try to run a PHP script connecting from my local Ubuntu Linux machine to an EC2 instance using SSH, it executes fine when run from the terminal and writes the tailed entries in a file. However, when I try to run it from a browser, I encounter the fo ...

Encountering an issue while trying to initiate npm start command for a ReactJS application on an

While attempting to deploy my node and react app on AWS ec2, I encountered an issue. The node app is working fine, but the react app is giving an error when running npm run build. I also tried using npm start, but unfortunately, it resulted in the same er ...

Using PHP in conjunction with Urban Airship and hosting on an Amazon EC2 server

I'm currently working on setting up a push notification server. My stack includes: php + Urban Airship + Amazon EC2 Server. However, I'm encountering an error (500) when trying to run the php library for Urban Airship. I suspect that I may need to insta ...

Error: An issue occurred with the tasks in the Gruntfile.js file

pm WARN EPACKAGEJSON <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="74041506001a1106041b0600151834445a445a44">[email protected]</a> No description npm WARN EPACKAGEJSON <a href="/cdn-cgi/l/email-protection" ...

Implementing SES with PHP on EC2 - Assistance Needed

Hello everyone. I recently set up my servers using EC2 and configured postfix, but unfortunately, the emails were consistently being marked as spam. To solve this issue, I decided to give Amazon SES a try. However, despite hearing that it's easy to im ...

The submitted form did not come from the anticipated source on the EC2 server

Recently, I began the process of migrating a PHP zend based web application to AWS EC2 as I am new to PHP. However, upon trying to log in to the site after completing the migration, I encountered the following error: The form submitted did not originate fr ...