Website deployment
Website Extraction
-
First you have to extract the
nlytical.zipthen you will get zip files.- Nlytical-web.zip
-
Create
nlytical_webfolder with below commandmkdir -p /var/www/nlytical_web -
Upload
Nlytical-web.zipto a location where you want to deploy Project using FileZilla/var/www/nlytical_web(This is the recommended location)
-
Extract
Nlytical-web.zipto/var/www/nlytical_web -
Here you will get all the files of website.
Configure Environment Variables
-
Edit the
.envfile in the root directory of your project. This step is mandatory to ensure the application can connect to your server. -
Update the following lines in the
.envfile with your actual server and database credentials:NEXT_PUBLIC_API_BASE_URL=http://server_ip/api
Server Starting
- After editing the .env file, you have to create build of website.
- Every time you change the code you have to create build of website and restart the server.
npm run build
- After that you have start the server on port 3005.
PORT=3005 pm2 start npm --name "nlytical_web" -- run start
- If you want to stop the server then use below command.
pm2 stop nlytical_web
- If you want to restart the server then use below command.
pm2 restart nlytical_web
- you have to open your browser and go to
http://server_ip:3005to see the website.