Friday, 24 June 2016

How to integrate facebook like button in website?

How to integrate facebook like button  in website

Question: What is facebook like button?
Facebook give an embed code for like button, when you embed code this code people can like your page with this. They can also view friends who already have like your page.

Question: What are the requirement for facebook like button?
You must have following:
  1. Facebook Account
  2. Facebook App, If not https://www.facebook.com/help/172925542764476
  3. An Website where you will you will embed the code.



Question: How to get embed code for like button?
Open https://developers.facebook.com/docs/plugins/like-button and follow below steps
  1. Choose an URL of a website Page you want to use with the like button.
  2. Code Configurator from https://developers.facebook.com/docs/plugins/like-button#configurator
  3. Click on "Get Code" and past the code in website



Question: Give the sample code of Facebook like button?
<div id="fb-root">
</div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.6&appId=508427595967225";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

<div class="fb-like" data-action="like" data-href="http://www.web-technology-experts-notes.in" data-layout="standard" data-share="true" data-show-faces="true">
</div>
Output

Tuesday, 21 June 2016

How to hide web server information from the headers?

How to hide web server information from the headers?

Question: What do you mean by server technology in header?
When an request is sent from client to server.
OR
When an request is sent from one server to another server.
There are lot of information also sent back to client(receiver information).
For Example:
HTTP/1.1 200 OK
Date: Tue, 21 Jun 2016 05:24:34 GMT
Server: Apache/2.2.22 (Win32) PHP/5.4.3
X-Powered-By: PHP/5.4.3
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/html



Question: What are benefits of hiding server info from header?
An attacker will not get to know which technology you are using in your application.


Question: How to hide the Server technology information from header?
Step 1:
Open php.ini file
change
expose_php = on

to
expose_php = Off

Step 2:
Add Following in your .htacess (root folder)
ServerSignature Off

Step 3 Setup the mod_security with Apache
https://www.thefanclub.co.za/how-to/how-install-apache2-modsecurity-and-modevasive-ubuntu-1204-lts-server