install Archives - The Linux GURUS https://thelinuxgurus.com/tag/install/ Learn Linux & DevOPS from THE LINUX GURUS Fri, 24 Jan 2020 06:57:38 +0000 en-US hourly 1 https://i0.wp.com/thelinuxgurus.com/wp-content/uploads/2020/01/cropped-thelinuxgurus_transparent_name.png?fit=32%2C32&ssl=1 install Archives - The Linux GURUS https://thelinuxgurus.com/tag/install/ 32 32 148921671 Ultimate guide to install PYTHON from source https://thelinuxgurus.com/ultimate-guide-to-install-python-from-source/ https://thelinuxgurus.com/ultimate-guide-to-install-python-from-source/#respond Fri, 24 Jan 2020 06:57:38 +0000 https://thelinuxgurus.com/?p=1034 Python is one of the most widely used programming and scripting languages. With the use of the Internet of Things (IoT) & Artificial Intelligence (AI)...

The post Ultimate guide to install PYTHON from source appeared first on The Linux GURUS.

]]>
Python is one of the most widely used programming and scripting languages. With the use of the Internet of Things (IoT) & Artificial Intelligence (AI) on the rise, python has become one of the most widely sought computing languages. Python is a high-level programming language used for general-purpose programming.

Python emphasizes on code readability & is very easy to pick up & learn. Moreover, there is a very active community for python & you can start from thousands of projects available for free depending on your use-case.

Recommended Read: How to change timezone in Linux

Also Read: How do i install Tomcat 9 on Ubuntu ???

Python support for versions 2 aka python 2 has been discontinued from 1st Jan, 2020 & now only python version 3.5+ will be supported. In this tutorial, we will learn to install Python from source on Linux systems. Let’s start with system pre-requisites first,


Pre-requisites

We must have packages for all build tools installed on our system, most of the time they are pre-installed but we can make sure by running the following command,

CentOS/RHEL (Amazon Linux, Oracle Linux)

# yum -y groupinstall development

# yum -y install zlib-devel

Ubuntu (Mint, Debian)

$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev

Once these tools have been installed, we can move on to install python from source.


Install Python from source

We will be installing python stable version 3.7.6 in this tutorial, so let’s download tar file for python 3.7.6,

# wget https://www.python.org/ftp/python/3.7.6/Python-3.7.6.tgz

Once it is downloaded on the system, extract it,

# tar -xvf Python-3.7.6.tgz

# cd Python-3.7.6

Now we will run configure to prepare the build,

# ./configure –enable-optimizations –with-ensurepip=install

Next step would be to compile it,

# make

NOTE:- Before you run the next command, please read this. You should the next command i.e. “make altinstall” & DONT USE “make install”, as ‘make install’ will cause your system’s python binary files to be overwritten & that can be catastrophic for your system. I REPEAT DONT RUN ‘make install’.

Now, we can install python with the following command

# make altinstall

That’s it now, once this command finishes, python 3.7.6 will be installed on your system. You can check the version with,

# python -V

We end this tutorial on how to install python from source. Please do send in any questions, queries or suggestions using the comment box below.

If you think we have helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter | Linkedin

TheLinuxGURUS are thankful for your continued support.

The post Ultimate guide to install PYTHON from source appeared first on The Linux GURUS.

]]>
https://thelinuxgurus.com/ultimate-guide-to-install-python-from-source/feed/ 0 1034
Install MongoDB on Ubuntu 16.04 https://thelinuxgurus.com/install-mongodb-on-ubuntu-16-04/ https://thelinuxgurus.com/install-mongodb-on-ubuntu-16-04/#respond Fri, 24 Jan 2020 05:52:28 +0000 https://thelinuxgurus.com/?p=1026 MongoDB is a free & open-source No-SQL database, it uses JSON like document format to store data in the database which is unlike the SQL...

The post Install MongoDB on Ubuntu 16.04 appeared first on The Linux GURUS.

]]>
MongoDB is a free & open-source No-SQL database, it uses JSON like document format to store data in the database which is unlike the SQL database, where data is stored in a row & column-based format.

MongoDB is very fast & has great performance when compared to the SQL database. MongoDB databases are very easy to scale & they also address various shortcomings that other SQL databased present. MongoDB is completely ideal for the types of DB required to handle the data that we have today i.e. big data, IoT, online gaming, etc.

