Monday, October 22, 2018

Boot Linux Grub Boot Loader into single user mode

Power on or Reboot (if it is already running) your machine.

clip_image001[4]

In the next screen you should see the following menu, this is called Grub menu; it will list operating systems (in my case only CentOS installed) that you have installed on the machine.

clip_image002[4]

Once you have pressed, you should see the information about the selected operating system. First line gives the information about the hard disk and partition where the OS installed. Second line gives the information about the location of the kernel, Third line gives the information about the initrd

To enter into single user mode- select kernel line (Line no: 2) using up and down arrow then press “e”.

clip_image003[6]

At the end of the line add “single” to enter into single user mode. Once add, press “Enter”

clip_image004[4]

You will come back to same screen, now press “b” to boot with edited parameters.

clip_image003[7]

Now you should be in command line mode with root privileges

clip_image006[4]

Monday, October 8, 2018

How to Install Apache HTTPD on Linux 6

To Install using YUM package:-

# yum install httpd -y

or

# up2date httpd

Install Apache From Source :-

Download URL : http://www-us.apache.org/dist//httpd/httpd-2.4.29.tar.gz

https://httpd.apache.org/download.cgi#apache24

1. Extract the gz file using tar command

# tar -xvzf httpd-2.2.31.tar.gz

# cd httpd-2.2.31

2. Configure the files

#./configure --prefix=PREFIX

3. Compile

# make

Compile the package using make command

4. Install

# make install

finally install using make install command

Start the Apache:-

To Start the httpd server we can use both the following ways

# /etc/init.d/httpd start

or

#apachetl -k start

clip_image001

To Stop :-

Similarly for stopping the apache server, we can use the stop command

# /etc/init.d/httpd stop

or

#apachetl -k stop

Permanent chkconfig Configuration:-

# chkconfig httpd on

To check whether Apache is running or not:-

Below command will check for the port 80 which is the default configured port for Apache HTTPD.

# netstat -tulpn | grep :80

If apache is running we will see the response like below

tcp 0 0 :::80 ::* LISTEN 0 2710371 7760/httpd

Sunday, October 7, 2018

How to upgrade MS SQL 2014 to SQL 2017

Download the required version.

https://www.microsoft.com/en-us/sql-server/sql-server-editions-express

clip_image001

clip_image002

The Installation Wizard starts the SQL Server Installation Center. To upgrade an existing instance of SQL Server, click Installation in the left-hand navigation area, and then click Upgrade from... previous versions of SQL Server.

clip_image003

Accept the license agreement.

clip_image004

Here you can choose to allow Microsoft updates to pull updates for SQL as well.

clip_image005

In the specify the instance of SQL Server to modify you can choose a specific instance, or in the dropdown combo box, you can also choose to only upgrade shared components.

clip_image006

With the upgrade, it is not possible to change the configured features currently configured by SQL Server 2014.  By default it will upgrade all configured features.

clip_image007

Here you can specify the instance ID for the instance of SQL Server.

clip_image008

Here you can specify the service accounts and collation configuration.

clip_image009

As you can see there are three choices here – Import, Rebuild, and Reset.  Since this was a clean installation of SQL Server 2014 that was being upgraded to SQL Server 2016, I chose to Rebuild full-text catalogs using the new and enhanced word breakers.  As the installation notes below, rebuilding indexes can take a while, and a significant amount of CPU and memory might be required after the upgrade.

clip_image010

Finally, we come to the Ready to Upgrade screen that displays our configuration choices.

clip_image011

After the upgrade process has completed, you are notified that you need to reboot the server to finish out the process.

clip_image012

You should see Succeeded on all the individual upgrade steps.  If not, take a look at the setup log for the upgrade process to begin troubleshooting.

clip_image013

Saturday, October 6, 2018

Install Zabbix agent on Windows

Download Agent Source Code

Download latest windows zabbix agent source code from zabbix official site or use below link to download zabbix agent 3.0.0.

http://www.zabbix.com/downloads/3.0.0/zabbix_agents_3.0.0.win.zip

Check the agent configuration file server IP and hostname of Zabbix server should be defined.

clip_image001

Install Zabbix Agent as Windows Service

Lets install zabbix agent as windows server by executing following command from command line.

c:\zabbix\bin\win64> zabbix_agentd.exe -c c:\zabbix\zabbix_agentd.conf --install

zabbix_agentd.exe [9084]: service [Zabbix Agent] installed successfully
zabbix_agentd.exe [9084]: event source [Zabbix Agent] installed successfully

clip_image002

clip_image003

Start/Stop Agent Service

Use following command to start zabbix agent service from command line

c:\zabbix\bin\win64> zabbix_agentd.exe --start

zabbix_agentd.exe [5048]: service [Zabbix Agent] started successfully

c:\zabbix\bin\win64> zabbix_agentd.exe --stop

zabbix_agentd.exe [7608]: service [Zabbix Agent] stopped successfully

Also we can start/stop/restart from windows services control panel. To open services control panel use below steps.

Open run windows >> type “services.msc” >> press enter

clip_image004

Congratulation’s! You have successfully installed Zabbix Agent on Windows

Friday, October 5, 2018

Zabbix agent installation on RHEL 6

First download the rpm and install it. Then install the agent.

Repository installation

CentOS/RHEL 6:
rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/6/x86_64/zabbix-release-3.4-1.el6.noarch.rpm

To install the agent, run

# yum install zabbix-agent

clip_image001

You can see the agent package installed and dependency packages also get installed.

Check the agent configuration file server IP and hostname of Zabbix server should be defined.

clip_image002

clip_image003

To start the agent service, run:

# service zabbix-agent start

Thursday, October 4, 2018

Install and configure Zabbix agent on CentOS/RHEL 7

First download the rpm and install it. Then install the agent.

Repository installation

CentOS/RHEL 7:

rpm -Uvh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm

To install the agent, run

# yum install zabbix-agent

clip_image001

You can see the agent package installed and dependency packages also get installed.

Check the agent configuration file server IP and hostname of Zabbix server should be defined.

clip_image002

clip_image003

To start the agent service, run:

# systemctl start zabbix-agent

Solve a MySQL/MariaDB "Too many connections" error

Change max_connections

The max_connections variable will need to be changed in two places:

Show the Current max_connections Value

To see the current number of max_connections log in to the MySQL/MariaDB command line client with the command:

mysql -u root -p

Use the command:

SHOW variables;

This will output a list of all of the variables which are set for MySQL/MariaDB. Scroll up through the list to find the value for max_connections.

Update my.cnf

Open the file /etc/my.cnf for editing with the command:

sudo nano /etc/my.cnf

Directly beneath the first line:

[mysqld]

Add a line:

max_connections=[desired new maximum number]

For example, to set max_connections to 200, the first two lines of the file will read:

[mysqld]
max_connections=200

Save and exit the file.


SET GLOBAL

Log in to the MySQL/MariaDB command line client with the command:

mysql -u root -p

Set the new max_connections value with the command:

SET GLOBAL max_connections=[desired new maximum number];

For example, to set max_connections to 200, the command is:

SET GLOBAL max_connections=200;

Exit MySQL/MariaDB with the command:

quit;

How to setup NFS Server on CentOS 7 / RHEL 7

Here are my demo nodes details.

NFS Server IP Address

192.168.12.5

NFS Client IP Address

192.168.12.7

Usage of NFS

File / Folder sharing between Linux systems

Allows to mount remote filesystems locally

Allows applications to share configuration and data files with multiple nodes.

Allows to have updated files across the share.

Install NFS Server

We need to install NFS packages on NFS server, install it using the following command.

[root@server ~]# yum install nfs-utils

Once the packages are installed, enable and start NFS services.

systemctl enable rpcbind

systemctl enable nfs-server

systemctl enable nfs-lock

systemctl enable nfs-idmap

systemctl start rpcbind

systemctl start nfs-server

systemctl start nfs-lock

systemctl start nfs-idmap

Create NFS Share

Create a directory to share with client servers. Here I will be creating a new directory named “nfsfileshare” in “/” partition.

Note: You can also share your existing directory with NFS.

[root@server ~]# mkdir /nfsfileshare

Allow client servers to read and write to the created directory.

[root@server ~]# chmod 777 /nfsfileshare/

We have to modify “/etc/exports“file to make an entry of directory “/nfsfileshare” that you want to share.

[root@server ~]# vi /etc/exports

/nfsfileshare 192.168.12.7(rw,sync,no_root_squash)

/nfsfileshare : shared directory

[root@server ~]# exportfs -r

Configure NFS client

We need to install NFS packages on NFS client-server to mount remote filesystem, install NFS packages using below command.

[root@client ~]# yum -y install nfs-utils

Once the packages are installed, enable and start NFS services.

systemctl enable rpcbind

systemctl start rpcbind

Mount NFS shares on clients

Before mounting the NFS share, we need to check the available shares on the NFS server. To do that,  run the following command on the client-server.

[root@client ~]# showmount -e 192.168.12.5

Export list for 192.168.12.5:

/nfsfileshare 192.168.12.7

[root@client ~]# mkdir /mnt/nfsfileshare

[root@client ~]# mount 192.168.12.5:/nfsfileshare /mnt/nfsfileshare

[root@client ~]# df -hT

Filesystem                 Type      Size  Used Avail Use% Mounted on

devtmpfs                   devtmpfs  478M     0  478M   0% /dev

tmpfs                      tmpfs     489M     0  489M   0% /dev/shm

tmpfs                      tmpfs     489M  620K  488M   1% /run

tmpfs                      tmpfs     489M     0  489M   0% /sys/fs/cgroup

/dev/mapper/fedora-root    xfs        18G  1.3G   17G   8% /

tmpfs                      tmpfs     489M  4.0K  489M   1% /tmp

/dev/sda1                  ext4      477M   93M  355M  21% /boot

tmpfs                      tmpfs      98M     0   98M   0% /run/user/0

192.168.12.5:/nfsfileshare nfs4       50G  858M   50G   2% /mnt/nfsfileshare

Automount NFS Shares

To mount the shares automatically on every reboot, need to modify “/etc/fstab” file of your client system.

Add “green” line at the end.

[root@client ~]# vi /etc/fstab

#

# /etc/fstab

# Created by anaconda on Tue May 22 11:30:49 2018

#

# Accessible filesystems, by reference, are maintained under '/dev/disk'

# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info

#

/dev/mapper/fedora-root /                       xfs     defaults        0 0

UUID=f748af6c-0de9-4dc0-98e6-959ffc400f2f /boot                   ext4    defaults        1 2

/dev/mapper/fedora-swap swap                    swap    defaults        0 0

192.168.12.5:/nfsfileshare/ /mnt/nfsfileshare nfs rw,sync,hard,intr 0 0

save and close the file.

Reboot the client machine and check the share whether it is automatically mounted or not.

[root@client ~]# reboot

Wednesday, October 3, 2018

How do I change the default port of Tomcat?

Tomcat is most popular web server for hosting java based websites. If you want to install tomcat on your system use following tutorials. By default tomcat runs on port 8080. This tutorial will help you to change tomcat server default port.

Stop tomcat server if it is already running.

Open <Tomcat_Home>/conf/server.xml file for editing.

Look for port *8080* in the xml file and replace with any available port.
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />

If there is other tomcat running on the same server, you have to change SHUTDOWN port as well.
<Server port="8005" shutdown="SHUTDOWN">

Start tomcat server.

clip_image001

How to Fix ORA-12505, TNS:listener does not currently know of SID given in connect descriptor

SID is word or DB_UNIQUE_NAME that precedes the DB_DOMAIN. For example, the SID database, as seen in in the full global database name of bookstore.company.com.

SERVICE_NAMES, on the other hand, represent the names by which database instances can be connected to. A SERVICE_NAME will follow the format of the SID followed by the database domain, like so: DB_UNIQUE_NAME.DB_DOMAIN

TNS Names and Configuration

When connecting to an Oracle database, typically your database server will have tnsnames.ora, which is a configuration file that informs the server about NET_SERVICE_NAMES which are valid database connections. By default, this file is located at ORACLE_HOME/network/admin.

For example, a NET_SERVICE_NAME descriptor in tnsnames.ora may be formatted like this:

clip_image001

And listener.ora file, should be look it this.

clip_image002

Monday, October 1, 2018

Creating a New Profile for WebSphere Application Server 8.5

Profile Management Tool was launched.

clip_image001

On WebSphere Customization Toobox, Profile Management Tool, with the Profiles tab selected, click the Create button.

