Pages

Monday, October 1, 2012

Mercury email configuration!

To configure the email on Mercury, there are following steps that need to follow:


                                            
Mercury email setuup:

1- add a normal user
 -> configuration->manage local user-> add a user
 -> say- username: demouser personla name: Demo Usr, password : ***** secret: *****

2- add a alias for the demo user
 -> configuration -> aliases -> add new alias
 -> say: alias : demo@localhost.com , real address: 127.0.0.1

3- active protocol modules
 -> configuration -> protocol module
 -> enable only
 -> MercuryS smtp server
 -> MercuryC smtp relying client
 -> Mercury PH directory service server
 -> Mercury finger protocol server
 -> MercuryW popPass password change server
 -> MercuryX connection and process scheduler
 -> and restart the mercury.

4- go to Mercury core module
 -> configuration-> Mercury core module
 -> in general tab
  -> internet name must be: localhost
  -> disable send copies of error to postmaster
 -> in local domains
  -> add new domain for
   -> for IP address: local host or server :localhost.com, internet name: 192.168.x.x
   -> for localhost IP: local host or server :localhost.com, internet name: 127.0.0.1
   -> for localhost : local host or server :localhost.com, internet name: localhost

5- go to Mercury s smtp mail server
 -> in general tab: set IP Interface to use: 127.0.0.1
 -> in connection control tab:
  -> disable Do not permit SMTP relaying of non local mail.
  -> add restriction entry: Ip address range from: 127.0.0.1 to 127.0.0.1
  -> check allow connection and click on OK button

  -> add another restrcition entry for your ip address same as above
  


6- now go MercuryC Smtp server from configuration
 -> configuration -> MercuryC SMTP relay client configuration
 -> enter host name: smtp.gmail.com 
 -> connection port type : 465 and select SSL encryption using direct connection (port: 80 and selecy no ssl encrption)
 -> announce myself as: smtp.gmail.com (Administrator)

 -> and enter yor credential for gmail account credential.
 -> click on ok

7- restart Mercury

8- mail setup is done.




Thursday, June 14, 2012

Create a secure web application

As you know, everyone touch the web pages. Application are hard to secure.When it comes to security, remember that in addition to actual platform and operating system security issues, you need to ensure that you write your application to be secure. 


PHP programming mistakes that can result in security holes. By showing you what not to do, and how each particular flaw can be exploited, I hope that you’ll understand not just how to avoid these particular mistakes, but also why they result in security vulnerabilities. Understanding each possible flaw will help you avoid making the same mistakes in your PHP applications.

  1. Validate Input
    We can not trust on user input so we need to validate input DATA( Client side as well server side) before saving the data in the database.
  2. Register Global
    Register Global should be off in php_ini configuration file
  3. Minimize hidden Input Fields
    Hidden fields in the form should be use as minimum as possible.
  4. Database
    Your database related query should be protect mysql_injection.User password should be stored in md5 hash format.
  5. Session Management
    After login the user session should be regenered to insure user is valid.
  6. XSS Vulnerabilities
    To protect data against XSS attacks, filter your input through the htmlentities() function whenever the value of a variable is printed to the output. 
  7. Valid Post
    To halt invalid post by the hacker, need to use one time form token. A form must have the token Id that is valid for only one time post data to the server.

Why website is slow?

There are some reasons:

  1. Unoptimized Images
    Full size images or images are not cropped may causes the slow page. We should use optimized images in the web pages.
  2. Dynamic Script Page
    Pages that are generated from the data stored in the database are slower than Static pages. If data is taking time to get the from the database we should use caching.
  3. Bulky Code
    Bulky code can be white space in the page, inline style, external css, external javascript,  Div based layout instead of table based layout, using css shortcuts.
    We should avoid these as much possible.
  4. External Media
    Slideshow, flash, movies.
    if possible, we should store them own server.



Friday, May 25, 2012

Zend Framwork Installation on Ubuntu using CLI.


zend framework installation on linux- ubuntu

Steps

1- Install the zend framewok bin---- sudo apt-get install zend-framework-bin
2- zf create project myapp
3- creating a symlink of zend library(i had already this zend lib)
 sudo ln -s /var/www/zendLib/library/Zend/

   Or
   
   download the zend library and put into library folder in the created project

4- sudo chmod -R 777 myapp
/

5- go into your application say(myapp)
   cd myapp


6- Now createing the controller and all... using these commands..

 Project
     zf create project path name-of-profile file-of-profile
     zf show project
     Note: There are specialties, use zf show project.? to get specific help on them.

   Application
     zf change application.class-name-prefix class-name-prefix

   Model
     zf create model name module

   View
     zf create view controller-name action-name-or-simple-name

   Controller
     zf create controller name index-action-included[=1] module

   Action
     zf create action name controller-name[=Index] view-included[=1] module

   Module
     zf create module name

   Form
     zf create form name module

   Layout
     zf enable layout
     zf disable layout

   DbAdapter
     zf configure db-adapter dsn section-name[=production]

   DbTable
     zf create db-table name actual-table-name module force-overwrite
     Note: There are specialties, use zf create db-table.? to get specific help on them.

   ProjectProvider
     zf create project-provider name actions