AWS - Elastic Beanstalk/Glassfish index.html file - amazon-web-services

I am using Amazon's AWS Elastic Beanstalk to deploy my web application. I am having a problem where the deployed application will display a "Your server is now running" page, rather than my own index.html/jsp page. What I am really confused about is that this appears to happen at random - sometimes my deployment will work fine, but others I will get this page.
Is there a specific configuration or directory structure I need to use in order to make my index.html the default? I had previously had my project configured for Tomcat, and am using a regular .war file directory structure.
Any help is appreciated

Related

Unable to send bundle from aws app deployed using aws copilot via github actions

I have deployed my application using copilot deploy which works. It creates a load balancer and when I go to the designated url I can view my react app. However, I'm trying to create a CI workflow using github actions.
My github actions appear to work, they appear to deploy the app. But when I go to the new designated url, I get Uncaught SyntaxError: Unexpected token '<'
If I go to that same url and hit a specific route on it, that actually does work. So I can do url/test and it return "hello world" but it won't return the bundle for the application or it's returning a broken version of it for some reason.
I can't figure out why using copilot deploy normally works, but this doesn't
For context, my app is set up like this. In the root folder there is a Server folder that has the node server file with the routes. In the root folder is also a src folder with the react code. There is a public file. There is the docker file containing instructions. And then there is the build file. So far I've been generating the build ahead of time and then deploying everything. The node server then sends the build.
So presumably, something about the way the docker container is being built via github actions is significantly different than the way it is building using copilot deploy. But, my understanding is that in both cases it is following the same docker file. So I can't figure out what is different about the directory structure it is creating, or maybe its having trouble creating the bundle at all. If anyone has any insight it would be appreciated.
Thanks!

URL rewrites or redirections in AWS Elastic Beanstalk (with Spring Boot application)

I have a Spring Boot application hosted on AWS Elastic Beanstack.
In the application properties I have:
server.servlet.context-path=/PartToRemove
so all my URL are:
https://example.com/PartToRemove/path/to/the/particlar/endpoint
Now I would like to remove the PartToRemove to have:
https://example.com/path/to/the/particlar/endpoint
At the Spring Boot level it is easy - I just need to remove line
server.servlet.context-path=/PartToRemove
from my configuration.
BUT
... I would like to keep "backward compatibility" for all users who know the old URLs only. So I was thinking about setting some rewrite or redirection from the old https://example.com/PartToRemove/path/to/the/particlar/endpoint to the new https://example.com/path/to/the/particlar/endpoint URLs.
I'm not very familiar with AWS so I'm not sure where to do this. I was thinking about something like mod_rewrite in .htaccess file but I have no idea if it is a proper way.
I'm deploying the application as a zip file so I can use .ebextensions if it would help.
Any ideas on how to achieve such redirection or rewrite?

Writing files to AWS Elastic Beanstalk

I have developed a web application with a Node.js backend on a local machine using Webstorm IDE. Among other things, the application creates a new unique folder and writes 7 javascript (.js) files to this folder during runtime each time a user requests a new account. Everything works properly in the local development environment.
When the application is uploaded and deployed to AWS Elastic Beanstalk, and a new user is requested though the application web page, I am receiving the following 404 (Not Found) error in the browser's Developer, JavaScript Console. The same error appears for each of the 7 files. The number 1541877962401 is the unique folder name generated by the application when a user requests a new account and user.js is one of the 7 javascript files copied to this newly created folder. savedUser is an existing folder in the file structure and is not created during runtime.
GET http://sowtest082-env.stsvxa672t.us-east-1.elasticbeanstalk.com/savedUser/1541877962401/user.js net::ERR_ABORTED 404 (Not Found)
I am guessing that the application does not have the correct permissions to create the folder and/or files in AWS?
Within the context of the Elastic Beanstalk environment, what is the best method to create a folder and copy javascript files to this folder during runtime? It is fairly easy to restructure the location of the folder and the files within it in the development environment so as to match the ASW EB environment. Reengineering the application to store the contents of these files in an AWS MySQL database engine would take a lot more work.
Bye the way, these 7 files are not tmp files and they are not config files...
Thanks...

Deploy Rails spree to Beanstalk

I have deployed rails spree app to AWS Beanstalk successfully. Then I added some new products together with their images. The app by default saves the images in my_app/public/spree/products folder. Every thing went fine until I deployed new code. The new code is deployed successfully but the "products" folder is gone. I now have to re-upload all of my images manually. Anyone has any idea what is going here?
Please let me know if you need any further info.
Thanks!!
Application will contain a public folder and under of this, we have spree products/taxons images folder...Those files are static by nature, so it’s a good idea to serve them using S3 because for every deployment our code replace.
Elastic beanstalk servers are somehow out of your control, meaning AWS controls when they are restarted and even terminated and rebuilt. Therefore, you shouldn't store anything on local disks (which is what Spree does by default).
The solution to your problem is simply to store them on S3 as described here.

Cant Find my Axis2 Web Service deployed on OpenShift

I deployed a web service developed using Apache Axis2 on Openshift.
When I try accessing the axis2 index.jsp, I can see the index page which only contains the default Version.
Q:
How do I get to display the web service other web services I created as I can view them on my localhost through the browser in Eclipse?
I have done a few searches online and seen some suggestions as to making adjustments to axis2.xml. In that regard, I have tried changing the contextRoot parameter and the servicePath without no success though I am not too sure if I am making the right changes.
My project structure in Eclipse is shown below:
SieveService
+...
+Java Resources
++src
+++Model
++++some model classes
+++Services
++++SieveServiceService.java
++Libraries
+...
+WebContent
++axis2-web
+++...
I had the same problem and that's occurs because openshift's tomcat server only deploys services in aar format, meanwhile in localhost deploys aar and exploded files too.
You need to create a aar file with your services and put it into your WebContent/WEB-INF/services/ directory. You need to update the services.list file too with the name of your services.
After that you must see your services in your openshift server.