Recommended Read: Important PostgreSQL commands that every beginner should know

Also Read: Complete guide to install MongoDB on CentOS/RHEL

In this tutorial, we will learn to install MongoDB on Ubuntu 16.04. There are two methods with which we can install MongoDB on Ubuntu 16.04,

1- Install using apt manager,

2- Install using tar packages.


1- Install MongoDB on Ubuntu 16.04 using apt

We need to first make sure that “gnupg” package is installed on the system or not, cause we will receive an error while importing the public keys for mongodb if it’s not installed. Install it with the following command,

$ sudo apt-get install gnupg

Next, we will import the public keys for MongoDB,

$ wget -qO – https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add –

Next, we will create the list file for MongoDB with the following command,

$ echo “deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.2 multiverse” | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

Now reload the repositories for packages,

$ sudo apt-get update

Now to install MongoDB on Ubuntu 16.04, execute

$ sudo apt-get install -y mongodb-org

Or to install any specific versions, use the command,

$ sudo apt-get install -y mongodb-org=4.2.2 mongodb-org-server=4.2.2 mongodb-org-shell=4.2.2 mongodb-org-mongos=4.2.2 mongodb-org-tools=4.2.2


2- Install MongoDB on Ubuntu 16.04 using tar packages

Before we can download & install mongodb using tar packages. We must have some packages installed on our servers,

$ sudo apt-get install libcurl3 openssl

We will create a directory for keeping the mongodb packages,

$ mkdir -p /data/mongodb

Next, we have to download the package using the following command,

$ wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1604-4.2.2.tgz

Next, we need to extract the file to the created directory,

$ tar -xvzf /mongodb-linux-x86_64-ubuntu1604-4.2.2.tgz -C /data/mongodb

Next, we will create symbolic links to the binaries directory,

