//
archives

Linux

This category contains 7 posts

Disable root user remote access in Linux

Disable root remote login in Linux (SLES, CENTOS, Oracle Linux, Red Hat) It is the best practice to disable the root remote login in Linux. Login as a system user, then login as root if it is necessarily. To do this, using following Change the following to “no” Restart sshd

use ‘sed’ to list all content of a file after a specified word in Linux

In many cases, DBAs need to check the database log file. But if the database log contain million of rows how do we check the log by Date. Use ‘cat’ command will be very time consuming. Here is an example:

Apache Httpd server Installation (source code) on CentOS Linux

Install Apache Httpd server on CentOS Linux Operation System: CentOS6.7 X86_64 Software Packages required Apache HTTPD httpd-2.2.23.tar.gz Apache Portable Runtime apr-1.5.1.tar.gz APR-util apr-util-1.5.4.tar.gz PRCE (for apache 2.4) pcre-8.36.tar.gz Step1) Unzip the installation package [root@LXTESTWIKI01 ~]# tar -xvzf httpd-2.2.29.tar.gz [root@LXTESTWIKI01 ~]# tar -xvzf apr-1.5.1.tar.gz [root@LXTESTWIKI01 ~]# tar -xvzf apr-util-1.5.4.tar.gz [root@LXTESTWIKI01 ~]# tar -xvzf pcre-8.36.tar.gz Step2) Install … Continue reading

Linux ‘df’ command and example (Keep add on)

Linux ‘df’ command and example List all volumes information on the server df -H | grep -vE ‘^Filesystem|tmpfs|cdrom’ | ${AWK_BIN} ‘{ print $5 ” ” $1 }’ | while read output;

Linux ‘find’ command and example (keep add on)

Linux ‘find’ command and example Find all .xml files in the target folder and tar into one .gz file find /target_folder -mtime +5 -name “*.xml” -type f -exec tar -cvf temp_log_xml.tar {} \; Find all .xml files created 5 days ago in the target folder and delete it find /target_folder -mtime +5 -name “*.xml” -type … Continue reading

Linux ‘du’ command and example (keep add on)

Linux ‘du’ command and example List all sub folders with size bigger than 1GB du -h –max-depth=1 /folderLocation | grep ‘[0-9]G\>’

Forcing user to re-set the password after the first login (SLES11)

Login to the Linux Server as root or super users Open another terminal screen and try to login with the login name and old password The Linux now will ask the user to change the password after the old password has been entered correctly.

Web Server and Application Server

Web Server A Web Server can resolve (handles) HTTP request (protocol). When the web server received a HTTP request, it will return a HTTP response to clients, for example sent back a HTML page? We will further illustrate this process, when a request is sent to the Web server where came, it only simply put … Continue reading

Binding ASM Disk with Linux Multipath and Udev on SLES11 SP2

To use the Multipath and Udev, we have to understand what are they, why we want to use it. What is ‘Device Mapper Multipath’ (multipath I/O)? Device Mapper Multipath(DM-Multipath)can configure muliple I/O links between the server nodes to SAN as a single device. These I/O links might consist with various cables, switches and SCSI controllers  … Continue reading

Install the new python version on Linux

Download the latest python version from python website unzip the python source code [root@test01] tar -xvzf  Python-3.4.2.tgz [root@test01] cd Python-3.4.2 Start the installation of the new python [root@test01] ./configure [root@test01] make [root@test01] make install Re-link the new version python bin with /usr/bin/python: [root@test01] ln -sf /usr/local/bin/python3.4 /usr/bin/python