Installing NodeJS, Grunt, and Bower with cPanel and CentOS or CloudLinux
NodeJS is a powerful platform built on Chrome's Javascript Runtime that can be used to build fast and scalable web applications (https://www.nodejs.org/).
We recently wanted to start working more closely with Bootstrap and LESS code on cPanel based web servers. For this the "grunt" tool is recommended. With CloudLinux things needed additional configuration to work with CageFS. I hope this helps someone wanting to use Bootstrap with cPanel and CentOS or CloudLinux. Enjoy!
To install NodeJS, Grunt, and Bower on CloudLinux
1. Login to your server as root
2. Create a a directory and move into it:
mkdir ~/nodejs-install; cd ~/nodejs-install
3. Copy the install files. These install the repository that is currently maintained for the rpms
git clone https://github.com/nodesource/distributions.git
4. Move to rpm install folder and run the setup
cd distributions/rpm; sh setup
5. Install nodejs
yum install nodejs
6. Install grunt and bower
npm install -g grunt-cli; npm install -g bower
At this point if you are not using CageFS with CloudLinux you are done. Your nodejs, grunt, and bower commands should all work in the shell. If you are using CageFS please follow the additional instructions.
Configuring NodeJS, Grunt, and Bower for CageFS
7. Configure cagefs for nodejs
touch /etc/cagefs/conf.d/nodejs.cfg
Using your favorite editor copy the following into the nodejs.cfg file:
[nodejs]
comment=Nodejs
paths=/usr/bin/node, /usr/bin/npm, /usr/lib/node_modules/npm
8. Configure cagefs for grunt.
touch /etc/cagefs/conf.d/grunt.cfg
Using your favorite editor copy the following into the grunt.cfg file:
[grunt]
comment=Grunt tools
paths=/usr/bin/grunt, /usr/local/bin/grunt, /usr/lib/node_modules/grunt-cli
9. Configure cagefs for bower.
touch /etc/cagefs/conf.d/bower.cfg
Using your favorite editor copy the following into the bower.cfg file:
[bower]
comment=Bower web tools
paths=/usr/bin/bower, /usr/local/bin/bower, /usr/lib/node_modules/bower
10. Now re-initialize cagefs.
cagefsctl --force-update
11. Your nodejs, grunt, and bower commands should be available on cPanel accounts.
Blogs:
Technical
Wesley Render's blog
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
다양한 언어의 JSONJSON은 Javascript 표기법을 사용하여 데이터 구조를 레이아웃하는 데이터 형식입니다. 그러나 Javascript가 코드에서 이러한 구조를 나타낼 수 있는 유일한 언어는 아닙니다. 저는 일반적으로 '객체'{}...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.