$ sudo ln -s /data/mongodb/bin/* /usr/local/bin/

Now, we need to create a data directory & log directory as well,

$ sudo mkdir -p /var/lib/mongo

$ sudo mkdir -p /var/log/mongo

Next, we have change ownership of these folders to mongod,

$ sudo chown -R mongod:mongod /var/lib/mongo

$ sudo chown -R mongod:mongod /var/log/mongo

Note: When installing using apt package manager, all these folders are created by the system only with required permissions.


Starting & connecting MongoDB

Once we have installed mongodb, we can start the database with the following command,

$ sudo systemctl start mongod

Also, we can use the following command to start db,

$ mongod –dbpath /var/lib/mongo –logpath /var/log/mongodb/mongod.log –fork

Now to connect to the database,

$ mongo


Connecting database from remote systems

By default, we can only connect the database from the localhost & to be able to connect the database from other systems, we need to make configuration in mongodb configuration file,

$ sudo vi /etc/mongod.conf

& look for “net.bindIp”, then change it the following

net.bindIp 0.0.0.0

You can also change & mention a single remote IP address if you only need to connect from a single remote system. After making the changes, you need to restart the database to implement the changes made,

$ sudo systemctl stop mongod

$ sudo systemctl start mongod

Note:- If running database through CLI, we can mention the parameter “–bind_ip” followed by ‘0.0.0.0’ for connecting from all remote IPs or we can also mention a single IP address.

That’s it guys, we now end this tutorial on how to install MongoDB on 16.04. Please do send us your questions, queries & suggestions using the comment box below.

If you think we have helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter | Linkedin

TheLinuxGURUS are thankful for your continued support.

The post Install MongoDB on Ubuntu 16.04 appeared first on The Linux GURUS.

]]>
https://thelinuxgurus.com/install-mongodb-on-ubuntu-16-04/feed/ 0 1026
Simple guide on how to install TOMCAT on CentOS/RHEL https://thelinuxgurus.com/simple-guide-on-how-to-install-tomcat-on-centos-rhel/ https://thelinuxgurus.com/simple-guide-on-how-to-install-tomcat-on-centos-rhel/#respond Mon, 20 Jan 2020 16:16:33 +0000 https://thelinuxgurus.com/?p=1011 Apache Tomcat is one of the oldest & most widely used open-source web server that is used to serve java-based web-pages, it executes Java servlets...

The post Simple guide on how to install TOMCAT on CentOS/RHEL appeared first on The Linux GURUS.

]]>
Apache Tomcat is one of the oldest & most widely used open-source web server that is used to serve java-based web-pages, it executes Java servlets and renders Web pages that include Java Server Page coding. It has been used by a number of organizations for serving java web pages. It generally runs JSP, Servlet, etc.

Recommended Read: Important PostgreSQL commands that every beginner should know

Also Read: Beginner’s guide to install TOMCAT on UBUNTU

In this tutorial, we will learn to install Tomcat on Centos/RedHAT. Let’s start with the pre-requisites for tomcat installation.

Pre-Requisites

We need to have JAVA installed on the system before we can install tomcat on our systems. To install java 8, use the following command,

# yum install java-1.8.0-openjdk-devel

You can refer to this tutorial for detailed instructions on installing java.

Install Tomcat

We will first create a separate user for using the apache tomcat,

# useradd tomcat-user

If required, create a password for user as well,

# passwd tomcat-user

Next, we will create a directory which will act as home directory for tomcat installation,

# mkdir /data/tomcat

# chown tomcat-user:tomat-user /data/tomcat

Now switch to tomcat-user & we will then download the tomcat,

# su – tomcat-user

$ wget http://mirrors.estointernet.in/apache/tomcat/tomcat-8/v8.5.50/bin/apache-tomcat-8.5.50.tar.gz

Now extract the package to tomcat directory,

$ tar -xvzf apache-tomcat-8.5.50.tar.gz -C /data/tomcat

Our tomcat installation is ready & we can now start tomcat by running the startup script,

$ sh /data/tomcat/bin/startup.sh

But we will create a service script to start & stop tomcat. Revert back to root user to create the service file,

# vi /etc/systemd/system/tomcat.service

[Unit]

Description=Apache Tomcat Web Application Container

After=syslog.target network.target

[Service]

Type=forking

Environment=JAVA_HOME=/usr/lib/jvm/jre

Environment=CATALINA_PID=/data/tomcat/temp/tomcat.pid

Environment=CATALINA_HOME=/data/tomcat

Environment=CATALINA_BASE=/data/tomcat

Environment=’CATALINA_dataS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC’

Environment=’JAVA_dataS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom’

ExecStart=/data/tomcat/bin/startup.sh

ExecStop=/bin/kill -15 $MAINPID

User=tomcat

Group=tomcat

[Install]

WantedBy=multi-user.target

Now save the file & exit. Load the newly created service into systemd with this command,

# systemctl daemon-reload

We can now start & stop service using the systemctl,

# systemctl start tomcat

You can now check the tomcat installation by opening the following URL on web browser,

http://127.0.0.1:8080

install tomcat

Next step would be to configure users for management interface of tomat.

Configuring Tomcat

Apache tomcat is now ready to be started but before we do that we need to assign credentials to access ‘Manager’ & ‘GUI’ page of tomcat, as by default no user name and pasword is setup. To asisgn the credentials, we will use the ‘/opt/tomcat/conf/tomcat-users.xml ‘ file,

$ vim /opt/tomcat/conf/tomcat-users.xml

& make the following entries to the file,

<role rolename=”manager-gui” />

<user username=”manager” password=”Password@123″ roles=”manager-gui” />

<role rolename=”admin-gui” />

<user username=”admin” password=”Password@123″ roles=”admin-gui” />

Make sure that you make these entries before the tag ‘tomcat-users’, i.e. make above entries before the below mentioned lines,

<tomcat-users xmlns=”http://tomcat.apache.org/xml”

xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”

xsi:schemaLocation=”http://tomcat.apache.org/xml tomcat-users.xsd”

version=”1.0″>

Once done, save the file & exit. We need to make another change, though this is completely optional & completely depends on how you will access the manager page.We can only access the manager page from the browser on localhost but it we to access it on some other remote machines, we need to modify the ‘context.html’ for manager to comment the lines which disables the remote login,

$ vi /opt/tomcat/webapps/manager/META-INF/context.xml

<Context antiResourceLocking=”false” privileged=”true” >

<!– <Valve className=”org.apache.catalina.valves.RemoteAddrValve”

allow=”127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1″ /> –>

</Context>

Same is to be for host-manager’s context file as well,

$ vi /opt/tomcat/webapps/host-manager/META-INF/context.xml

<Context antiResourceLocking=”false” privileged=”true” >

<!– <Valve className=”org.apache.catalina.valves.RemoteAddrValve”

allow=”127\.\d+\.\d+\.\d+|::1|0:0:0:0:0:0:0:1″ /> –>

</Context>

Now save the file & exit. We can now enter the management interface for tomcat but first we need to restart the apache tomcat,

# systemctl stop tomcat

# systemctl start tomcat

We can now access the management page with the credentials that we have provided above in the configuration. That’s it, we now end this tutorial on how to install Tomcat on CentOS/RedHAT. Please feel free to send in any questions, queries or suggestions using the comment box below.

If you think we have helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter | Linkedin

TheLinuxGURUS are thankful for your continued support.

The post Simple guide on how to install TOMCAT on CentOS/RHEL appeared first on The Linux GURUS.

]]>
https://thelinuxgurus.com/simple-guide-on-how-to-install-tomcat-on-centos-rhel/feed/ 0 1011
How to install JAVA on Ubuntu https://thelinuxgurus.com/how-to-install-java-on-ubuntu/ https://thelinuxgurus.com/how-to-install-java-on-ubuntu/#respond Mon, 20 Jan 2020 15:50:23 +0000 https://thelinuxgurus.com/?p=1000 Java is a very famous, general-purpose programming language that is used for creating applications that run on mobile devices as well as computers. It can...

The post How to install JAVA on Ubuntu appeared first on The Linux GURUS.

]]>
Java is a very famous, general-purpose programming language that is used for creating applications that run on mobile devices as well as computers. It can create applications that can run on a single system as well as can be distributed among servers & clients in a network. In this tutorial, we will learn to install JAVA on Ubuntu systems.

Recommended Read: How to setup SSH login without password on Linux systems

Also Read: How to install Java on CentOS & RHEL

Before we learn how to install JAVA on Ubuntu, we must know the types of java available to install. There are two different types of java versions we can install.

Two versions being,

JAVA JRE (Java Run Time Environment) – JRE is used when you only need to run java based applications.

JAVA JDK (Java Development Kit) – is used for developing Java-based applications. It included JRE, debugging tool & some other libraries.

Moreover, there are two types of java available that we can install OPENJDK Java & Oracle java. Both are similar & provide almost the same functionalities barring for some additional features in Enterprise versions. We will learn to install both the java types in this tutorial.

OpenJDK installation


Java 11

To install OpenJDK java on Ubuntu, we need to execute the following commands from the terminal,

$ sudo apt-get update

$ sudo apt-get install default-jdk

This will install the default java JDK i.e. version 11 on Ubuntu system. If we need to install the java 11 jre, then we need to execute the following command,

$ sudo apt install default-jre


Java 8

To install java 8 on the systems, we need to run the following command,

$ sudo apt-get update

$ sudo apt-get install openjdk-8-jdk

& to install JRE, use the following command,

$ sudo apt-get install openjdk-8-jre

Oracle Java Installation

Oracle Java is not available on the default Ubuntu repositories & we need to install other custom repositories to be able to install java on Ubuntu. Install the repository first with the following command,

$ sudo apt install software-properties-common

$ sudo add-apt-repository ppa:linuxuprising/java

Next update system repositories,

$ sudo apt-get update

& install java on Ubuntu system,

$ sudo apt-get install oracle-java11-installer

Java is now installed on the system. The next part is configuring the default java for the systems as you might have more than one java version installed on the system.

Configuring default Java

Command to configure the default java is,

# alternatives –config java

Then you should get the java versions installed on the system, type the number mentioned against the java version & press enter to make it the default versions. This will change the java versions to one that you want. We end this tutorial on how to install java. Please do let us know if you have questions, queries or suggestions using the comment box below.

If you think we have helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter | Linkedin

TheLinuxGURUS are thankful for your continued support.

The post How to install JAVA on Ubuntu appeared first on The Linux GURUS.

]]>
https://thelinuxgurus.com/how-to-install-java-on-ubuntu/feed/ 0 1000