Friday, August 19, 2016

Selenium Installation (JAVA) On Windows and MAC

Selenium Installation (JAVA)
OS : Windows and MAC
1 INSTALL JAVA ON YOUR COMPUTER
Download and install the Java Software Development Kit (JDK).
http://www.oracle.com/technetwork/java/javase/downloads/index.html

This JDK version comes bundled with Java Runtime Environment (JRE) so you do not need to download and install the JRE separately.

1.1 JDK INSTALLATION FOR MAC OS

Note that installing the JDK on a Mac is performed on a system wide basis, for all users, and administrator privileges are required. You cannot install Java for a single user.
Installing the JDK also installs the JRE. The one exception is that the system will not replace the current JRE with a lower version. To install a lower version of the JRE, first uninstall the current version.
When you download the Java Development Kit (JDK), the associated Java Runtime Environment (JRE) is installed at the same time. The JavaFX SDK and Runtime are also installed and integrated into the standard JDK directory structure.
Depending on your processor, the downloaded file has one of the following names:
jdk-7u<version>-macosx-amd64.dmg
jdk-7u<version>-macosx-x64.dmg
Where <version> is 6 or later.
1. Download the file. Before the file can be downloaded, you must accept the license agreement.
2. From either the Downloads window of the browser, or from the file browser, double click the .dmg file to launch it.
3. A Finder window appears containing an icon of an open box and the name of the .pkg file Double click the package icon to launch the Install app.
4. The Install app displays the Introduction window. Click Continue.
4a. Note that, in some cases, a Destination Select window appears. This is a bug, as there is only one option available. If you see this window, select Install for all users of this computer to enable the continue button. Click Continue.
5. The Installation Type window appears. Click Install.
6. A window appears which says "Installer is trying to install new software. Type your password to allow this." Enter the Administrator login and password and click Install Software.
7. The software is installed and a confirmation window appears
After the software is installed, delete the dmg file if you want to save disk space.

1.2 UNINSTALL THE JDK (MAC OS)

To uninstall the JDK, you must have Administrator privileges and execute the remove command either as root or by using the sudo(8) tool.
Navigate to /Library/Java/JavaVirtualMachines and remove the directory whose name matches the following format:*
    /Library/Java/JavaVirtualMachines/jdk<major>.<minor>.<macro[_update]>.jdk
For example, to uninstall 7u6:
    % rm -rf jdk1.7.0_06.jdk

Do not attempt to uninstall Java by removing the Java tools from /usr/bin. This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.
*The 7u4 and 7u5 releases were installed into a directory that does not follow this format. To uninstall 7u4 or 7u5, remove the 1.7.0.jdk directory from the same location.


2 INSTALL ECLIPSE IDE

Download "Eclipse IDE for Java Developers".
http://www.eclipse.org/downloads/
Be sure to choose correctly between Windows 32 Bit and 64 Bit versions.


You should be able to download a ZIP file named "eclipse-java-juno-SR1-win32-x86_64.zip" (the version number "SR1" may change over time).

Inside that ZIP file, there is an "eclipse" folder which contains all the application files. You can extract the "eclipse" folder anywhere you want in your PC; but for this tutorial, extract it to your C drive.

Unlike other popular software, no installation is required to use eclipse.
For MAC OS:



3 DOWNLOAD THE SELENIUM JAVA CLIENT DRIVER

You can download the Selenium Java Client Driver from
http://docs.seleniumhq.org/download/
You will find client drivers for other languages there, but only choose the one for Java.



This download comes as a ZIP file named "selenium-2.25.0.zip". For simplicity, extract the contents of this ZIP file on your C drive so that you would have the directory "C:\selenium-2.25.0\". This directory contains all the JAR files that we would later import on Eclipse.

4 CONFIGURE ECLIPSE IDE WITH WEB DRIVER

1. Launch the "eclipse.exe" file inside the "eclipse" folder that we extracted in step 2. If you followed step 2 correctly, the executable should be located on C:\eclipse\eclipse.exe.
2. When asked to select for a workspace, just accept the default location.



