AWS Wordpress Loadbalancer 502 Bad Gateway - wordpress

For the last few days I've been working on deploying a new Wordpress site using this AWS Workshop. (which is very well written)
https://catalog.us-east-1.prod.workshops.aws/workshops/3de93ad5-ebbe-4258-b977-b45cdfe661f1/en-US
I have completed everything exactly how they describe in the guide. But I am running into an issue with the launch configuration. When I copy the UserData scrip in the guide, update the variables with the info for my site and deploy the config I get a 502 error. For testing a wrote a basic scrip that just echos "Hello World" which works as expected. Does anyone have any guidance to resolve this issue?
Thanks!

Related

Next.jsā€”unable to set up proxy

I am trying to make a blog using Storyblok(v2) and Next.js(v13). I've gone through this exact tutorial before, and I was able to get the proxy up and running multiple times. Here is the tutorial for the blog, and here is what I've been using to set up my proxy (on macOS).
The last time that I went through this tutorial, I was using the same versions of Storyblok and Next. I have no problem at all running those commands re: setting up the proxy, and my terminal does say that it's up and running, https://localhost:3010 -> http://localhost:3000.
When I visit both https://localhost:3010 and http://localhost:3000, I get Error: {"message":{}, "status":401, "response":"Unauthorized"}.
Before I created the proxy, everything was working as expected, so I believe that the errors are definitely related to the proxy. Any ideas on what I might be doing wrong here?

ACORE API, assistance with errors and deployment

I'm having trouble with setting up ACORE API's and then having them work on a website.
Background:
Azerothcore running 3.3.5 on a debian standalone server, this has the Database, Core files and runs both the world and auth server basically a standard setup that is shown in the how-to wiki.
I also have a standalone web server, on the same subnet, but it's a separate server running linux and normal web server stuff, this has a wordpress installation with azerothcore plugin for user signup etc.
I'm trying to add the player map (https://github.com/azerothcore/playermap) and the ACORE-API set of functions (server status, arenastats, BG que and wow statistics) (https://github.com/azerothcore/acore-api)
Problem:
I understand the acore-api must be run in a container (docker or whatever) on the server, which I have done and it binds to port 3000, I can then go to the local ip:3000 and it brings up this error. (all db's etc are connecting and soap is working)
error 404 when navigating to IP:3000
I do get a few errors when running NPM install seen here: I'm not sure if they would be causing any issues or not.
screenshot of NPM errors on install
But further that, when I put say 'serverstatus' on the webserver (separate server) and configure the config.ts file I can't seem to get anything to display.
I'm not sure what I'm doing wrong but is the same scenario for all of the different functions for the acore-api
How are these meant to be installed and function? I feel I'm missing a vital step.
Likewise, with PLAYERMAP I have edited the comm_conf.php and set the realmd_id, but when loading the page, I do get the map, but the uptime is missing and no players are shown?
Could someone assist if possible?
Seems like an issue with NodeJS version. Update your NodeJS to latest LTS version 16.13.0 (https://nodejs.org)

Elixir Phoenix production server has issue with Letsencrypt renewal

I have a site built with Elixir Phoenix frame work. The website runs fine in both dev and prod mode.
When the phoenix server is running in dev mode, I have no issue renewingLet's Encrypt certificate, but when the exact same app is running in prod mode, I keep getting permission error when trying to renew. Please noted that I am talking about the exact same app, on the same FreeBSD server, executed by the same user - both command without sudo. The only difference is MIX_ENV=prod
I also noted that in prod mode, the phoenix server log an 404 error when Letsencrypt is trying to access my priv/static/.well-known/acme-challenge/(some-unique-string) My basic set up for phoenix + letsencrypt is detailed in this blog post
The question is: how is phoenix server treating directory/file permission differently between `prod' and 'dev' mode?
Using Elixir 1.2.4 and Phoenix 1.1.4
UPDATE:
Folks, since LetsEncrypt and Phoenix framework evolve rapidly, the issue I listed above is no longer an issue if you are using the latest cerbot from LetsEncrypt and Phoenix 1.2.0
This is not necessary an answer to the original questions though.
I've solved it, by using a route, instead of file:
scope "/.well-known", MyApp do
get "/acme-challenge/:challenge", AcmeChallengeController, :show
end
And a simple controller..
defmodule AcmeChallengeController do
use MyApp, :controller
def show(conn, %{"challenge" => "the_random_file_name"}) do
send_resp(conn, 200, "TheHashInTheFile")
end
def show(conn, _) do
send_resp(conn, 200, "Not valid")
end
end
This is hardcoded, compiled and faster then sending files, but, it would be also possible to use some kind of key/value store, and manage (add/delete) the the challenges from within the UI without re-deployment.

Sending email no longer working on Ubuntu 14.04.1 after deploying with Meteor Up

Recently I added email sending capability to my Meteor app, using both the email package, and the account registration APIs to send emails. The other day, after having tested this thoroughly on my dev machine, I deployed it to our production server using Meteor Up. Once deployed, I did a quick check that the email APIs were working properly, and let it be. A day or two later, I made some minor changes, wrapping these email APIs in a Meteor.defer method to speed up the UI. I tested the changes locally (all fine), and re-deployed. I also ran apt-get update on my server after seeing a notification there were some new security updates available. After doing this, the email system no longer works. I tried reverting back to my previous configuration, and it still isn't working. I'm getting a timeout error:
Exception while invoking method 'forgotPassword' Error: connect ETIMEDOUT
I was wondering if anyone had any ideas on what might be causing this timeout (a blocked port?...how can I diagnose this?). Given my SMTP port is working on my development machine, it doesn't seem to be an issue with my code, but rather either with the MUP deployment, or Ubuntu configuration. I'm not super familiar with configuring Ubuntu servers. Any suggestions on how to go about de-bugging would be greatly appreciated!
We got a similar problem, and it was solved by opening the needed port in EC2. thanks to https://kylegoslin.wordpress.com/2012/06/05/116/

Meteor Up (mup) on EC2 Deployment Different from Local App

On localhost, the app works just fine.
On EC2, the app runs behind nginx. It loads into the browser, but nothing shows up. The browser console displays an Error
TypeError: 'undefined' is not an object (evaluating 'Package["service-configuration"].ServiceConfiguration')
I have no idea how to tackle this problem. Any help appreciated.
EDIT
NGINX is not the problem. The same behavior if I access meteor server directly.
Running "meteor add service-configuration" does fix the above mentioned error, but the absence of the error does not fix the observed behavior, that the app does not render on EC2 whereas it does render when started on localhost. (The error message was the only visible difference between EC2 and localhost. So I suspected that would be the cause. Now that hypothesis must be wrong.) So the problem still persists.
Problem Solved. The Lesson:
Meteor has a debug mode and a production mode. The two may behave differently. On localhost, meteor runs in debug mode per default. On deploy to meteor.com or per mup, the default is production mode. To run meteor in production mode on localhost, run meteor --production.
It looks like you're trying to access the service-configuration configs on your browser.
These are not available client side. This also affects your localhost app but it doesn't break your app (doesn't give you a blank page) because meteor is in debug mode.
In debug mode Meteor files are not concatenated so an error like this would go unnoticed, even if it is thrown on your js console. In production mode the error would halt the rest of your script (since everything is concatenated into a single file)
You need to ensure the code that is doing this only runs on the server side. In general it's not a good idea to have access to the service configuration data on the client side.
Looks like Arunoda and crew are adding a buildOptions.debug setting to the next version of MUP, which should allow you to deploy via MUP and have it act like it's running on localhost. See Arunoda's answer to a related question and (at least for now) documentation for the development version of MUP.

Resources