How to setup Nuxt.js app and run it on cpanel?
Hi,
I am trying to setup nuxt.js app on cpanel. Here is what I done so far. I have created and app and registered it. Then tested it from cli by running /opt/cpanel/ea-nodejs20/bin/node /home/user/test/.output/server/index.mjs it works and I can curl it on localhost port 3000. Because nuxt generates startup at approot/.output/server/index.mjs I modified apache config as it was instructed on https://docs.cpanel.net/knowledge-base/web-services/how-to-install-a-node.js-application/ here is my config:/etc/apache2/conf.d/userdata/ssl/2_4/user/
new.conf
```
<Location "/">
<IfModule mod_passenger.c>
PassengerAppEnv "development"
PassengerEnabled on
PassengerBaseURI "/"
PassengerAppRoot "/home/user/test/.output/server"
PassengerAppGroupName "user - new"
PassengerStartupFile index.mjs
PassengerRuby /opt/cpanel/ea-ruby27/root/usr/libexec/passenger-ruby27
PassengerPython /usr/bin/python3
PassengerNodejs /opt/cpanel/ea-nodejs20/bin/node
</IfModule>
</Location>
<Directory "/home/user/test/">
Allow from all
Options -MultiViews
Options -Indexes
Require all granted
</Directory>
```
After I ran /usr/local/cpanel/scripts/rebuildhttpdconf and /usr/local/cpanel/scripts/restartsrv_httpd
But for some reason no matter what I do it throws 403 error, what am I doing wrong?
-
Hey there! Are you able to get the test application working as outlined in our documentation here? https://docs.cpanel.net/knowledge-base/web-services/how-to-install-a-node.js-application/
0
Please sign in to leave a comment.
Comments
1 comment