Friday 31 March 2017

check log or error on production


Check error logs in nginx.

1. sudo tail -f /var/log/nginx/error.log

Check error logs in production

2. sudo tail -f  log/production.log

Deploy Application on AWS OR DIGITAL OCEAN


AWS

Username : ubuntu (in aws ubuntu is default user )

1. Login server from console and check ubuntu version
2. sudo chmod 400 ~/Desktop/filename.pem

3. ssh -i ~/Desktop/filename.pem ubuntu@192.168.0.123

Digital
Username : root (in digital ocean root is default user)
password: xxxxxxxx

1. Login server from console and check ubuntu version
3.

Goto gorails tutorails follow all step for installing ruby.
Using rvm

Install Nginx

Follow Gorails tutorials

1. sudo nano /etc/nginx/nginx.conf
when open this file only you have to uncomment this line

include
/etc/nginx/passenger.conf;


Please note If you are working with Digital ocean but you are getting error 500 or something root not found. You have to set user root path.

You can check user run command on console ' ls -la ' in this image your username is root









And AWS

you can see screen user www-data is default,it will take automatically if
your application is not running or need authentication user you can
set username instead of www-data 
but no
need to change for this in my career.









2. sudo nano /etc/nginx/passenger.conf
Follow this image for AWS
you have to comment second line or middle line and paste this line
1.passenger_ruby
/home/deploy/.rvm/wrappers/ruby-2.1.2/ruby;
before
set your rvm set root for this in your console write pwd you can file
path
of the project copy and page before wrappers.






Follow this image for Digital Ocean
1.passenger_ruby
/home/deploy/.rvm/wrappers/ruby-2.1.2/ruby;
before
set your rvm set root for this in your console write pwd you can file
path
of the project copy and page before wrappers.







Step 3. sudo nano /etc/nginx/sites-enabled/default

when you will run this command on your console it will open file and you have two option is there first you can commant all line. Second you can customize accourding to us.

But fisrt step is good because most of time you can ignore live error or bugs.

Just go to this screen

This is for AWS


This is for DIGITAL OCEAN













1. Postgres sql

sudo nano /etc/postgresql/9.5/main/pg_hba.conf

set user and authentication replace peer to md5 for defaut and user

postgres is default user and gramcam is also another user




Revert last commit or second last and more....

 Git revert commit_id -m 1 this command willl revert last commit  Git revert commit_id -m 2 this command will revert second commit with same...