Showing posts with label Unix. Show all posts
Showing posts with label Unix. Show all posts

WinSCP-SFTP

WinSCP 

Error: SFTP not supported

Connection has been unexpectedly closed. Server sent command exit status 1 (or 255 or 0)

Unable to connect to the Unix host with user id and password.

Solution:

Your password got expiated and due to that unable to logging with it. Change the your password and try again.


How to install multiple instance of Tomcat 8 in CentOS?

For installing the Tomcat 8 we need JDK1.7, for more details must see bellow email:





1. Verifying, Installing and Configuring Java

java -version

[root@vagrant-centos65 tomcats]# java -version
java version "1.7.0_95"

To install on CentOS/RHEL 7 Distribution:

[root@vagrant-centos65 tomcats]# yum install java-1.7.0-openjdk

2. Downloading Tomcat 8

http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-8/v8.0.32/bin/apache-tomcat-8.0.32.tar.gz

[root@vagrant-centos65 tomcats]#wget http://mirror.ox.ac.uk/sites/rsync.apache.org/tomcat/tomcat-8/v8.0.32/bin/apache-tomcat-8.0.32.tar.gz

[root@vagrant-centos65 tomcats]#tar -zxvf apache-tomcat-8.0.32.tar.gz

3. Running Tomcat 8

cd ~/bin
./startup.sh

4. Setup user accounts
vi ~/conf/tomcat-users.xml

<role rolename="manager-gui"/>
<user username="vinod" password="pwd" roles="manager-gui"/>

<role rolename="admin-gui"/>
<user username="admin" password="admin" roles="manager-gui, admin-gui"/>

cd ~/bin
./shutdown.sh
./startup.sh

6. Verify tomcat by URL http://localhost:9001/manager/
Tomcat Multiple Installation In CentOS with Example 9001

For second and other instance you have to just do as mention bellow:

tar -zxvf apache-tomcat-8.0.32.tar.gz -C /yournewdirname/

vi ~/conf/tomcat-users.xml

<role rolename="manager-gui"/>
<user username="vinod" password="pwd" roles="manager-gui"/>

<role rolename="admin-gui"/>
<user username="admin" password="admin" roles="manager-gui, admin-gui"/>

Change the port in server.xml file, if port conflict there then change the other value:

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- Note:  A "Server" is not itself a "Container", so you may not
     define subcomponents such as "Valves" at this level.
     Documentation at /docs/config/server.html
 -->
<Server port="8051" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.startup.VersionLoggerListener" />
  <!-- Security listener. Documentation at /docs/config/listeners.html
  <Listener className="org.apache.catalina.security.SecurityListener" />
  -->
  <!--APR library loader. Documentation at /docs/apr.html -->
  <Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
  <!-- Prevent memory leaks due to use of particular java/javax APIs-->
  <Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
  <Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />

  <!-- Global JNDI resources
       Documentation at /docs/jndi-resources-howto.html
  -->
  <GlobalNamingResources>
    <!-- Editable user database that can also be used by
         UserDatabaseRealm to authenticate users
    -->
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>

  <!-- A "Service" is a collection of one or more "Connectors" that share
       a single "Container" Note:  A "Service" is not itself a "Container",
       so you may not define subcomponents such as "Valves" at this level.
       Documentation at /docs/config/service.html
   -->
  <Service name="Catalina">

    <!--The connectors can use a shared executor, you can define one or more named thread pools-->
    <!--
    <Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
        maxThreads="150" minSpareThreads="4"/>
    -->


    <!-- A "Connector" represents an endpoint by which requests are received
         and responses are returned. Documentation at :
         Java HTTP Connector: /docs/config/http.html (blocking & non-blocking)
         Java AJP  Connector: /docs/config/ajp.html
         APR (HTTP/AJP) Connector: /docs/apr.html
         Define a non-SSL/TLS HTTP/1.1 Connector on port 8091
    -->
    <Connector port="9001" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8491" />
    <!-- A "Connector" using the shared thread pool-->
    <!--
    <Connector executor="tomcatThreadPool"
               port="9001" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8491" />
    -->
    <!-- Define a SSL/TLS HTTP/1.1 Connector on port 8491
         This connector uses the NIO implementation that requires the JSSE
         style configuration. When using the APR/native implementation, the
         OpenSSL style configuration is required as described in the APR/native
         documentation -->
    <!--
    <Connector port="8491" protocol="org.apache.coyote.http11.Http11NioProtocol"
               maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
               clientAuth="false" sslProtocol="TLS" />
    -->

    <!-- Define an AJP 1.3 Connector on port 8009 -->
    <Connector port="2001" protocol="AJP/1.3" redirectPort="8491" />


    <!-- An Engine represents the entry point (within Catalina) that processes
         every request.  The Engine implementation for Tomcat stand alone
         analyzes the HTTP headers included with the request, and passes them
         on to the appropriate Host (virtual host).
         Documentation at /docs/config/engine.html -->

    <!-- You should set jvmRoute to support load-balancing via AJP ie :
    <Engine name="Catalina" defaultHost="localhost" jvmRoute="jvm1">
    -->
    <Engine name="Catalina" defaultHost="localhost">

      <!--For clustering, please take a look at documentation at:
          /docs/cluster-howto.html  (simple how to)
          /docs/config/cluster.html (reference documentation) -->
      <!--
      <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>
      -->

      <!-- Use the LockOutRealm to prevent attempts to guess user passwords
           via a brute-force attack -->
      <Realm className="org.apache.catalina.realm.LockOutRealm">
        <!-- This Realm uses the UserDatabase configured in the global JNDI
             resources under the key "UserDatabase".  Any edits
             that are performed against this UserDatabase are immediately
             available for use by the Realm.  -->
        <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
               resourceName="UserDatabase"/>
      </Realm>

      <Host name="localhost"  appBase="webapps"
            unpackWARs="true" autoDeploy="true">

        <!-- SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html -->
        <!--
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        -->

        <!-- Access log processes all example.
             Documentation at: /docs/config/valve.html
             Note: The pattern used is equivalent to using pattern="common" -->
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
               prefix="localhost_access_log" suffix=".txt"
               pattern="%h %l %u %t &quot;%r&quot; %s %b" />

      </Host>
    </Engine>
  </Service>
