Showing posts with label installation. Show all posts
Showing posts with label installation. Show all posts

How to install nodejs in CentOS ?

If you choose default yum install of nodejs you will get 6.x release which is very old.
To install latest version of nodejs in centos you can execute below command
Command 1
  
  	curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -
   

You will get output as below

[vagrant@localhost ps-sinonjs]$ curl -sL https://rpm.nodesource.com/setup_14.x | sudo bash -

## Installing the NodeSource Node.js 14.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m

## Confirming "el7-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_14.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.KNA1QsAK2D' 'https://rpm.nodesource.com/pub_14.x/el/7/x86_64/nodesource-release-el7-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.KNA1QsAK2D'

## Cleaning up...

+ rm -f '/tmp/tmp.KNA1QsAK2D'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `sudo yum install -y nodejs` to install Node.js 14.x and npm.
## You may also need development tools to build native addons:
     sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
     sudo yum install yarn


Your main instructions are here

## Run `sudo yum install -y nodejs` to install Node.js 14.x and npm.
## You may also need development tools to build native addons:
     sudo yum install gcc-c++ make
## To install the Yarn package manager, run:
     curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
     sudo yum install yarn

I mean simply after executing command1 you can execute below commands and it will install latest Node.js version for you.

 sudo yum install -y nodejs 
 sudo yum install gcc-c++ make
 curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
 sudo yum install yarn
Hope it helps.
Thank you for reading the article.

Installing latest Git in CentOS 6.7

Hello ,

I am Raja. Today I am writing this article on installing latest Git in CentOS 6.7 via source.

Actually in CentOS 6.7 , we are getting only 1.7.1 version but the latest Git version is git-2.6.3. And while installing I've been through lot of R&D.
Here I am providing you everything in a single article.

Here the avalibale version of git in CentOS 6.7.

[localserver@dhcppc2 ~]$ yum list  git
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirrors.vonline.vn
 * extras: mirrors.vonline.vn
 * updates: mirrors.vonline.vn
Available Packages
git.i686                          1.7.1-3.el6_4.1                           base
[localserver@dhcppc2 ~]$

Lets begin with install

1. Create a directory and change into that directory.
mkdir git
cd git

2. Get git downloaded using wget and unrar it
wget https://www.kernel.org/pub/software/scm/git/git-2.6.3.tar.gz
tar -xvf git-2.6.3.tar.gz


and then change into directory
cd git-2.6.3

3.Actually in Linux , source based installation are can done with 3 easy steps and they are

./configure
make
make install ( as root user in the same directory )

When I have started  "./configure" I came to know that gcc has not installed in my CentOS 6.7. so installing it with

 
yum install gcc


Then continued to configure and again I got stucked with


cache.h:21:18: warning: zlib.h: No such file or directory
Can't locate ExtUtils/MakeMaker.pm
/bin/sh: msgfmt: command not found


errors. so to stop all these errors I am giving all libraries in single line

yum install zlib zlib-devel perl-ExtUtils-MakeMaker gettext  gcc -y 

Then run these commands again

./confgure
make
make install (as root)
that's it. Git installation got completed.

Now execute below steps to configure your Git and make sure you have a Git account with same E-mail.

git config --global user.name "Raja Sekhar Reddy G"
git config --global user.email ""

----------------------------------------------------------------------

Till now all we have done installation and configuring of Git . Now lets make a SSH based communication between your localrepo's to your Git account.

1. Generate SSH key with your E-mail of Github account

ssh-keygen -t rsa -b 4096 -C ""


2. Make sure SSH-Agent running , it will help us here with key based authentication.

eval "$(ssh-agent -s)"


from the above command if PID got returned then that means SSH-Agent running

and then execute below command

ssh-add ~/.ssh/id_rsa


3. Now open your Public key with below command and copy it.

cat ~/.ssh/id_rsa.pub

4. Login to your Github account.
Github home page -> Settings -> SSH Keys -> Add SSH Keys

It will open a Input field,  paste your copied key and submit.

5. Come to your terminal and type this

ssh -T git@github.com


You will get similar message like below

Hi rajagennu! You've successfully authenticated, but GitHub does not provide shell access.


Now lets create a localrepo and sync it with Github repo remotely

In your terminal , type as

mkdir Python_Admin
cd Python_Admin/
echo "# Python_Admin" >> README.md
cat README.md
git init
git add README.md
git commit -m "First Commit"
git remote add origin git@github.com:rajagennu/Python_Admin.git
git push -u origin master


Now look at your Github repo. You will see your files there.
For example , you have created file named as : sysload.py

then , lets add to git and push to remote repo

touch sysload.py             # created sysload.py
git add sysload.py           # added into Git repo
git commit -m  "just added local file"                # committing changes to localrepo"
git push -u origin master


Now look at your remoterepo in GitHub. You can find sysload.py file there.

Hope it will helps you.

If you need any help , dont hesitate to ask.

Thank you.










Install Google Chrome in CentOS 6.X

Hello ,

In CentOS 6.X , installing Google Chrome webbrowser is not easy task. We have dependencies issues with  "libstdc++.so.6(GLIBCXX_3.4.15)".

On searching I came to know about Chrome Richardlloyd . By using his script we can install Chrome very easily with in CentOS.