3. Create a new project through File > New > Java Project. Name the project as "myproject".
4. Right-click on the newly created project and select New > Package, and name that package as "mypackage".
5. Create a new Java class under mypackage by right-clicking on it and then selecting New > Class, and then name it as "myclass". Your Eclipse IDE should look like the image below.

6. Right-click on myproject and select Properties.
7. On the Properties dialog, click on "Java Build Path".
8. Click on the Libraries tab, and then click "Add External JARs.."
9. Navigate to C:\selenium-2.25.0\ (or any other location where you saved the extracted contents of "selenium-2.25.0.zip" in step 3).
10. Add all the JAR files inside and outside the "libs" folder. Your Properties dialog should now look similar to the image below.

11. Finally, click OK and we are done importing Selenium libraries into our project.

Redis Installation Centos

Redis Installation Centos

Step-1

If gcc already installed ignore or else install
# yum install make gcc

Step 2

Download to location   /tmp or somewhere else
# wget http://redis.io/download    Redis latestversion .gz  file

#tar –xf  Redis-version ****.tar.gz

Step-3

Now we are ready to install Redis from the source.
# cd redis ****
# make
# make install

Step 4

Move all of the redis executable files to the /opt directory by issuing the following sequence of commands:
cp /opt/redis/redis.conf /opt/redis/redis.conf.default

cp /opt/redis/src/redis-benchmark /opt/redis/

cp /opt/redis/src/redis-cli /opt/redis/

cp /opt/redis/src/redis-server /opt/redis/

cp /opt/redis/src/redis-check-aof /opt/redis/

cp /opt/redis/src/redis-check-dump /opt/redis/




Step-5

Redis Configuration
All Redis configuration options can be specified in the redis.conf file located at /opt/redis/redis.conf. Issue the following command to create this file from the default configuration file:
cp /opt/redis/redis.conf.default  /opt/redis/redis.conf
 
Consider the following Configuration
File :  redis.conf
1.    daemonize  yes

2.    pidfile  /var/run/redis.pid

3.    port 6379

4.    bind 127.0.0.1    (uncomment)

5.    timeout 300

6.    databases 16

7.    save 900 1
save 300 10
save 60 10000

8.    rdbcompression  yes

# The filename where to dump the DB
9.    dbfilename /opt/redis/db/dump.rdb  ( need to notify  db path)

# The working directory.
10.  dir /opt/redis/    (need to Specify Dir  Here) 

11.  appendonly no

12.  logfile "/var/log/redis.log"



  

Step 6

Deploy init Script

Get code from below   its an example
http://www.linode.com/docs/assets/631-redis-init-rpm.sh
 
 
 Changes need to be done according to your Conf in the script file
 
               # Touch /var/log/redis.log
 
                               # Chkconfig --add redis
 
                                              # Chkconfig redis on

Step -7

Redis will  Now start  with following commands
# /etc/init.d/redis start
 
# /etc/init.d/redis  stop

Step-8

# /opt/redis/redis-cli

Source  :

integration_svn_ldapauthentication_centos

Installing/Configuring CentOS

Install CentOS with default partition and make sure you have web server (http package) with PHP support installed. Once the installation is finished and you are logged in as root, I suggest that you install the latest updates by running
[root@svn ~]# yum update
Install subversion and mod_dav_svn packages
[root@svn ~]# yum install subversion mod_dav_svn enscript php-ldap
encrypt package is used by WebSVN for code highlighting and formatting.

Active Directory/LDAP Configuration

 If your LDAP deployment doesn’t support anonymous bind, create a user in LDAP which can be used to bind and perform queries. By default, anonymous LDAP operations, except root DSE searches and binds are not permitted on Windows 2003 domain controllers. As my deployment involves Windows 2003 based domain controller, I created a user named ‘LDAP User‘ (Logon Name ‘ldapuser‘) in Users container.
Before proceeding with rest of the setup, its a good idea to test the bind using the user which will be used for binding and search queries. I used a free utility available from Softerra named LDAP Browser which is available for free download at:

http://www.softerra.com/download.htm

In rest of the setup, I will use imaginary domain called domain.example.com. My user principal name will be ldapuser@domain.example.com and the distinguished name for the same will be
CN=LDAP User,CN=Users,DC=domain,DC=example,DC=com.


