How to set up nodejs using vagrant ubuntu 14.04
1. Set up a vagrant
>	a. $ vagrant box add trusty64 https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box
	b. $ vagrant init trusty64
	c. edit file "Vagrantfile". Uncomment "forwarded_port" and "private_network"
	d. $ vagrant up

2. login to putty
	host:	192.168.33.11
	port:	2222

3. install PHP
	$ sudo apt-get install -y apache2 apache2-utils
	$ sudo apt-get install -y php5-cli
	$ sudo apt-get install -y curl
	$ sudo apt-get update
	$ sudo /etc/init.d/apache2 reload

4. creating symlink
$ cd /var/www
$ sudo mv html html-back
$ sudo ln -fs /vagrant/www html
$ sudo /etc/init.d/apache2 restart

5. Instal Mysql and phpmyadmin
	a. $ sudo apt-get install mysql-server libapache2-mod-auth-mysql php5-mysql
	b. $ sudo apt-get -y install phpmyadmin

6. Access mysql remotely (using putty)
	a. check ==> "bind-address            = 192.168.33.11"
		$ sudo nano /etc/mysql/my.cnf
	b.
mysql -u root -p mysql
drop user root@192.168.33.11;
flush privileges;
CREATE USER 'root'@'192.168.33.11' IDENTIFIED BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.33.11' WITH GRANT OPTION;
CREATE USER 'root'@'%' IDENTIFIED BY 'root';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;
	c. sudo /etc/init.d/mysql restart

7. Install nodejs and npm
	a. sudo su
	b. curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
	c. sudo apt-get install -y nodejs
	d. npm -g install sails

8. installing sass
(http://wylbur.us/2014-06-12-installing-sass-on-ubuntu-1404)
a. sudo npm install -g bower grunt-cli
b. sudo gem install foundation
c. sudo gem install compass
d. sudo gem install sass

ENJOY!!!

Tags:

Comments are closed.