[GUIDE]EASY use Nodejs on VESTAcp Ubuntu
Posted: Sat May 05, 2018 5:36 pm
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