We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
[GUIDE]EASY use Nodejs on VESTAcp Ubuntu
-
- Posts: 15
- Joined: Sat May 05, 2018 12:15 pm
- Os: Ubuntu 15x
- Web: apache + nginx
[GUIDE]EASY use Nodejs on VESTAcp Ubuntu
first we need to install
aptitude
on console
and put
later configure
and we add the new mods
ok now apache is ready to redirect any port from vesta panel to port of nodejs express
Now we have to create a new hosting account
and configure to redirect to nodejs port
open the file
and add this lines:
Behind
ADD
and before the end of document
ADD this:
NOTE: my port of nodejs is 3000 modify as yours and if you want to use a folder to redirect to nodejs put this
now the domain of nodejs will be
http://localhost/nodejs/ -> will send you to http://localhost:3000
REMIND to open port on firewall of nodejs
aptitude
on console
Code: Select all
sudo apt install aptitude
Code: Select all
aptitude install -y libapache2-mod-proxy-html libxml2-dev
Code: Select all
sudo a2enmod
Code: Select all
proxy proxy_ajp proxy_http rewrite deflate headers proxy_balancer proxy_connect proxy_html
Now we have to create a new hosting account
and configure to redirect to nodejs port
open the file
Code: Select all
nano /home/[put user]/conf/web/[web to redirect nodejs ]apache2.httpd.conf
Behind
Code: Select all
<VirtualHost YOUR.IP:PORT>
Code: Select all
ProxyPreserveHost On
ProxyRequests Off
ProxyVia Full
Code: Select all
</VirtualHost>
Code: Select all
<Location />
ProxyPassReverse http://127.0.0.1:3000/
ProxyPass http://127.0.0.1:3000/ connectiontimeout=5 timeout=30
</Location>
Code: Select all
<Location /nodejs>
ProxyPassReverse http://127.0.0.1:3000/
ProxyPass http://127.0.0.1:3000/ connectiontimeout=5 timeout=30
</Location>
http://localhost/nodejs/ -> will send you to http://localhost:3000
REMIND to open port on firewall of nodejs
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: [GUIDE]EASY use Nodejs on VESTAcp Ubuntu
Good guide...
However, Vesta uses Nginx as reverse proxy so wouldn't it be better to configure Nginx to be proxy for your NodeJS straight and not do Nginx > Apache > NodeJS ??
However, Vesta uses Nginx as reverse proxy so wouldn't it be better to configure Nginx to be proxy for your NodeJS straight and not do Nginx > Apache > NodeJS ??
Re: [GUIDE]EASY use Nodejs on VESTAcp Ubuntu
also do not change the conf files in user directory, they get overwritten after a change (for example adding a alias and so on). It is better, to create a nodejs template in /usr/local/vesta/data/templates/web/nginx/, just copy the default template you want to have and do the modification there.
-
- Posts: 15
- Joined: Sat May 05, 2018 12:15 pm
- Os: Ubuntu 15x
- Web: apache + nginx
Re: [GUIDE]EASY use Nodejs on VESTAcp Ubuntu
i am a new user of VESTACP i like so much, so i will read some docs of how make a new template and i will make a new one to send
Re: [GUIDE]EASY use Nodejs on VESTAcp Ubuntu
Hello
It is second day I'm trying to intall nodejs to my VestaCP accordingly to your instruction.
I need help.
In the begginning of tutorial you edit apache configuration in
Then it is advised to use templates, but the root given goes to ngnix configuration
Was it mastake? I think that root to a template should goes to to modify apache configuration.
If not - what changes should be made in nginx template
It is second day I'm trying to intall nodejs to my VestaCP accordingly to your instruction.
I need help.
In the begginning of tutorial you edit apache configuration in
Code: Select all
nano /home/[put user]/conf/web/[web to redirect nodejs ]apache2.httpd.conf
Code: Select all
/usr/local/vesta/data/templates/web/nginx/
Code: Select all
/usr/local/vesta/data/templates/web/apache2/
If not - what changes should be made in nginx template
Code: Select all
default.tpl
Re: [GUIDE]EASY use Nodejs on VESTAcp Ubuntu
This was a mistake yes, please use the apache folder.
Re: [GUIDE]EASY use Nodejs on VESTAcp Ubuntu
Can you check if I modified template without errors?
http://joxi.ru/8Ana0YktqYY8j2
After editing this I typed
When I go to site - this configuration makes Service Unavailable error
Maybe I had to point out http://my.external.ip:3000/ ??
Code: Select all
cd /usr/local/vesta/data/templates/web/apache2#
Code: Select all
nano default.tpl
After editing this I typed
Code: Select all
for user in $(ls /usr/local/vesta/data/users/);do v-rebuild-user $user;done
Maybe I had to point out http://my.external.ip:3000/ ??
Re: [GUIDE]EASY use Nodejs on VESTAcp Ubuntu
would like that robert.ne13 will answer here, my reply was only about the modification place and not the content itself.
-
- Posts: 15
- Joined: Sat May 05, 2018 12:15 pm
- Os: Ubuntu 15x
- Web: apache + nginx
Re: [GUIDE]EASY use Nodejs on VESTAcp Ubuntu
i recomend to you create a new template for this kind of use but instead of this it seems to be all ok you checked the port was opened and started service ?.