The FQDN for active directory domain server is adserver.domain.example.com.


WebSVN Configuration
Create a directory which will hold the SVN repositories. I used /var/www/ for this purpose
mkdir -p /var/www/svn 
 
 
 
Next, download the latest WebSVN package from http://www.websvn.info
 
[root@svn ~]# cd /usr/local/src
 
   [root@svn ~]# wget http://websvn.tigris.org/files/documents/1380/45918/websvn 2.2.1.tar.gz
 
   [root@svn ~]# tar zxvf websvn-2.2.1.tar.gz
 
   [root@svn ~]# mv websvn-2.2.1 /var/www/
   [root@svn ~]# cd /var/www/
==
           [root@svn ~]# ls
 
[root@svn ~]# cd /etc/httpd/conf.d/
 
[root@svn ~]# vim websvn.conf
 
Add the below line  
Alias /websvn /var/www/websvn

<Location "/">
AuthBasicProvider ldap
    AuthType Basic
   AuthzLDAPAuthoritative off
   AuthName "Subversion Repository Web Browsing"
   AuthLDAPURL "ldap://ldap.domainname.com:3268/DC=xx,DC=xx,DC=xx,DC=xx?sAMAccountName?sub?(objectClass=*)" NONE
   #AuthLDAPBindDN "CN=LDAP User,CN=Users,DC=domain,DC=example,DC=com"
   AuthLDAPBindDN "CN=xx,OU=Application Mail,DC=xx,DC=xx,DC=xx,DC=xx"
   AuthLDAPBindPassword xxxxxx
 
    require valid-user
     </Location>

    And save the file
 
     [root@svn ~]# service httpd restart

       Next, create the new configuration file for WebSVN from default configuration files ships with the package.

cd /var/www/websvn/include
cp distconfig.php config.php

You can edit the config.php file according to your environment. For every repository, you have add the parent path to directory which holds the repositories. In my case, /srv/svn is the directory which will hold all the repositories so I added the below line to config.php
$config-&gt;parentPath('/var/www/svn');

$extEnscript[".pl"] = "perl";
$extEnscript[".py"] = "python";
$extEnscript[".sql"] = "sql";
$extEnscript[".java"] = "java";
$extEnscript[".html"] = "html";
$extEnscript[".xml"] = "html";
$extEnscript[".thtml"] = "html";
$extEnscript[".tpl"] = "html";
$extEnscript[".sh"] = "bash";

Restart the apache service for changes to take effect
service httpd restart
Lets create a repository which we can use for testing.
[root@svn ~]# svnadmin create --fs-type fsfs /var/www/svn/testing20100121

Try accessing the alias using the URL http://<hostname>/websvn and if things work out good, you should have access to your repositories through WebSVN interface.


Configuring WebDAV

Configuring WebDAV access for subversion requires mod_dav_svn module which we already installed in previous steps. Installing mod_dav_svn RPM also creates configuration file subversion.conf under /etc/httpd/conf.d directory.
To use WebDAV for SVN repositories, repository directory should be owned by web server user (apache). Change the ownership of our test SVN repository to apache user

[root@svn ~]# chown -R apache.apache /var/www/svn/testing20100121

Next, edit subversion.conf file and
vim /etc/httpd/conf.d/subversion.conf
add the following lines.
   <Location />
 
DAV svn
SVNParentPath /var/www/svn
 
AuthBasicProvider ldap
AuthType Basic
AuthzLDAPAuthoritative off
AuthName "Subversion Repository Web Browsing"
AuthLDAPURL "ldap://ldap.domain name.com:3268/DC=xx,DC=xx,DC=xx,DC=xx?sAMAccountName?sub?(objectClass=*)" NONE
#AuthLDAPBindDN "CN=LDAP User,CN=Users,DC=domain,DC=example,DC=com"
AuthLDAPBindDN "CN=xx,OU=Application Mail,DC=xx,DC=xx,DC=xx,DC=xx"
AuthLDAPBindPassword xxx
 
require valid-user
 
</Location>
 
 
 
.
Lets, restart the apache service for changes to take effect
 service httpd restart
 
 
 

 



 
