Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment issue, project works on dev, deployed behind apache there is an odd "Hello world" route #2226

Closed
walt93 opened this issue Aug 2, 2024 · 1 comment

Comments

@walt93
Copy link

walt93 commented Aug 2, 2024

Describe the bug
New to wasp lang dev. I've created a project which I am running using "wasp start" on my development box, and it comes up at localhost:3000. It's been working great, and I've made great progress quickly using this framework/DSL!

When I deploy on my server, I am running behind apache2 as a reverse proxy. I'm testing by running "wasp start" from a terminal window. I can confirm when the wasp server is not running, accessing through apache at the bound domain is returning Service Unavailable. When I am running it, none of my application routes are there, and loading the root route ("/") returns the text "Hello world".

I can confirm in the source directory, on both the Ubuntu server and my Mac that there is a file at .wasp/out/server/bundle/server.js that has a "/" route that returns "Hello world". This is not present in my apps source code, at all. I have confirmed on the Ubuntu server that if I change this string to "WTF", then when I load the root route in a browser pointed to this apache configuration, I get a web page that says "WTF". This tracks with what I am feeling right now, but at least I know what file is serving this route.

Note: I was running it on the default port, 3000, when I got this weird route, I modified the PORT by assigning it in the .env.server file in the server's app's root directory (to see if anything changed), and, the server obliged by changing ports, and this didn't change the behavior of getting routes served from this .wasp/out/server/bundle/server.js. I am unable to see any of my apps routes running on this Linux server. So it's consistent.

Note: If I do a "sudo ufw enable 6500/tcp" (I'm running on port 6500), loading http://99.99.99.99:6500 returns this "Hello world" route, or "WTF" depending if I've edited that server.js file. (Replace 99.99.99.99 with my IP address obviously)

What is causing the wasp app to route everything to this "server.js" on the production box, and why does it not do so on my development box?

To Reproduce
Steps to reproduce the behavior:

  1. Go to an ubuntu server in the cloud
  2. Do a git clone of my project
  3. cd into the project, npm install and wasp start
  4. Run an apache2 reverse proxy script and point it at the wasp server

Expected behavior
To see my application running on the Ubuntu box, not this "Hello world" route

Additional context
Apache config is incredibly thin, and I note that certbot is failing and cant create a cert. This seems salient.

<VirtualHost *:80>
    ServerName testserver.mydomain.com

    ProxyPreserveHost On
    ProxyPass / http://127.0.0.1:6500/
    ProxyPassReverse / http://127.0.0.1:6500/

    ErrorLog ${APACHE_LOG_DIR}/apache.error.log
    CustomLog ${APACHE_LOG_DIR}/apache-access.log combined
</VirtualHost>

Certbot fails to install a cert for this, claiming:

Could not reverse map the HTTPS VirtualHost to the original

@walt93
Copy link
Author

walt93 commented Aug 2, 2024

Just went to the discord. The autoresponder seems to have provided the answer.

🤦

@walt93 walt93 closed this as completed Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant