Thursday, December 29, 2011

Web Service pre-configuration through python


Configuration of SOAPpy, fpconst and pyXml along with the python 2.6.0
--------------------------------------------------------------------------------------------
Packages & Versions
--------------------------------------------------------------------------------------------
1- Python 2.6.2
2- fpconst 0.7.2
3- PyXML 0.8.4
4- SOAPpy 0.12.0


--------------------------------------------------------------------------------------------
Installation Instruction
--------------------------------------------------------------------------------------------
1- Install Python 2.6.2
                1.1 Set the environment variable for class path : Ex: classpath="c:\python26"

2- Install fpconst
                2.1 Extract the zip file fpconst-0.7.2.tar.gz
                2.2 cd fpconst-0.7.2
                2.3 execute command: python setup.py install

3- Install PyXML
                3.1 Extract the zip file PyXML-0.8.4.tar.gz
                3.2 cd PyXML-0.8.4
                3.3 execute command: python setup.py install (causes some error) then the last command need to fire
                3.4 execute command: python setup.py install --force --skip-build (Showing that script/lib can not be created but its ok, Now verify the version)

4- Install SOAPpy
                4.1 Extract the zip file SOAPpy-0.12.0.zip.
                4.2 cd SOAPpy-0.12.0
                4.3 Go to the SOAPpy-0.12.0\SOAPpy directory
                4.4 Edit the Client.py file
                                4.4.1 find "from __future__ import nested_scopes" line
                                4.4.2 cut it and paste at the first line of file
                4.5 Edit the Server.py file
                                4.5.1 find "from __future__ import nested_scopes" line
                                4.5.2 cut it and paste at the first line of file
                4.6 Edit the Types.py file
                                4.6.1 find "from __future__ import nested_scopes" line
                                4.6.2 cut it and paste at the first line of file
                4.7 execute command: python setup.py install

Once finished, do verify all these installations.
 
---------------------------------------
Verifications
---------------------------------------
Open python ( type : python on command line).
1) Verify PyXml

                >>> import xml
                >>> xml.__version__
                '0.8.4'

2) Verify fpConstants
      >>> import fpconst
      >>> fpconst.__version__
     '0.7.2'

3) Verify SOAPpy
       >>> import SOAPpy
       >>> SOAPpy.__version__
       '0.12.0'

Tomcat service start-up failure on Windows Operating Systems

On particular flavors of Windows Operating System, the Tomcat Services fail to start even after being registered successfully. There might be the following reason behind this failure:
The type of the service runner (tomcat6.exe or tomcat7.exe) does not match with the destined Windows Operating System’s JRE configuration. There needs to be four different service runner files for the 4 different combinations:
  •  For 32-bit JRE6 (Or JDK6-whichever is applicable), use tomcat6.exe available with the Apache Tomcat 6 package for Windows 32-bit.
  •   For 64-bit JRE6, use tomcat6.exe available with the Apache Tomcat 6 package for Windows 64-bit.
  •   For 32-bit JRE7, use tomcat7.exe available with the Apache Tomcat 7 package for Windows 32-bit.
  •   For 64-bit JRE7, use tomcat7.exe available with the Apache Tomcat 7 package for Windows 64-bit.   
You can use environment variables for making decisions on runtime.

Tuesday, December 27, 2011

Configuration of SVN over http in Linux

Prerequisite:
                   1- Apache Server 2.0 or later.
                   2- finch dependency
                   3- libpurple dependency
                   4- apr and apr-util dependency

Installation of SVN :

• In terminal execute:
   [root@upload /]# yum install mod_dav_svn subversion
• It will resolve the dependency for SVN and then installed the distribution according to the default configuration.
• If you don't have Apache installed already, it'll go ahead and drag that down as well.

Configuration of Apache Server :

• First we need to check that apache is working fine or not...
   [root@upload /]# service httpd start
   [root@upload /]# chkconfig httpd on
• Check the server is on or not by entering the url
• http://localhost

Sub Versions Apache Configuration :

Next step to configure svn for apache.

• Navigate to directory of httpd config
  [root@upload /]# cd /etc/httpd/conf.d/
• Open the subversion.conf file in editor mode
  [root@upload /]# vim subversion.conf
• Make sure you uncomment the following if they are commented out
   LoadModule dav_svn_module modules/mod_dav_svn.so 
   LoadModule authz_svn_module modules/mod_authz_svn.so
• Add the following to allow a basic authentication and point Apache to where the actual repository resides.

<Location /repos>
DAV svn
SVNParentPath /var/www/svn
AuthType Basic
AuthName "Subversion repos"
AuthUserFile /etc/svn-auth-conf
Require valid-user
</Location>

• The location is what Apache will pass in the URL bar. For instance: http://localhost/repos points to the SVNPath that you have specified.

User and Password Configuration:

Next we have to actually create the password file that you specifie previous step. Initially you'll use the -cm arguments. This creates the file and also encrypts the password with MD5. If you need to add users make sure simply use the -m flag, and not the -c after the initial creation.

[root@upload /]# htpasswd -cm /etc/svn-auth-conf
username1
New password:
Re-type new password:
Adding password for user username1

[root@upload /]# htpasswd -m /etc/svn-auth-conf
username2
New password:
Re-type new password:
Adding password for user username2

Configure your Repository :

Next thing you need to do is to create the actual repository from which you will check in and out your files.

[root@upload /]# cd /var/www/
[root@upload /]# mkdir svn
[root@upload /]# cd svn
[root@upload /]# svnadmin create repos
[root@upload /]# chown -R apache.apache repos
[root@upload /]# service httpd restart

• Check access your repository from a web browser: http://localhost/ repos. You should get a popup box asking for a username and password.Put the username password username1 and password for that.
• Now you can access your repository from http://.

CheckOut :

 [root@upload /]# svn checkout http://localhost/repos
 Authentication realm: <http://localhost:80> Subversion repos
 Password for 'root': [Ex-root]
 Authentication realm: <http://localhost:80> Subversion repos
 Username: username1
 Password for 'user': [Ex-username1]
 Checked out revision 0.


Feel free to ask if you have any query.

Thank You