</Server>

cd ~/bin
./startup.sh

Verify tomcat by URL http://localhost:9002/manager/

Tomcat Multiple Installation In CentOS with Example 9002



Please must see video for more details.

Like and share it!!!

How to install/uninstall GIT in CentOS6.5 by yum command


In this tutorials we learn how to install git in CentOS 6.5 with help of yum command:

Requirement:
CentOS 6.5
Internet connectivity
Root level access
Basic knowledge of Unix command



Let's start





[root@vagrant-centos65 vagrant]# yum install git-all
Loaded plugins: fastestmirror, versionlock
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: centos.mirroring.pulsant.co.uk
 * epel: mir01.syntis.net
 * extras: anorien.csc.warwick.ac.uk
 * updates: centos.serverspace.co.uk
Resolving Dependencies
--> Running transaction check
---> Package git-all.noarch 0:1.7.1-3.el6_4.1 will be installed
--> Processing Dependency: perl-Git = 1.7.1-3.el6_4.1 for package: git-all-1.7.1-3.el6_4.1.noarch
--> Processing Dependency: gitk = 1.7.1-3.el6_4.1 for package: git-all-1.7.1-3.el6_4.1.noarch
--> Processing Dependency: git-svn = 1.7.1-3.el6_4.1 for package: git-all-1.7.1-3.el6_4.1.noarch
--> Processing Dependency: git-gui = 1.7.1-3.el6_4.1 for package: git-all-1.7.1-3.el6_4.1.noarch
--> Processing Dependency: git-email = 1.7.1-3.el6_4.1 for package: git-all-1.7.1-3.el6_4.1.noarch
--> Processing Dependency: git-cvs = 1.7.1-3.el6_4.1 for package: git-all-1.7.1-3.el6_4.1.noarch
--> Processing Dependency: git = 1.7.1-3.el6_4.1 for package: git-all-1.7.1-3.el6_4.1.noarch
--> Processing Dependency: emacs-git = 1.7.1-3.el6_4.1 for package: git-all-1.7.1-3.el6_4.1.noarch
--> Running transaction check
---> Package emacs-git.noarch 0:1.7.1-3.el6_4.1 will be installed
---> Package git.x86_64 0:1.7.1-3.el6_4.1 will be installed
---> Package git-cvs.noarch 0:1.7.1-3.el6_4.1 will be installed
---> Package git-email.noarch 0:1.7.1-3.el6_4.1 will be installed
---> Package git-gui.noarch 0:1.7.1-3.el6_4.1 will be installed
---> Package git-svn.noarch 0:1.7.1-3.el6_4.1 will be installed
---> Package gitk.noarch 0:1.7.1-3.el6_4.1 will be installed
---> Package perl-Git.noarch 0:1.7.1-3.el6_4.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

======================================================================================================================================================

 Package                             Arch                             Version                                    Repository                      Size
======================================================================================================================================================

Installing:
 git-all                             noarch                           1.7.1-3.el6_4.1                            base                            16 k
Installing for dependencies:
 emacs-git                           noarch                           1.7.1-3.el6_4.1                            base                            40 k
 git                                 x86_64                           1.7.1-3.el6_4.1                            base                           4.6 M
 git-cvs                             noarch                           1.7.1-3.el6_4.1                            base                            84 k
 git-email                           noarch                           1.7.1-3.el6_4.1                            base                            41 k
 git-gui                             noarch                           1.7.1-3.el6_4.1                            base                           216 k
 git-svn                             noarch                           1.7.1-3.el6_4.1                            base                            95 k
 gitk                                noarch                           1.7.1-3.el6_4.1                            base                           132 k
 perl-Git                            noarch                           1.7.1-3.el6_4.1                            base                            28 k

Transaction Summary
======================================================================================================================================================

Install       9 Package(s)

Total download size: 5.2 M
Installed size: 17 M
Is this ok [y/N]: y
Downloading Packages:
(1/9): emacs-git-1.7.1-3.el6_4.1.noarch.rpm                                                                                    |  40 kB     00:00

