Friday 21 September 2018

Node noob in need of help due to an issue that most likely is just his lack of knowledge.

Greetings All,​I'm sorry if this is the wrong place to post this, I'm relatively new to this. I've been an observer on reddit for years but this is my first time ever reaching out.I'm having some difficulties getting a website I built with node.js up and running and I'm posting this here to see if anyone can spot something I'm not seeing or maybe just point me in the right direction. Any and all comments are greatly appreciated!So I'm host a site I built with node on an A2 managed server (work constraints, trust me I know smh). It's a CentOS 6.X box. I got node and npm installed just fine and also configured my application to run on port 49157 because...To run a Node.js application on a managed server, you must select an unused port between 49152 and 65535 (inclusive). ^ directly from their docs.I got my application directory all setup, "~/myapp_repo/myapp" to keep it simple. I'm just trying to deploy the default express page right now to test things out. I've setup the .htaccess file in the "~/public_html" directory to forward all web traffic to port 49157. When I try to access the site via my web browser I am presented with the default a2 hosting page but when I curl the site at port 49157, I get the page I'm hoping for!$ curl http://mysite.com:49157

Express

Welcome to Express

^ This is the page I want to receive when I request my site's domain in a web browser.​It's driving me insane because I feel so close yet so far away from figuring this out. My node app is at least somewhat working correctly since I am receive a successful curl response. The re-routing of traffic is where I think the issue lies. I'm still new to building with node and on the web in general so please pardon my stupidity in any and everything I have said or may say!​My best guess is that I'm doing something wrong within my .htaccess config so here's that$ cat ~/public_html/.htaccess RewriteEngine On RewriteRule ^$ http://127.0.0.1:49157/ [P,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ https://ift.tt/2I59iqb [P,L] Again, any and all comments or suggestions would be super! Thanks a ton.​UPDATE - I forgot to clearly state the fact that I DO NOT have root access to the server. Unfortunately when accessing a managed (shared) server, you are not provided root access.

Submitted September 21, 2018 at 08:00PM by srclord

No comments:

Post a Comment