CentOS timezone config

CentOS timezone config files and directories

  • /usr/share/zoneinfo/ – The system timezone directory contains the files as per timezone name. For example, the file /usr/share/zoneinfo/America/New_York represents time zone for New York.
  • /etc/localtime – It is a symlink to the file localtime or to the correct timezone file in the system located in /usr/share/zoneinfo/ directory.

Read More

.htaccess Error Documents

Apache allows you to customize the server at the directory level, using .htaccess files. This tutorial explains how to use them to serve custom 404 error (page not found), and other common error pages, to your users.
Server response codes
A server reponse code is a three digit number sent by a server to a user in response to a request for a web page or document. They tell the user whether the request can be completed, or if the server needs more information, or if the server cannot complete the request. Usually, these codes are sent ‘silently’ – so you never see them, as a user – however, there are some common ones that you may wish to set up error pages for, and they are listed below. Most people will only ever need to set up error pages for server codes 400, 401, 403, 404 and 500, and you would be wise to always have an error document for 404 errors at the very least.
It is also relatively important to ensure that any error page is over 512 bytes in size. Internet Explorer 5, when sent an error page of less than 512 bytes, will display its own default error document instead of your one. Feel free to use padding if this is an issue – personally, I’m not going to increase the size of a page because Internet Explorer 5 doesn’t behave well.
In order to set up an error page for any other error codes, you simply add more lines to your .htaccess file. If you wanted to have error pages for the above five errors, your .htaccess file might look something like this:
ErrorDocument 400 /400.html
ErrorDocument 401 /401.html
ErrorDocument 403 /403.html
ErrorDocument 404 /404.html
ErrorDocument 500 /500.html Read More

How do I set Windows to boot as the default in grub

How do I set grub so that in my dualboot with Windows and Ubuntu Linux.
The two ways are:

  • Boot which ever operating system you booted last time, the “saved method”
    This is the one I use. It lets me decide which one I going to use and will allow me to reboot into that system, handy when I’m updating.
  • Boot a specific operating system by default.
    The answer to your exact question.

Read More

Secure Your Web Site from Clickjacking Attack

Clickjacking is well known web application vulnerabilities. For example, it was used as an attack on Twitter. To defense Clickjacking attack on your Apache web server, you can use X-FRAME-OPTIONS to avoid your website being hacked from Clickjacking.
The X-Frame-Options in HTTP response header can be used to indicate whether or not a browser should be allowed to open a page in frame or iframe. This will prevent site content embedded into other sites. Did you every try embed Google.com in your website as frame? You can’t because it’s protected and you can protect it too. Read More