lunch mean stack application on centos vps Beside apache - angularjs

Actually I`m a little confused, please help me.
I learned MEAN stack (AngularJS + Node.js + Express.js + MongoDB) and I made my first application.
I have a centOs vps that have installed Apache + mySQL + PHP and DirectAdmin for manage visually.
My problems are:
Which directory of my VPS should I upload my application?
How can is install MEAN on this server without disable LAMP? My MEAN application and my WordPress sites work on on VPS.
How can I run my MongoDB and Node.js application? By SSH? If I run these by SSH and close my putty, what will happen for my application? Is it necessery to keep open putty all the time?
I want to lunch my app but I`m confused really!

First of all you need to understand that your MongoDB and NodeJS would run independently without any connection between them.
The status of these would not change once i.e they would not go down once any putty connection is closed. As long as the process associated with them is not killed or goes stale, they would be intact.
Please refer to the below links for further information on installing NodeJS & MongoDB :
https://nodejs.org/en/download/package-manager/
https://docs.mongodb.com/manual/installation/
Please post your folder/file structure of your application and the means chosen for deployment for more help.

Related

How to check a VPS configuration (Nest and React)?

I need to update the web app of a client of mine. That webapp uses Nest as a backend (along with Prisma and SQLite) and React as a frontend. Everything seems to run off of a VPS running Ubuntu.
I have a couple of questions since i've never used a VPS before :
How do I check the configuration of the VPS so that I can update the front-end and/or the backend without crashing the whole system and losing all the DB data ?
Is it necessarily using nginx ?
Thank you in advance

How to call my API in XAMPP when this server has an IP different than localhost?

I installed the new XAMPP 7.4 in macOS Catalina and the window is very different than before. I press Mount and it runs. But I have Angularjs projects that calls API Rest Laravel projects in htdocs, but doesn't work because it calls to localhost or to the local IP of the computer, but I don't know how XAMPP works now.
XAMPP creates a new ip where is htdocs and I access to the folder throw the IP but my Angularjs projects can't access because they don't know the IP, only call to 127.0.0.1.
How can I configure XAMPP to work with localhost or how can I configure Angularjs to call to that IP without affect my production server?
Thank you!
Disclaimer: I have not done this before, my answer is based on my angularjs experience and a brief search.
Trying a brand new project
In this article (which you have probably already seen and tried): https://kode-blog.io/angularjs-install-and-configure there is a very relevant segment, namely Step 1: "You can directly create the folder angular-js in drive C:\xampp\htdocs". I understand your issues is just vaguely related, though you could try following this article step-by-step with a brand new project
XAMPP to local/virtual host
If I understood correctly you are looking for a way to modify the XAMPP/AngularJS serving to the same IP. Let's try setting XAMPP to localhost first:
Setting up a virtual host on XAMPP on Mac or How to set xampp open localhost:8080 instead of just localhost and also more detailed, step-by-step ones: https://jonathannicol.com/blog/2012/03/11/configuring-virtualhosts-in-xampp-on-mac/
Serving AngularJS to a specific host
AngularJS is a lot less flexible than Angular 2+ (Set default host and port for ng serve in config file) when it comes to serving a host. You could try using http-server and node.js (first answer here: How to create a localhost server to run an AngularJS project but also check out other answers, there is some extra useful info there)
Extra bits
What you are trying seems to be absolutely feasible and done by others (Setup AngularJS and NodeJS on Xampp Web server or https://www.quora.com/Can-we-use-AngularJS-in-XAMPP) but it's not the most common thing.
I know that this answer does not directly give you an easy-to-implement-one-single-line-of-wondercode, but I hope it will start discussion at least and result in something more useful.
To use a Status IP like localhost:8080, you have to go to the Network tab in XAMPP and press Enable on the localhost:8080 option. I feel ashamed for taking too long to find this. Thank you.

How to deploy a simple json-server?

I completed an online React course and deployed my application to Heroku. During development, I used the 'json-server' module found at https://github.com/typicode/json-server. This served up a folder on my computer which contained a simple json file and a few images for my website while conforming with the REST API. What do I need to do to get the server to operate independently of my machine so that my application can fetch the data ? I have zero experience doing this.
if you mean you want to create a server for your site,
first of all, you need to get a server, which can run nodejs , then you need to deploy and run your JSON server via a nodejs(express) app.
then you can connect to your server via your website/app
in order to do these things, you can follow tutorials
there are lots of tutorials about it.
hope you got the idea.

Piwik (Matomo) installation in an AngularJS app

I have to install Piwik (now Matomo) analytics tool in an AngularJS project. I am using windows and I have to do it in my local environment. I am an absolute noob in this backend stuff So, cannot figure out how to proceed.
The brief idea that I have got till now is that I'll have to use node.js with express.js to setup the local server. Also, I have to use mySQL along with it to store the data.
So, my question is that how can I do the same? Any relevant resources will be really helpful.

Hosting Angular fullstack project

I started a new Yeoman angular-fullstack project (client-angular.js, server-node.js)
(generator: https://github.com/DaftMonk/generator-angular-fullstack)
I have 2 seperated directories for client and server,
I want to launch the app but the deployment don't show any index.html file,
The question is, Should I make 2 different hosts for the server and the client?
if no, how can I host and use the united projects?
No, it is not needed to create 2 different hosts for the server.
The server needs to point to app.js, usually located at server/app.js, as this is the entry point (instead of index.html) of your app. How this is done depends solely on the server you intend on using.
If you consider using IIS you can take a look at: Installing and Running node.js applications within IIS on Windows
As for the other deployment options, as laggingreflex said, "Heroku is the popular choice to host node.js projects". The angular-fullstack git site has more information on deploying to Heroku or Openshift.
As a side note:
Deploying to IIS requires a bit more attention than the information in the link specified. You need to set file access, create a web.config file as well as a few other stuff. At least, I had to...
You'll need a host that supports MongoDB assuming you kept the Database the same after generating your application. Heroku is a great option as it allows you to setup up plugins like mongolab or mongohq fairly easily. I would also recommend looking into Digital Ocean as they allow you to set up a droplet/server that has what you need for the application to run.
If you go with Digital Ocean and are a student check out https://education.github.com/pack. You'll actually receive $100 credit towards a new Digital Ocean account which will let you test things out.
Good luck!

Resources