Posts

Apache Tomcat Installation - Centos 7

Image
    The Apache Tomcat software is an open source which helps to run Java Servlet, JavaServer Pages, Java Expression Language and Java Web-socket technologies. For your better understanding apache tomcat is a web server that serves JSP pages.     Apache Tomcat is trademark of the Apache Software Foundation.     In this articles we are going to install Apache Tomcat through source file on /usr/local/ directory. Where we going to run our web server. The default port for Apache Tomcat is 8080 .     Installing from source used to be very common and also quite simple. You would download the source file, unpack it (with either zip or tar), then issue the commands to the the directory you want to install it. Requirements to Run Apache Tomcat server:     Java to be installed, There is a single requirement for Apache tomcat that is your server should be installed with Java or JDK. Installing Java: ...

Installing and Setting JAVA_HOME environment in Linux - Source Installation

Image
     In this article we are going to see how to install different Java version on your linux system and also how to make it as a default one. Installing through yum:     When we install java directly the current version is JDK-1.8.0_181 $ yum install java     To check the version of the Java use the below command, $ which java jhony@ljunix~$ which java /usr/bin/java $ java -version jhony@ljunix~$ java -version openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)     We can run our applications on different Java versions through source installation. Installing through source:     Download the latest file from the official site. Click the following link for downloading the latest version ORACLE.COM . You have to accept the License Agreement to get the download link for the required version. Note: Yo...

Replacing Commands for Linux Files - Using Perl and Sed

Image
     A file may contain different types of strings, numbers, special characters, etc..,. We can directly edit the file using a file editor, but that applies to a single file only. If we wish to search and replace a particular word or number on multiple files, it is a burden to edit manually on every single file. In such situations we use Perl and Sed commands to achieve it.        In this article we are going to see how to replace strings, numbers in a file or a set of files using perl command and sed command. Using Perl:     Perl is the command interpreter of the Perl programming language . Perl has a large number of options that can be useful on the command line. In this article we will be seeing how to perform search and replace alone as stated earlier. Syntax:                            ...

Linux File Permissions - Basics and Commands

Image
    As an open source, accessing a file requires more security in Linux. This has been maintained by providing file permissions and access modes. These are applicable for all files and directory. File Permissions:     The file permissions tells who all have access to the files.There are 3 attributes in file permissions classified as, Owner Permission Group Permission Other or world Permission Owner Permission:     The owner permission defines the action that can be done to the files by the Owner. Group Permission:     The Group permission defines the action that can be done to the files by the users on the group. Other or world Permission:     The Other permissions defines the action that can be done to the files by the world or public. File Modes:     The file modes defines what kind of access are provided to the users. There are 3 attributes in file modes as ...

Searching tool in Linux - Grep Commands

Image
    In Linux we use Grep as a search tool. It helps to search files on directory, search strings in a file. It is also a kind of a filter. Grep stands for Global search for Regular Expressions and Print . Grep helps to find strings in a large set of log files and codes. It is applicable for most of the files.     In this article we will be seeing some important grep commands with different options which will help us to make our search better.     The basic syntax for a grep command will include with the search string and filename. Different flags can be used for a customized search. Basic Syntax:                  grep "search_word" File_name        Our demo files will be Testfile_1.txt, Testfile_2.txt, Testfile_1.php. $cat Testfile_1.txt Hi LJunix users Im a searching document consists of some numbers and strings. Searching a number = 18976 Im ...

Sorting and Listing Files, Directory in Linux - Basic commands

Image
    In this article we will be seeing how to sort Files and Directory in a Linux system. We will be doing with a single command ls and with different flags.     The  ls  command with no flag lists the files and directory on the current working directory. With  l  alone the directory will end with /. $ ls Listing the files and directories in Ascending order:     The default command itself list the files and directory in an ascending order, $ ls ljunix@ljunix:~$ ls 2.png Documents emoj.conf Games image1.jpg mozilla.pdf Pictures Templates test.sh Videos Desktop Downloads example.php host.txt image-nic.png Music snap Test.conf test.txt $ l ljunix@ljunix:~$ l 2.png Documents/ emoj.conf Games/ image1.jpg mozilla.pdf Pictures/ Templates/ test.sh Videos/ Desktop/ Downloads/ example.php host.txt image-nic.png Music/ snap/ Test.conf ...

Working on Linux Files - Basic Commands

Image
In this article we will be seeing some basic commands while working on files in Linux. In Linux there are more applications to create and edit a file. Some of them are Vi editor , Vim editor (extended version for vi), Nano , Emacs , etc..,. These text editors are applicable in minimal installation. In GUI we can use Gedit, Sublime text, etc.,. Creating a File: You can create a empty file using  touch  command, $ touch example.txt To add contents to the file use  echo   command, $ echo This is first line > example.txt To add more contents use >> symbol which will append the new content on the preceding line, $ echo This is Second line >> example.txt $ echo This is Third line >> example.txt $ echo This is Fourth line >> example.txt You can use  cat  or  less  command to see the content of the file, It only prints the content of the file.To edit the file you can open the file with any of the text editors as ment...

Working on Linux Directory - Basic Commands

Image
Working on Directories in Linux: In this articles we gonna see some useful commands while working on files and directory in a Linux system. Directory: The directory is the place where files and subdirectories are created. While coming in GUI we call a directory as a folder. A directory can hold more sub-directories or sub-folders inside it. In Linux the  /  is known as the root directory where everything on your Linux system is located under this directory. Creating directory: To create a directory use  mkdir  command, user@ljunix:/home$ mkdir Dir1 user@ljunix:/home$ mkdir Dir2 The above commands creates two directories as Dir1 and Dir2 , Creating Consecutive  directory: To create consecutive directory use  -p   command with mkdir, this allows you to create sub-directory inside a directory. user@ljunix:/home$ mkdir -p Dir1/Subdir1/Subdir2/Subdir2 The above command creates all subdirectories in a single command. ...

How to install Wordpress in a Linux system

Image
WordPress is one of the popular Content Management System (CMS). It is an open source website creation tool build by PHP. Most the websites are running through this application. It is also available in FTP server or we can configure it and run from our own servers. In this article we going to see how to install and run Wordpress in our local system. For installing wordpress the server should be a LAMP configured server since wordpress is a PHP based application, For LAMP installation, For Centos, Click here for RPM based machines. For Ubuntu, Click here for Debian based machines. Installing wordpress,     Download the wordpress opensource package from their official site Wordpress.Org . You can either download the zip file or tar.gz file. $ wget https://wordpress.org/latest.zip Unzip the file $ unzip latest.zip Move the unzipped file to the document root of your apache server. $ mv wordpress /usr/local/apache-2.4.37/htdocs/ Add a Vir...

How to Install LAMP Stack on Linux - Ubuntu 17.04

Image
What is LAMP?     LAMP stands for Linux with Apache, Mysql and PHP. In this article we are going to see how to install a LAMP stack in Debian based machines Ubuntu-17.04. We are going to install all these packages through source installation which allows us to install required versions. Installing Apache:     On my previous articles i showed how to run a customized apache through source installation. Click here if you miss the article for installing Apache. Installing Mysql:     On Ubuntu machine we are going to install the default mysql through apt. $ apt-get install mysql-server $ systemctl start mysql Installing PHP:     As already told we are configuring applications through source installations. Downloading the source package,     Download the package from PHP official site. Click here to go to the downloads page. This page has the latest stable version for PHP.  For older...

Blog Top Sites

Blog Log