Tuesday, March 26, 2013

OpenSolaris issue DNS not working solved


I manually configured Open Solaris(2009 edition),however the DNS is not working,here how it worked out for me

Nslookup resolves the name to an ip, but pinging doesn’t make it to the box…


Static IP address

Assigning a static IP address on OpenSolaris is accomplished by editing the hostname files in the directory /etc. For example, assign a static IP address to interface bge0 by editing /etc/hostname.bge0:

192.168.0.123

Set the netmask by editing the file /etc/inet/netmasks:

192.168.0.0 255.255.255.0

Set the default gateway by editing the file /etc/defaultrouter:

192.168.0.1

Note: in this solution makes sure you have fill the DNS in the GUI mode, System > Administration > Network > DNS

and make sure file /etc/resolv.conf contain the same DNS as you fill in the GUI mode

This is exactly my problems :

Successfully Resolving DNS

 nslookup http://www.yahoo.com
Server:        202.138.224.2
Address:    202.138.224.2#53

Non-authoritative answer:
http://www.yahoo.com    canonical name = http://www.wa1.b.yahoo.com.
http://www.wa1.b.yahoo.com    canonical name = www-real.wa1.b.yahoo.com.
Name:    www-real.wa1.b.yahoo.com
Address: 209.131.36.158

Pinging IP address successfully

 ping 209.131.36.158
209.131.36.158 is alive

BUT failed to ping hostname

 ping -l http://www.yahoo.com
ping: unknown host http://www.yahoo.com

So the fix is

Open your terminal and switch to root user, then edit your /etc/nsswitch.conf file and add the word “dns“ to the hosts and ipnodes lines

This is my nsswitch.conf file snippet:



passwd:     files
group:      files
hosts:      dns
ipnodes:    dns
networks:   files
protocols:  files
rpc:        files


There is default backup of /etc/nsswitch.conf file you can also just copy /etc/nsswitch.dns over it…

 cp /etc/nsswitch.dns /etc/nsswitch.conf

You may also want to check that auto-magic mode has been disabled when setting up your networking manually;

svcs -a | grep nwam

If it is enabled type;

svcadm disable svc:/network/physical:nwam

And you are done!!!


source:http://dxzstudioz.wordpress.com/2009/11/28/opensolaris-dns-resolving-problem-when-using-static-ip/

source: http://www.jansipke.nl/network-configuration-on-opensolaris/

Tuesday, March 12, 2013

Connecting Oracle 10g express using PHP and Apche on Scientific Linux 6.2


Installed Oracle 10g Express on Scientific Linux 6.2 before

http://wowmoron.blogspot.in/2012/12/install-oracle-10g-express-on.html


Ok installed PHP and Apache on Scientific Linux 6.2 before

http://wowmoron.blogspot.in/2012/11/install-apachemysqlphp-lamp-on-centos.html

Now connecting Oracle 10g express using PHP

all we have to do basically installing zend server community edition

so the steps are

create a file

/etc/yum.repos.d/zend.repo



[Zend]
name=zend-server
baseurl=http://repos.zend.com/zend-server/6.0/rpm/$basearch
enabled=1
gpgcheck=1
gpgkey=http://repos.zend.com/zend.key

[Zend_noarch]
name=zend-server - noarch
baseurl=http://repos.zend.com/zend-server/6.0/rpm/noarch
enabled=1
gpgcheck=1
gpgkey=http://repos.zend.com/zend.key

save the file and close


yum install zend-server-php-5.3



after this

nano /var/www/html/database.php


  
&lt?php

    $conn = oci_connect("hr", "your_hr_password", "127.0.0.1/XE");

    $stid = oci_parse($conn, "select last_name, salary from employees");
    oci_execute($stid);

    $nrows = oci_fetch_all($stid, $results);

    echo "&lthtml>&lthead>&lttitle>Oracle PHP Test&lt/title>&lt/head>&ltbody>";
    echo "&ltcenter>&lth2>Oracle PHP Test&lt/h2>&ltbr>";
    echo "&lttable border=1 cellspacing='0' width='50%'>\n&lttr>\n";
    echo "&lttd>&ltb>Name&lt/b>&lt/td>\n&lttd>&ltb>Salary&lt/b>&lt/td>\n&lt/tr>\n";

    for ($i = 0; $i &lt $nrows; $i++ ) {
      echo "&lttr>\n";
      echo "&lttd>" . $results["LAST_NAME"][$i] . "&lt/td>";
      echo "&lttd>$" . number_format($results["SALARY"][$i], 2). "&lt/td>";
      echo "&lt/tr>\n";
    }

    echo "&lttr>&lttd colspan='2'> Number of Rows: $nrows&lt/td>&lt/tr>&lt/table>";
    echo "&ltbr>&ltem>If you see data, then it works!&lt/em>&ltbr>&lt/center>&lt/body>&lt/html>\n";

  ?>

(ok as I can not use opening tag and closing tag in this blog I used > and < instead)

save the file and close

open your browser

localhost/database.php

you should see data and you are done



Sunday, March 10, 2013

Install and configure JDK and Tomcat in Scientific Linux 6 for the first time


download jdk rpm and install by rpm -ivh command

download tomcat package

tar -zxvf apache-tomcat-7.0.37.tar.gz -C /opt

sh -c 'echo export sourav_home=/opt/apache-tomcat-7.0.37 > /etc/profile.d/tomcat.sh'

source /etc/profile.d/tomcat.sh

to start tomcat

$sourav_home/bin/startup.sh

now open browser and go to

http://192.168.163.201:8080

and you will see the tomcat web interface

to shutdown tomcat

$sourav_home/bin/shutdown.sh

Now go to /opt/apache-tomcat-7.0.37/webapps/ and create a folder named sourav

create a.jsp there with some sample jsp code like this

<br>

go to browser and put this url

http://192.168.163.201:8080/ch01/a.jsp

and you are done!




Saturday, March 9, 2013

Static route and persistent route in server 2008


Add a static route 

by command line

route add 192.168.163.0 mask 255.255.255.0 192.168.163.2

we can see this route by the command

route print

but this route will be temporary as after restart it will be gone

so delete the route by

route delete 192.168.163.0

now add the route as a persistent route

route -p add 192.168.163.0 mask 255.255.255.0 192.168.163.2

or go to server manager,roles,network policy ..,routing and remote..,ipv4,static routes and add a route 

static route works much better than a default gateway,you can make the default gateway blank and use static routing  

Enable ping and remotely managing the firewall of server 2008 core


to enable ping(icmp) reply on server 2008 core

netsh firewall set icmpsetting 8

and then you should be able to ping  server 2008 from a remote machine

to enable remote firewall administration in server core

netsh advfirewall set currentprofile settings remotemanagement enable

then go to the remote machine

mmc-add remove snap in-windows firewall with advanced security-manage another computer,put the ip address of server 2008 core there and you will see all the firewall option like inbound rule etc there