To install it , open your terminal and turn into root user and paste these lines one after one
wget http://chrome.richardlloyd.org.uk/install_chrome.sh
chmod u+x install_chrome.sh
./install_chrome.sh
It will install Google Chrome in your CentOS. 

Note : Google announced , dropping support for 32-Bit google chrome from March 2016. 

Installing and Configuring LAMP Server on RHEL6 for Production Environment


     Many people know from their own experience that it's not easy to install an Apache web server and it gets harder if you want to add MySQL, PHP and Perl.XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl. XAMPP is really very easy to install and to use - just download, extract and start.The philosophy behind XAMPP is to build an easy to install distribution for developers to get into the world of Apache. To make it convenient for developers XAMPP is configured with all features turned on. The default configuration is not good from a security point of view and it's not secure enough for a production environment - please don't use XAMPP in such environment.

Here are few steps to install and configure LAMP(Linux Apache MySQL PHP) server on RHEL6 for a production environment.

Apache

Install Apache

Apache is the most popular Web HTTP server for a Linux servers.

#yum install httpd httpd-devel

We might need the httpd-devel libraries to compile and install other modules from the sources, just to be on the safer side. /etc/httpd/conf/httpd.conf is the Apache configuration file location

Start Apache

#service httpd start
#chkconfig httpd on

MySQL

Install MySQL Database Server

MySQL is a widely used open source database server on most Linux servers and can very well integrate to PHP and Apache server on CentOS/RHEL.

#yum install mysql mysql-server mysql-devel

If you attempt to type mysql in command prompt, you will be getting this nasty error.

ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/lib/mysql/mysql.sock’

This is because you are not running the mysqld daemon before launching the mysql client. The file /var/lib/mysql/mysql.sock will be automatically created upon running the first instance of mysql.

To fix:

First start the mysql daemon, then type mysql:

#service mysqld start
#chkconfig mysqld on
#mysql
mysql>

Changing MySQL Root Password

By default the root password is empty for the mysql database. It is a good idea to change the mysql root password to a new one from a security point of view.

mysql> USE mysql;
mysql> UPDATE user SET Password=PASSWORD('newpassword') WHERE user='root';
mysql> FLUSH PRIVILEGES;

Once done, check by logging in:

#mysql -u root -p
Enter Password: <your new password>

To Create A New MySQL User

To create a new mysql user 'guest' with 'all privileges' on the database 'demo':

mysql > create database demo
mysql >GRANT ALL PRIVILEGES ON demo.* TO 'guest'@'localhost' IDENTIFIED BY 'guest' WITH GRANT OPTION;
mysql> UPDATE user SET Password=PASSWORD('guest') WHERE user='guest';

That's it! MySQL is ready! Don't forget to remember the root password as we might be using it with phpmyadmin.

To improve the MySQL security (Optional)

Use the following command
#/usr/bin/mysql_secure_installation

This will help you to change MySQL default security settings in an interactive manner.

PHP

Install PHP5 Scripting Language

Installing PHP5 with the necessary modules is so easy and can be configured for both the Apache and mysql environment.

#yum install php php-mysql php-common php-mbstring php-mcrypt php-devel php-xml

 Note: If we plan to run captcha scripts on our server which are dependent on mysql and other functions don't forget to install php-gd (gd library).

Restart Apache to load php.

#service httpd restart


To Test If PHP Is Working Or Not:

Create a file named /var/www/html/test.php with the following phpinfo() function inside php quotes.

#vim /var/www/html/test.php

// test.php
  <?php
  phpinfo();
  ?>

Then point your browser to http://ip.address/test.php.

That's it! You should see a php configuration file displaying all kind of paths and installed modules.

Closely observe the installed configuration on your server.

* PHP Paths (php.ini path)
* Apache paths and Loaded Modules (mod_security, mod_evasive if installed_)
* PHP GD Library
* MySQL paths and other information

Install phpMyAdmin


phpMyAdmin is a free web based MySQL database Administration Tool. Without phpMyAdmin it is almost impossible to mysql db operations in the command line. phpMyAdmin has become so convenient and it is absolutely sought by most webmasters to be present along with the mysql server.

#yum install phpmyadmin

Point your browser to: http://ip.address/phpmyadmin.

Common Errors

You might encounter the following errors while configuring phpmyadmin.

Error:1
Forbidden 
You don't have permission to access /phpmyadmin/ on this server.
To fix:
Edit the /etc/httpd/conf.d/phpmyadmin.conf and uncomment the line deny from all.

#vim /etc/httpd/conf.d/phpmyadmin.conf
<Directory "/usr/share/phpmyadmin">

  Order Deny,Allow
  # Deny from all
  Allow from 127.0.0.1
  </Directory>

Error:2
The configuration file now needs a secret passphrase (blowfish_secret)
To fix:
#vim /usr/share/phpmyadmin/config.inc.php
Look for a line and enter any password. Just dont leave it empty!
$cfg['blowfish_secret'] = 'mydemopass'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */


Error:3
Cannot load mcrypt extension. Please check your PHP configuration.
To fix:
# vim /etc/php.d/mcrypt.ini
Look for a line and enter replace module.so with mcrypt.so
extension=mcrypt.so

Restart the httpd service gracefully
#service httpd graceful



It worked for me using the above methods!
Log into the phpmyadmin with the mysql root password we changed while installing the mysql database