(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (2%)  2% [=                                               ]  0.0 B/s | 109 kB     --:-- ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (5%)  5% [==-                                             ] 228 kB/s | 255 kB     00:19 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (9%)  9% [====-                                           ] 258 kB/s | 471 kB     00:16 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (12%) 13% [======-                                        ] 279 kB/s | 656 kB     00:14 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (16%) 17% [========                                       ] 296 kB/s | 826 kB     00:13 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (19%) 20% [=========-                                     ] 310 kB/s | 986 kB     00:12 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (22%) 24% [===========-                                   ] 327 kB/s | 1.1 MB     00:10 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (25%) 27% [=============                                  ] 338 kB/s | 1.3 MB     00:10 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (28%) 31% [==============-                                ] 353 kB/s | 1.5 MB     00:09 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (32%) 35% [================-                              ] 368 kB/s | 1.6 MB     00:08 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (35%) 39% [==================                             ] 379 kB/s | 1.8 MB     00:07 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (38%) 42% [====================                           ] 392 kB/s | 2.0 MB     00:06 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (41%) 46% [======================                         ] 404 kB/s | 2.2 MB     00:06 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (45%) 50% [=======================-                       ] 416 kB/s | 2.3 MB     00:05 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (47%) 52% [========================-                      ] 411 kB/s | 2.4 MB     00:05 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (50%) 56% [==========================-                    ] 421 kB/s | 2.6 MB     00:04 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (53%) 60% [============================                   ] 431 kB/s | 2.8 MB     00:04 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (56%) 63% [==============================                 ] 440 kB/s | 2.9 MB     00:03 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (60%) 67% [===============================-               ] 450 kB/s | 3.1 MB     00:03 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (63%) 71% [=================================-             ] 458 kB/s | 3.3 MB     00:02 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (67%) 75% [===================================            ] 467 kB/s | 3.5 MB     00:02 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (69%) 78% [====================================-          ] 469 kB/s | 3.6 MB     00:02 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (73%) 82% [======================================-        ] 476 kB/s | 3.8 MB     00:01 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (76%) 86% [========================================       ] 481 kB/s | 4.0 MB     00:01 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (79%) 89% [==========================================     ] 484 kB/s | 4.1 MB     00:01 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (81%) 91% [==========================================-    ] 472 kB/s | 4.2 MB     00:00 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (84%) 95% [=============================================  ] 484 kB/s | 4.4 MB     00:00 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                     (87%) 99% [==============================================-] 487 kB/s | 4.6 MB     00:00 ETA
(2/9): git-1.7.1-3.el6_4.1.x86_64.rpm                                                                                          | 4.6 MB     00:08

(3/9): git-all-1.7.1-3.el6_4.1.noarch.rpm                                                                                      |  16 kB     00:00

(4/9): git-cvs-1.7.1-3.el6_4.1.noarch.rpm                                                                                      |  84 kB     00:00

(5/9): git-email-1.7.1-3.el6_4.1.noarch.rpm                                                                                    |  41 kB     00:00

(6/9): git-gui-1.7.1-3.el6_4.1.noarch.rpm                 (92%) 41% [===================                            ]  0.0 B/s |  89 kB     --:-- ETA
(6/9): git-gui-1.7.1-3.el6_4.1.noarch.rpm                 (95%) 97% [=============================================- ] 118 kB/s | 210 kB     00:00 ETA
(6/9): git-gui-1.7.1-3.el6_4.1.noarch.rpm                 (95%) 99% [==============================================-] 111 kB/s | 214 kB     00:00 ETA
(6/9): git-gui-1.7.1-3.el6_4.1.noarch.rpm                                                                                      | 216 kB     00:01

(7/9): git-svn-1.7.1-3.el6_4.1.noarch.rpm                 (96%) 89% [==========================================     ]  0.0 B/s |  85 kB     --:-- ETA
(7/9): git-svn-1.7.1-3.el6_4.1.noarch.rpm                                                                                      |  95 kB     00:00

(8/9): gitk-1.7.1-3.el6_4.1.noarch.rpm                    (98%) 77% [====================================           ]  0.0 B/s | 102 kB     --:-- ETA
(8/9): gitk-1.7.1-3.el6_4.1.noarch.rpm                                                                                         | 132 kB     00:00

(9/9): perl-Git-1.7.1-3.el6_4.1.noarch.rpm                                                                                     |  28 kB     00:00

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

Total                                                                                                                 295 kB/s | 5.2 MB     00:18

Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : git-1.7.1-3.el6_4.1.x86_64                                                                                                         1/9

  Installing : perl-Git-1.7.1-3.el6_4.1.noarch                                                                                                    2/9

  Installing : gitk-1.7.1-3.el6_4.1.noarch                                                                                                        3/9

  Installing : git-gui-1.7.1-3.el6_4.1.noarch                                                                                                     4/9

  Installing : git-svn-1.7.1-3.el6_4.1.noarch                                                                                                     5/9

  Installing : git-email-1.7.1-3.el6_4.1.noarch                                                                                                   6/9

  Installing : git-cvs-1.7.1-3.el6_4.1.noarch                                                                                                     7/9

  Installing : emacs-git-1.7.1-3.el6_4.1.noarch                                                                                                   8/9

  Installing : git-all-1.7.1-3.el6_4.1.noarch                                                                                                     9/9

  Verifying  : perl-Git-1.7.1-3.el6_4.1.noarch                                                                                                    1/9

  Verifying  : git-svn-1.7.1-3.el6_4.1.noarch                                                                                                     2/9

  Verifying  : git-email-1.7.1-3.el6_4.1.noarch                                                                                                   3/9

  Verifying  : git-gui-1.7.1-3.el6_4.1.noarch                                                                                                     4/9

  Verifying  : emacs-git-1.7.1-3.el6_4.1.noarch                                                                                                   5/9

  Verifying  : git-1.7.1-3.el6_4.1.x86_64                                                                                                         6/9

  Verifying  : gitk-1.7.1-3.el6_4.1.noarch                                                                                                        7/9

  Verifying  : git-cvs-1.7.1-3.el6_4.1.noarch                                                                                                     8/9

  Verifying  : git-all-1.7.1-3.el6_4.1.noarch                                                                                                     9/9


Installed:
  git-all.noarch 0:1.7.1-3.el6_4.1


Dependency Installed:
  emacs-git.noarch 0:1.7.1-3.el6_4.1    git.x86_64 0:1.7.1-3.el6_4.1        git-cvs.noarch 0:1.7.1-3.el6_4.1    git-email.noarch 0:1.7.1-3.el6_4.1
  git-gui.noarch 0:1.7.1-3.el6_4.1      git-svn.noarch 0:1.7.1-3.el6_4.1    gitk.noarch 0:1.7.1-3.el6_4.1       perl-Git.noarch 0:1.7.1-3.el6_4.1

Complete!
[root@vagrant-centos65 vagrant]#

Reference: git

How To Install Apache Tomcat 7 on CentOS 6.5 by Yum


Video: clickMe

Install Tomcat
1. yum install tomcat or sudo yum install tomcat
2. /usr/share/tomcat
3. vi /usr/share/tomcat/conf/tomcat.conf
4. JAVA_OPTS > -Xmx500m -XX:MaxPermSize=256m -XX:+UseConcMarkSweepGC
Install Admin Packages
1. sudo yum install tomcat-webapps tomcat-admin-webapps
2. sudo vi /usr/share/tomcat/conf/tomcat-users.xml
3. Add
    <tomcat-users>
    <user username="tutorialbyexample" password="vinod"    roles="manager-gui,admin-gui"/>
     </tomcat-users>
or

Un comment the commented user and role

or

Replace the file content by below:

<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<tomcat-users>
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
-->
<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.
-->

  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>


 <role rolename="admin"/>
 <role rolename="admin-gui"/>
 <role rolename="admin-script"/>
 <role rolename="manager"/>
 <role rolename="manager-gui"/>
<role rolename="manager-script"/>
 <role rolename="manager-jmx"/>
 <role rolename="manager-status"/>
<user name="admin" password="adminadmin" roles="admin,manager,admin-gui,admin-script,manager-gui,manager-script,manager-jmx,manager-status" />
</tomcat-users>


4. Start tomcat /etc/init.d/tomcat start
5. Access the Web Interface
    http://server_IP_address:8080 or  http://127.0.0.1:8080




How to install Apache 2 httpd in CentOS6.5 and sample example with html file


How to install Apache 2 httpd in CentOS6.5 and sample example with html file



Assumption, Installed:
CentOS
Putty
Internet connected or rpm download

How to install Apache 2 in CentOS
1. yum install httpd
2. start the apache > /etc/init.d/httpd start
3. abc.html for small demo
4. Run in any browser
5. Output


Please like and share it!

How to install java-1.8.0-openjdk and java-1.8.0-openjdk-devel in CentOS 6.5

Logging with root user and perform bellow command:
1. For java:
   su -c "yum install java-1.8.0-openjdk" 
2. For javac:
   su -c "yum install java-1.8.0-openjdk-devel"
Video:





[root@vagrant-centos65 tutorialbyexample.com]# su -c "yum install java-1.8.0-openjdk"
Loaded plugins: fastestmirror, versionlock
Setting up Install Process
Loading mirror speeds from cached hostfile
epel/metalink | 27 kB 00:00
* base: mirror.as29550.net
* epel: epel.besthosting.ua
* extras: anorien.csc.warwick.ac.uk
* updates: anorien.csc.warwick.ac.uk
base | 3.7 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
updates/primary_db | 3.3 MB 00:03
Resolving Dependencies
--> Running transaction check
---> Package java-1.8.0-openjdk.x86_64 1:1.8.0.71-1.b15.el6_7 will be installed
--> Processing Dependency: java-1.8.0-openjdk-headless = 1:1.8.0.71-1.b15.el6_7 for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: xorg-x11-fonts-Type1 for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libpng12.so.0(PNG12_0)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libjvm.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libjpeg.so.62(LIBJPEG_6.2)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libjli.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libjava.so(SUNWprivate_1.1)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libasound.so.2(ALSA_0.9.0rc4)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libasound.so.2(ALSA_0.9)(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: fontconfig for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libpng12.so.0()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libjvm.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libjpeg.so.62()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libjli.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libjava.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libgif.so.4()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libawt.so()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libasound.so.2()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libXtst.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libXrender.so.1()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libXi.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: libXext.so.6()(64bit) for package: 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64
--> Running transaction check
---> Package alsa-lib.x86_64 0:1.0.22-3.el6 will be installed
---> Package fontconfig.x86_64 0:2.8.0-5.el6 will be installed
--> Processing Dependency: freetype >= 2.1.4 for package: fontconfig-2.8.0-5.el6.x86_64
--> Processing Dependency: libfreetype.so.6()(64bit) for package: fontconfig-2.8.0-5.el6.x86_64
---> Package giflib.x86_64 0:4.1.6-3.1.el6 will be installed
--> Processing Dependency: libSM.so.6()(64bit) for package: giflib-4.1.6-3.1.el6.x86_64
--> Processing Dependency: libICE.so.6()(64bit) for package: giflib-4.1.6-3.1.el6.x86_64
---> Package java-1.8.0-openjdk-headless.x86_64 1:1.8.0.71-1.b15.el6_7 will be installed
--> Processing Dependency: tzdata-java >= 2014f-1 for package: 1:java-1.8.0-openjdk-headless-1.8.0.71-1.b15.el6_7.x86_64
--> Processing Dependency: jpackage-utils for package: 1:java-1.8.0-openjdk-headless-1.8.0.71-1.b15.el6_7.x86_64
---> Package libXext.x86_64 0:1.3.2-2.1.el6 will be installed
---> Package libXi.x86_64 0:1.7.2-2.2.el6 will be installed
---> Package libXrender.x86_64 0:0.9.8-2.1.el6 will be installed
---> Package libXtst.x86_64 0:1.2.2-2.1.el6 will be installed
---> Package libjpeg-turbo.x86_64 0:1.2.1-3.el6_5 will be installed
---> Package libpng.x86_64 2:1.2.49-2.el6_7 will be installed
---> Package xorg-x11-fonts-Type1.noarch 0:7.2-11.el6 will be installed
--> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-11.el6.noarch
--> Processing Dependency: ttmkfdir for package: xorg-x11-fonts-Type1-7.2-11.el6.noarch
--> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.2-11.el6.noarch
--> Processing Dependency: mkfontdir for package: xorg-x11-fonts-Type1-7.2-11.el6.noarch
--> Running transaction check
---> Package freetype.x86_64 0:2.3.11-15.el6_6.1 will be installed
---> Package jpackage-utils.noarch 0:1.7.5-3.14.el6 will be installed
---> Package libICE.x86_64 0:1.0.6-1.el6 will be installed
---> Package libSM.x86_64 0:1.2.1-2.el6 will be installed
---> Package ttmkfdir.x86_64 0:3.0.9-32.1.el6 will be installed
---> Package tzdata-java.noarch 0:2015g-2.el6 will be installed
---> Package xorg-x11-font-utils.x86_64 1:7.2-11.el6 will be installed
--> Processing Dependency: libfontenc.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.2-11.el6.x86_64
--> Processing Dependency: libXfont.so.1()(64bit) for package: 1:xorg-x11-font-utils-7.2-11.el6.x86_64
--> Running transaction check
---> Package libXfont.x86_64 0:1.4.5-5.el6_7 will be installed
---> Package libfontenc.x86_64 0:1.0.5-2.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved

===============================================================================================================================================================================================
Package Arch Version Repository Size
===============================================================================================================================================================================================
Installing:
java-1.8.0-openjdk x86_64 1:1.8.0.71-1.b15.el6_7 updates 190 k
Installing for dependencies:
alsa-lib x86_64 1.0.22-3.el6 base 370 k
fontconfig x86_64 2.8.0-5.el6 base 186 k
freetype x86_64 2.3.11-15.el6_6.1 base 361 k
giflib x86_64 4.1.6-3.1.el6 base 37 k
java-1.8.0-openjdk-headless x86_64 1:1.8.0.71-1.b15.el6_7 updates 32 M
jpackage-utils noarch 1.7.5-3.14.el6 base 60 k
libICE x86_64 1.0.6-1.el6 base 53 k
libSM x86_64 1.2.1-2.el6 base 37 k
libXext x86_64 1.3.2-2.1.el6 base 35 k
libXfont x86_64 1.4.5-5.el6_7 updates 137 k
libXi x86_64 1.7.2-2.2.el6 base 37 k
libXrender x86_64 0.9.8-2.1.el6 base 24 k
libXtst x86_64 1.2.2-2.1.el6 base 19 k
libfontenc                                               x86_64                              1.0.5-2.el6                                           base                                  24 k
libjpeg-turbo x86_64 1.2.1-3.el6_5 base 174 k
libpng x86_64 2:1.2.49-2.el6_7 updates 182 k
ttmkfdir x86_64 3.0.9-32.1.el6 base 43 k
tzdata-java noarch 2015g-2.el6 updates 177 k
xorg-x11-font-utils x86_64 1:7.2-11.el6 base 75 k
xorg-x11-fonts-Type1 noarch 7.2-11.el6 base 520 k
Transaction Summary
===============================================================================================================================================================================================
Install 21 Package(s)

Total download size: 34 M
Installed size: 108 M
Is this ok [y/N]: y
Downloading Packages:
(1/21): alsa-lib-1.0.22-3.el6.x86_64.rpm | 370 kB 00:00
(2/21): fontconfig-2.8.0-5.el6.x86_64.rpm | 186 kB 00:00
(3/21): freetype-2.3.11-15.el6_6.1.x86_64.rpm | 361 kB 00:00
(4/21): giflib-4.1.6-3.1.el6.x86_64.rpm | 37 kB 00:00
(5/21): java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64.rpm | 190 kB 00:00
(6/21): java-1.8.0-openjdk-headless-1.8.0.71-1.b15.el6_7.x86_64.rpm | 32 MB 00:35
(7/21): jpackage-utils-1.7.5-3.14.el6.noarch.rpm | 60 kB 00:00
(8/21): libICE-1.0.6-1.el6.x86_64.rpm | 53 kB 00:00
(9/21): libSM-1.2.1-2.el6.x86_64.rpm | 37 kB 00:00
(10/21): libXext-1.3.2-2.1.el6.x86_64.rpm | 35 kB 00:00
(11/21): libXfont-1.4.5-5.el6_7.x86_64.rpm | 137 kB 00:00
(12/21): libXi-1.7.2-2.2.el6.x86_64.rpm  
                                                                             |  37 kB     00:00
(13/21): libXrender-0.9.8-2.1.el6.x86_64.rpm | 24 kB 00:00
(14/21): libXtst-1.2.2-2.1.el6.x86_64.rpm | 19 kB 00:00
(15/21): libfontenc-1.0.5-2.el6.x86_64.rpm | 24 kB 00:00
(16/21): libjpeg-turbo-1.2.1-3.el6_5.x86_64.rpm | 174 kB 00:00
(17/21): libpng-1.2.49-2.el6_7.x86_64.rpm | 182 kB 00:00
(18/21): ttmkfdir-3.0.9-32.1.el6.x86_64.rpm | 43 kB 00:00
(19/21): tzdata-java-2015g-2.el6.noarch.rpm | 177 kB 00:00
(20/21): xorg-x11-font-utils-7.2-11.el6.x86_64.rpm | 75 kB 00:00
(21/21): xorg-x11-fonts-Type1-7.2-11.el6.noarch.rpm | 520 kB 00:00
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total 898 kB/s | 34 MB 00:39
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : freetype-2.3.11-15.el6_6.1.x86_64 1/21
Installing : libXext-1.3.2-2.1.el6.x86_64 2/21
Installing : libXi-1.7.2-2.2.el6.x86_64 3/21
Installing : fontconfig-2.8.0-5.el6.x86_64 4/21
Installing : libjpeg-turbo-1.2.1-3.el6_5.x86_64 5/21
Installing : libfontenc-1.0.5-2.el6.x86_64 6/21
Installing : libICE-1.0.6-1.el6.x86_64 7/21
Installing : libSM-1.2.1-2.el6.x86_64 8/21
Installing : giflib-4.1.6-3.1.el6.x86_64 9/21
Installing : libXfont-1.4.5-5.el6_7.x86_64 10/21
Installing : 1:xorg-x11-font-utils-7.2-11.el6.x86_64 11/21
Installing : libXtst-1.2.2-2.1.el6.x86_64 12/21
Installing : ttmkfdir-3.0.9-32.1.el6.x86_64 13/21
Installing : xorg-x11-fonts-Type1-7.2-11.el6.noarch 14/21
Installing : 2:libpng-1.2.49-2.el6_7.x86_64 15/21
Installing : tzdata-java-2015g-2.el6.noarch 16/21
Installing : alsa-lib-1.0.22-3.el6.x86_64 17/21
Installing : jpackage-utils-1.7.5-3.14.el6.noarch 18/21
Installing : 1:java-1.8.0-openjdk-headless-1.8.0.71-1.b15.el6_7.x86_64 19/21
Installing : libXrender-0.9.8-2.1.el6.x86_64 20/21
Installing : 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64 21/21
Verifying : ttmkfdir-3.0.9-32.1.el6.x86_64 1/21
Verifying : libXi-1.7.2-2.2.el6.x86_64 2/21
Verifying : libXrender-0.9.8-2.1.el6.x86_64 3/21
Verifying : libXext-1.3.2-2.1.el6.x86_64 4/21
Verifying : libXfont-1.4.5-5.el6_7.x86_64 5/21
Verifying : jpackage-utils-1.7.5-3.14.el6.noarch 6/21
Verifying : libICE-1.0.6-1.el6.x86_64 7/21
Verifying : libfontenc-1.0.5-2.el6.x86_64 8/21
Verifying : alsa-lib-1.0.22-3.el6.x86_64 9/21
Verifying : fontconfig-2.8.0-5.el6.x86_64 10/21
Verifying : 1:xorg-x11-font-utils-7.2-11.el6.x86_64 11/21
Verifying : freetype-2.3.11-15.el6_6.1.x86_64 12/21
Verifying : libXtst-1.2.2-2.1.el6.x86_64 13/21
Verifying : xorg-x11-fonts-Type1-7.2-11.el6.noarch 14/21
Verifying : 1:java-1.8.0-openjdk-1.8.0.71-1.b15.el6_7.x86_64 15/21
Verifying : 1:java-1.8.0-openjdk-headless-1.8.0.71-1.b15.el6_7.x86_64 16/21
Verifying : libjpeg-turbo-1.2.1-3.el6_5.x86_64 17/21
Verifying : tzdata-java-2015g-2.el6.noarch 18/21
Verifying : giflib-4.1.6-3.1.el6.x86_64 19/21
Verifying : libSM-1.2.1-2.el6.x86_64 20/21
Verifying : 2:libpng-1.2.49-2.el6_7.x86_64 21/21

Installed:
java-1.8.0-openjdk.x86_64 1:1.8.0.71-1.b15.el6_7

Dependency Installed:
alsa-lib.x86_64 0:1.0.22-3.el6 fontconfig.x86_64 0:2.8.0-5.el6 freetype.x86_64 0:2.3.11-15.el6_6.1 giflib.x86_64 0:4.1.6-3.1.el6
java-1.8.0-openjdk-headless.x86_64 1:1.8.0.71-1.b15.el6_7 jpackage-utils.noarch 0:1.7.5-3.14.el6 libICE.x86_64 0:1.0.6-1.el6 libSM.x86_64 0:1.2.1-2.el6
libXext.x86_64 0:1.3.2-2.1.el6 libXfont.x86_64 0:1.4.5-5.el6_7 libXi.x86_64 0:1.7.2-2.2.el6 libXrender.x86_64 0:0.9.8-2.1.el6
libXtst.x86_64 0:1.2.2-2.1.el6 libfontenc.x86_64 0:1.0.5-2.el6 libjpeg-turbo.x86_64 0:1.2.1-3.el6_5 libpng.x86_64 2:1.2.49-2.el6_7
ttmkfdir.x86_64 0:3.0.9-32.1.el6 tzdata-java.noarch 0:2015g-2.el6 xorg-x11-font-utils.x86_64 1:7.2-11.el6 xorg-x11-fonts-Type1.noarch 0:7.2-11.el6

Complete!
[root@vagrant-centos65 tutorialbyexample.com]# java
Usage: java [-options] class [args...]
(to execute a class)
or java [-options] -jar jarfile [args...]
(to execute a jar file)
where options include:
-d32 use a 32-bit data model if available
-d64 use a 64-bit data model if available
-server to select the "server" VM
The default VM is server.

-cp
-classpath
A : separated list of directories, JAR archives,
and ZIP archives to search for class files.
-D=
set a system property
-verbose:[class|gc|jni]
enable verbose output
-version print product version and exit
-version:
Warning: this feature is deprecated and will be removed
in a future release.
require the specified version to run
-showversion print product version and continue
-jre-restrict-search | -no-jre-restrict-search
Warning: this feature is deprecated and will be removed
in a future release.
include/exclude user private JREs in the version search
-? -help print this help message
-X print help on non-standard options
-ea[:...|:]
-enableassertions[:...|:]
enable assertions with specified granularity
-da[:...|:]
-disableassertions[:...|:]
disable assertions with specified granularity
-esa | -enablesystemassertions
enable system assertions
-dsa | -disablesystemassertions
disable system assertions
-agentlib:[=]
load native agent library , e.g. -agentlib:hprof
see also, -agentlib:jdwp=help and -agentlib:hprof=help
-agentpath:[=]
load native agent library by full pathname
-javaagent:[=]
load Java programming language agent, see java.lang.instrument
-splash:
show splash screen with specified image
See http://www.oracle.com/technetwork/java/javase/documentation/index.html for more details.

java-1.8.0-openjdk-devel:
[root@vagrant-centos65 bin]# su -c "yum install java-1.8.0-openjdk-devel"Loaded plugins: fastestmirror, versionlock Setting up Install Process Loading mirror speeds from cached hostfile * base: mirror.as29550.net * epel: epel.besthosting.ua * extras: anorien.csc.warwick.ac.uk * updates: anorien.csc.warwick.ac.uk Resolving Dependencies --> Running transaction check ---> Package java-1.8.0-openjdk-devel.x86_64 1:1.8.0.71-1.b15.el6_7 will be installed --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================================================================== Installing: java-1.8.0-openjdk-devel x86_64 1:1.8.0.71-1.b15.el6_7 updates 10 M Transaction Summary =============================================================================================================================================================================================== Install 1 Package(s) Total download size: 10 M Installed size: 40 M Is this ok [y/N]: y Downloading Packages: java-1.8.0-openjdk-devel-1.8.0.71-1.b15.el6_7.x86_64.rpm | 10 MB 00:08 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : 1:java-1.8.0-openjdk-devel-1.8.0.71-1.b15.el6_7.x86_64 1/1 Verifying : 1:java-1.8.0-openjdk-devel-1.8.0.71-1.b15.el6_7.x86_64 1/1 Installed: java-1.8.0-openjdk-devel.x86_64 1:1.8.0.71-1.b15.el6_7 Complete!

[root@vagrant-centos65 bin]#
[root@vagrant-centos65 bin]#
[root@vagrant-centos65 bin]# javac
Usage: javac
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are used
-classpath Specify where to find user class files and annotation processors
-cp Specify where to find user class files and annotation processors
-sourcepath Specify where to find input source files
-bootclasspath Override location of bootstrap class files
-extdirs Override location of installed extensions
-endorseddirs Override location of endorsed standards path
-proc:{none,only} Control whether annotation processing and/or compilation is done.
-processor [,,...] Names of the annotation processors to run; bypasses default discovery process
-processorpath Specify where to find annotation processors
-parameters Generate metadata for reflection on method parameters
-d Specify where to place generated class files
-s Specify where to place generated source files
-h Specify where to place generated native header files
-implicit:{none,class} Specify whether or not to generate class files for implicitly referenced files
-encoding Specify character encoding used by source files
-source Provide source compatibility with specified release
-target Generate class files for specific VM version
-profile Check that API used is available in the specified profile
-version Version information
-help Print a synopsis of standard options
-Akey[=value] Options to pass to annotation processors
-X Print a synopsis of nonstandard options
-J Pass directly to the runtime system
-Werror Terminate compilation if warnings occur
@ Read options and filenames from file


All done!!

Ref: http://openjdk.java.net/

How to configured the Apache web server (virtual host) for using the two web server (tomcat -1 and tomcat 2)


Follow the following steps:
1. Installed the Apache httpd in Apache server.
2. Install the java or upgrade
3. Install the tomcat in web server.
4. Access the virtual host from client with domain name.
















In more details:
1. Installed the Apache httpd in Apache server.
Logging into the Apache server with root user
Note: I'm using the,Red Hat Enterprise Linux
# yum install httpd
To start/stop/restart the Apache/httpd, run:
# chkconfig httpd on
# /etc/init.d/httpd start/stop/restart

 Edit the Apache conf file, httpd.conf located under /etc/httpd/conf/httpd.conf
 #vi /etc/httpd/conf/httpd.conf

Add the below in end of file

<VirtualHost *:80>
        DocumentRoot /home/www/www.tutorialbyexample.com
        ServerName  www.tutorialbyexample.com

        ProxyPass                      /     ajp://localhost:20010/ retry=0 ttl=600
        ProxyPassReverse        /      ajp://localhost:20010/

        ProxyPass                      /*     ajp://localhost:20010/* retry=0 ttl=600
        ProxyPassReverse        /*      ajp://localhost:20010/*
</VirtualHost>

<VirtualHost *:80>
        DocumentRoot /home/www/www.apacheserverwebserver.com
        ServerName  www.apacheserverwebserver.com

        ProxyPass                      /     ajp://localhost:20020/ retry=0 ttl=600
        ProxyPassReverse        /      ajp://localhost:20020/

        ProxyPass                      /*     ajp://localhost:20020/* retry=0 ttl=600
        ProxyPassReverse        /*      ajp://localhost:20020/*

</VirtualHost>

Save it and close it.
Restart the Apache server: /etc/init.d/httpd restart
Note: # indicate i have logging with root user.

2. Install the java or upgrade
Refer the java installation.

3. Install the tomcat in web server.
Refer the tomcat install in Unix.

Assuming tomcat have installed in both web server and configure with AJP port
Web Server 1 (tomcat with AJP port 20010)
Web Server 2 (tomcat with AJP port 20020)

Just check,
/tomcate/conf/server.xml
 <Connector  protocol="AJP/1.3"  URIEncoding="UTF-8"  port="20010" />

and
<Connector  protocol="AJP/1.3"  URIEncoding="UTF-8"  port="20020" />

Restart the tomcat.

4. Access the virtual host from client with domain name. 
Access the both virtual host (vhost) from any client as mention below.

www.tutorialbyexample.com
www.apacheserverwebserver.com

Note: All about in your network accessible area, don't expect this conf for outside of world (over internet).

Reference: vhost

Sed command for find and replace matched word from file


Just replace the word from access.log: We’ve one file called access.log with below mention data/line.
Replacing the “five-5-success-factor.html” with “replace.html”.

access.log:
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/success HTTP 200
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/five-5-success-factor.htmlHTTP 200
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/success HTTP 200
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/five-5-success-factor.htmlHTTP 200
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/five-5-success-factor.html
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/

Command:
sed -i 's/five-5-success-factor.html/replace.html/g' access_200.log

Output in same file access.log:
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/success HTTP 200
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/replace.htmlHTTP 200
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/success HTTP 200
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/replace.htmlHTTP 200
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/replace.html

Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/

Sed command for deleting the matched line from file

Just delete the line from access.log: We’ve one file called access.log with below mention data/line.

Command:
sed -i '/\/five-5-success-factor.html/d' access.log

access.log:
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/success HTTP 200
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/five-5-success-factor.htmlHTTP 200
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/success HTTP 200
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/five-5-success-factor.htmlHTTP 200
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/
This is the success page of five success by POST http://www.tutorialbyexample.com/2015/09/five-5-success-factor.html
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/

Output in same file access.log:
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/success HTTP 200
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/success HTTP 200
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/
Hello tutorialbyexample, home page access by GET http://www.tutorialbyexample.com/

Command explanation:
sed -i '/\/five-5-success-factor.html/d' access.log

sed –i option will replace in same file. It will open for manipulations and write it in same file.

“/five-5-success-factor.html” this is the actual data want to find but we can’t use / as data so just added escape char \ for considering / as data.
And it consider as “\/five-5-success-factor.html” for finding the string.


/d for deleting the line, which matched as per find string.

Next

Ref from Unix manual.