scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.
Examples
Copy the file “foobar.txt” from a remote host to the local host
$ scp [email protected]:foobar.txt /some/local/directory Read More
Month: January 2016
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.
.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
Statistics for webserver on CentOS7
Install & Configure AWStats
Now that YUM has its additional repository we are ready to install. From the commandline type:
yum install awstats
Modify AWStats Apache Configuration:
nano /etc/httpd/conf.d/awstats.conf
Read More
Install Munin on CentOS 7
To install Munin on CentOS 7, we do this:
install munin munin-node
Enable and start:
systemctl enable munin-node
systemctl start munin-node
Opening the main munin configuration file:
nano /etc/munin/munin.conf
Read More
Create Self-Signed Certificates on Apache for CentOS
Install Mod SSL:
yum install mod_ssl
We need to create a new directory where we will store the server key and certificate:
mkdir /etc/httpd/ssl Read More
Install CentOS 7 web server
#Install ifconfig:
sudo yum install net-tools
#Other pakages:
sudo yum install nano wget htop mc net-tools curl
yum install yum-priorities Read More
CentOS grub update (Linux and Windows Dual boot)
yum install epel-release
#yum search ntfs
yum install ntfs-3g 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.
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