clip_image002

On Profile Management Tools, Environment Selection, highlight the Application server environment type.

Click the Next button.

clip_image003

On Profile Creation Options, select the Typical profile creation radio button.
Note:
Choosing Typical profile creation uses the default configuration settings. It assigns unique names to the profile, node, and host. The tool also assigns unique port values.
Alternatively, you can choose Advanced profile creation to specify your own values for settings such as the location of the profile and names of the profile, node, and host.

Click the Next button.

clip_image004

On Administrative Security, clear the Enable administrative security checkbox.

Click the Next button.

clip_image005

clip_image006

On Profile Creation Summary, review the information for accuracy and click the Create button.

clip_image007

The progress screen is displayed. Wait for the progress to complete 100%, which may take several minutes.

clip_image008

Optionally, on Profile Creation Complete, you can select the check box for Launch the First steps console.

Click the Finish button.

clip_image009

If you chose to run First Steps, on WebSphere Application Server, First steps, select the first option, which is entitled: Installation verification.

clip_image010

Verify that the installation verification completed successfully. You should get the message entitled: The installation verification is complete.

Close the screen for the First steps output.

Verify that you can sign on to the Administration Console. For example:
http://localhost:9060/ibm/console

Installing, Updating, and Configuring WebSphere 8.5 and 8.5.5

    Download all the required software from Oracle JD Edwards Update Center

    • WebSphere Application Server Network Deployment - 3 Disk Images
    • WebSphere Application Server Supplement - 3 Disk Images
    • WebSphere Application Server SDK 1.7 - 3 Disk Images
  • For all supported platforms, you must install the IBM Installation Manager before an IBM WebSphere Application Server can be installed. Follow the steps below to install the Installation Manager.

    1. After you have downloaded and unzipped the IBM Installation Manager software, locate the install executable.

    clip_image001

    Execute ./install to start installation

    # [root@localhost ] # ./install

    clip_image002

    On Install Packages, package selection, select the check box for the latest version of the IBM Installation Manager.

    Click the Next button.

    clip_image003

    On Install Packages, review the International Program License Agreement and click the radio button to accept the terms if you want to continue with the installation.

    Click the Next button.

    clip_image004

    On Install Packages, select a location for Installation Manager, enter an installation directory.
    For example:

    clip_image005

    On Install Packages, summary information, review the summary information and click the Install button to begin the installation.

    clip_image006

    Click on Restart Installation Manager

    clip_image007

    1. You must configure the software repository in the Installation Manager before you can start the product installation. On the initial screen of the IBM Installation Manager, navigate File > Preferences.

    clip_image008

    clip_image009

    clip_image010

    On Preferences, click on the Add Repository... button and enter the location of the repository.config for each of the product

    Enter the below URL in Add Repository

    https://www.ibm.com/software/repositorymanager/V85WASDeveloperILAN

    Optionally, if needed for your installation, you should enable a proxy server and enter proxy information.

    After all repositories are added, click the Install option from the Installation Manager.
    IBM Installation Manager displays a list of available products, as shown in the following example:

    Select the WebSphere Application Server for Developers.

    clip_image011

    clip_image012

    If the IBM Install Manager displays a list of updates, it is recommended that you click the Select Recommended button to accept and install the updates.

    On Install Packages, review the International Program License Agreement and click the radio button to accept the terms if you want to continue with the installation.

    clip_image013

    On Install Packages, select location for the shared resources directory, enter an appropriate location for IMShared. These files will be used by all IBM products installed through the Installation Manager (such as HTTP Server and Customization Toolbox).

    Click the Next button.

    clip_image014

    On Install Packages, translations, select your desired language.

    Click the Next button.

    clip_image015

    On Install Packages, select features, verify that the package for Java JDK is selected.
    Caution:
    Although JDK 1.6 is the default installation, you must choose to install JDK

    Click the Next button.

    Click the Install button.

    clip_image016

    clip_image017

    On Install Packages, the packages are installed, click the Finish button.

    To create a profile, ensure this radio button in the right pane is selected:
    Profile Management Tool to create a profile.

Oracle Database 19c Installation on Oracle Linux 7

Pre-installation settings before installing Oracle Database 19c SELinux If the OS is to be used for an Oracle installation, it is ...