Can You Upload a Complete Folder to Plesk Httpdocs
Advertisements
The Node.js awarding is finally finished! Now it'southward fourth dimension to host the application – i.east. to deploy (publish) it. Plesk is perfect for this. I will show yous step past step how to install Node.js in Plesk and publish your application.
Node.js is becoming more than and more popular and therefore of course the question of hosting the applications. This is where Plesk comes in.
The spider web hosting software tin can be installed on Linux equally well as on Windows servers and offers various possibilities to manage websites and spider web applications – even Node.js applications! Advertisements
Tabular array of Contents
−
- 1. Upload code to the target directory
- ii. Add Node.js extension to Plesk
- three. Activate Node.js for your domain or subdomain
- 4. Install Dependencies
- v. Restart and test the app
- 6. Configure Apache & nginx
1. Upload code to the target directory
Your complete code of the Node.js application must first be uploaded to the server. You lot should already have created a domain or subdomain in Plesk.
You can easily upload everything via (Southward)FTP or git repository to the httpdocs directory on the server. Advertisements
Of import: The node_modules folder does not need to exist uploaded.
2. Add Node.js extension to Plesk
On your Plesk interface, yous can install the Node.js extension under "Extensions". You practise not need to configure anything else for Node.js for the time being.

Attending: Do not execute Node.js independently using the npm command in the console. This can destroy your Plesk installation. Advertisements
3. Actuate Node.js for your domain or subdomain
Only one Node.js application can run per domain or subdomain. To start it, navigate to your respective domain so to "Node.js".

At that place you volition find this view where we take to make some settings (looks slightly different in newer versions – role is the aforementioned):

The individual settings accept the following meaning:
- Node.js Version: Here we can usually select the latest version.
- Document Root: This is the path where your application is/will be.
- Application Manner: Here you tin can choose between "development" and "production". Since we desire to publish our app, we prepare the value to "production".
- Application URL: Nosotros can't change anything here, Plesk only shows u.s. the address where our awarding can be reached.
- Application Root: Hither you must select the directory where our app has the root directory.
- Application Startup File: This is the most important file. The starting point for our program, that is the main JS file. Usually your app.js or alphabetize.js. If it is located in a subdirectory, you take to enter the following value: ./server/index.js.
- Custom environment variables: Here yous accept the possibility to create environment variables for the app. These are variables that your programme tin read via
process.env.VARIABLE
. This is often used for authentication keys (JWT & Co.), express settings or database access data.
Past the way: In Plesk y'all tin can easily host your ain cloud for free with Nextcloud.
Advertisements
four. Install Dependencies
At present we click on "Enable Node.js" and then on "npm-Installation" to install all dependencies from our package.json. Hither our node_modules folder is automatically created in the root directory of the app.
5. Restart and test the app
Now our application is ready. For the application to run correctly, we should printing "Restart App" again. Then we can exam our app by clicking on the corresponding link.
half dozen. Configure Apache & nginx
The default port for Node.js applications is 3000.
On my server I take encountered the problem that my Apache has crashed permanently. This happened within the first few minutes later starting the Node.js application.
I could set up this past deactivating the "proxy fashion". Y'all tin observe this setting nether "Settings for Apache & nginx" of the corresponding domain.

After disabling this feature, the Apache web server ran without problems.
And you have already successfully installed Node.js and published your application! 🙂
What did y'all recollect of this post?
Related Posts
This tin can as well involvement you
Advertisements
Source: https://webdeasy.de/en/deploy-node-js-app-with-plesk/
0 Response to "Can You Upload a Complete Folder to Plesk Httpdocs"
Post a Comment