[r



Windows Active Directory Integration with Samba for RHEL & CentOS

Active Directory Integration with Samba for RHEL/CentOS 5



This article will show us how to join your Linux server into the Active Directory domain, how to integrate the Active Directory user accounts into the Linux user accounts and how to authenticate users in Active Directory using Winbind, a component of Samba.

Samba is installed by default when you select the Server installation type during the installation process. to check the Winbind status type

[root@localhost ~]# service smb status

 In case you need to install

[root@localhost ~]# yum install samba

Winbind is installed by Default to check the Winbind status type

[root@localhost ~]# service Winbind status

And need to do changes in the configuratation files which are in

1. /etc/samba/smb.conf
2. /etc/pam.d/system-auth-ac
3. /etc/nsswitch.conf
4. /etc/krb5.conf


First take backup of the files before doing modifications in the file



Changes according to the Files

 /etc/samba/smb.conf

Do the changes as per the below in your smb.conf file.

#=============== Global Settings==========
[global]
# ----------------------- Network Related Options -------------------------
#
# workgroup = NT-Domain-Name or Workgroup-Name,
eg: MIDEARTH
#
# server string is the equivalent of the NT Description field
#
# netbios name can be used to specify a server name not tied to the hostname
#
# Interfaces lets you configure Samba to use multiple interfaces
# If you have multiple network interfaces then you can list the ones
# you want to listen on (never omit localhost)
#
# Hosts Allow/Hosts Deny lets you restrict who can connect
 and you can
# specify it as a per share option as well
#

        workgroup = (Domain Name)
        server string = Samba Server Version %v

;       netbios name = MYSERVER

  
;       interfaces = lo eth0 192.168.1.2/24  (Your IP Range)

;       hosts allow = 127. 192.168.1. 192.168.0.

interfaces = lo eth0 192.168.0.47/24
         hosts allow = 127. 192.168.0. 192.168.40.
         security = ads
         realm=(Domain name)
         encrypt passwords = yes
         smb passwd file = /etc/samba/smbpasswd
         allow trusted domains = yes
         unix password sync = Yes
         passwd program = /usr/bin/passwd %u
          passwd chat = *New*password* %n\n *Retype*new*password* %n\n *passwd:*all*authentication*tokens*updated*successfully*
         pam password change = yes
         obey pam restrictions = yes
         socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
         dns proxy = no
         idmap uid = 16777216-33554431
         idmap gid = 16777216-33554431
         winbind use default domain = yes
         winbind separator = #
         winbind enum users = yes
         winbind enum groups = yes
         template shell=/bin/bash
         template homedir = /home/%U

# ----------------------- Standalone Server Options ------------------------
#
# Security can be set to user, share(deprecated) or server(deprecated)
#
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.

        security = user
        passdb backend = tdbsam

# ----------------------- Domain Members Options ------------------------
#
# Security must be set to domain or ads
#
# Use the realm option only with security = ads
# Specifies the Active Directory realm the host is part of
#
# Backend to store user information in. New installations should
# use either tdbsam or ldapsam. smbpasswd is available for backwards
# compatibility. tdbsam requires no further configuration.
#
# Use password server option only with security = server or if you can't
# use the DNS to locate Domain Controllers
# The argument list may include:
#   password server = My_PDC_Name [My_BDC_Name] [My_Next_BDC_Name]
# or to auto-locate the domain controller/s
#   password server = *


;       security = domain
;       passdb backend = tdbsam
;       realm = MY_REALM

;       password server = <NT-Server-Name>

security = domain
        passdb backend = tdbsam
        realm = (Domain Name)

        password server = *

# A publicly accessible directory, but read only, except for people in
# the "staff" group

        [public]
        comment = Public Stuff
        path = /home/public
        public = yes
        writable = yes

;       printable = no
;       write list = +staff
===========================================

/etc/pam.d/system-auth-ac

#%PAM-1.0
# This file is auto-generated.
# User changes will be destroyed the next time authconfig is run.
auth        required      pam_env.so
auth        sufficient    pam_unix.so nullok try_first_pass
auth       sufficient    pam_krb5.so use_first_pass
auth       sufficient    pam_winbind.so use_first_pass
auth        requisite     pam_succeed_if.so uid >= 500 quiet
auth        required      pam_deny.so

account     required      pam_unix.so
account     sufficient    pam_succeed_if.so uid < 500 quiet
account          [default=bad success=ok user_unknown=ignore] pam_krb5.so
account     [default=bad success=ok user_unknown=ignore] pam_winbind.so
account     required      pam_permit.so
#account     requisite      pam_succeed_if.so user ingroup unix

password    requisite     pam_cracklib.so try_first_pass retry=3
password    sufficient    pam_unix.so md5 shadow nullok try_first_pass use_authtok
password    sufficient    pam_unix.so nullok use_authtok md5 shadow
password    sufficient    pam_winbind.so use_authtok
password    required      pam_deny.so

session     optional      pam_keyinit.so revoke
session     required      pam_limits.so
session     [success=1 default=ignore] pam_succeed_if.so service in crond quiet use_uid
session     required      pam_unix.so
session          optional    pam_mkhomedir.so skel=etc/skel/ umask=0027
session     optional      pam_krb5.so

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

/etc/nsswitch.conf


# Example:
#passwd:    db files nisplus nis
#shadow:    db files nisplus nis
#group:     db files nisplus nis

passwd:     files winbind
shadow:     files winbind
group:      files winbind

#hosts:     db files nisplus nis dns
hosts:      files dns

# Example - obey only what nisplus tells us...
#services:   nisplus [NOTFOUND=return] files
#networks:   nisplus [NOTFOUND=return] files
#protocols:  nisplus [NOTFOUND=return] files
#rpc:        nisplus [NOTFOUND=return] files
#ethers:     nisplus [NOTFOUND=return] files
#netmasks:   nisplus [NOTFOUND=return] files    

bootparams: nisplus [NOTFOUND=return] files

ethers:     files
netmasks:   files
networks:   files
protocols:  files winbind
rpc:        files
services:   files winbind

netgroup:   files winbind

publickey:  nisplus

automount:  files winbind
aliases:    files nisplus

=========================================================
/etc/krb5.conf

[logging]
 default = FILE:/var/log/krb5libs.log
 kdc = FILE:/var/log/krb5kdc.log
 admin_server = FILE:/var/log/kadmind.log

[libdefaults]
 default_realm = (Domain Name)
 dns_lookup_realm = true
 dns_lookup_kdc = true
 ticket_lifetime = 24h
 forwardable = yes

[realms]
 (Domain Name) = {
  kdc = (Domain Server Name):88
  admin_server = (Domain Server Name):749
  default_domain = Domain Name
 }

[domain_realm]
 .Domain name  = Domain Name
  Domain name  = Domain Name

[appdefaults]
 pam = {
   debug = false
   ticket_lifetime = 36000
   renew_lifetime = 36000
   forwardable = true
   krb4_convert = false
 }

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

And there  is modifications in the host file to

./etc/hosts

# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1          (servername.domain name) localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6

192.168.0.6 (servername.domain name)

After modifying the files start the smb and Winbind services.

[root@localhost ~]# service smb start

Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]

[root@localhost ~]# service winbind start

Starting Winbind services:                                 [  OK  ]

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

Join the Samba Server to the PDC Domain


Use the below Command to join  samba server to the pdc

[root@localhost ~]# net rpc join -S servername -U administrator

Password:

After  giving the password we can see the below result

Joined domain (servername).

Restart the “Winbind and smb” services

[root@localhost ~]# service smb restart

Shutting down SMB services:                                [  OK  ]
Shutting down NMB services:                                [  OK  ]
Starting SMB services:                                     [  OK  ]
Starting NMB services:                                     [  OK  ]

[root@localhost ~]# service winbind restart

Shutting down Winbind services:                            [  OK  ]


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

Now for testing and  get some information about the users on your PDC:
root# /usr/local/samba/bin/wbinfo -u
This should echo back a list of users on your Windows users on your PDC. For example, I get the following response:
CEO\Administrator
CEO\burdell
CEO\Guest

And  same sort of thing to get group information from the PDC:
root# wbinfo –g

CEO\Domain Admins
CEO\Domain Users
CEO\Domain Guests
CEO\Domain Computers