Kurinchi Blogger Scribbles …


Archive for the ‘Linux Server’ Category

Jul 20
2015

Apache webserver (httpd) service installation on CentOS 7 Linux

Last updated: July 22nd, 2015

First set up the httpd (web) service

$ yum install httpd

If httpd service is already installed, update the service

$ yum update httpd

Now, start the web server

$ service httpd start

Redirecting to /bin/systemctl start httpd.service

Check the status of the web server

$ service httpd status

(more…)

Jul 12
2015

Setup Virtualbox Additions on Centos 7 to share files

Last updated: July 22nd, 2015

First step is to install dependencies

$ sudo yum groupinstall “Development Tools”

$ sudo yum install kernel-devel

Mount the Virtualbox Additions CD ISO. You should download the virtualbox additions iso from http://download.virtualbox.org/virtualbox/ depending on your version of Virtual Box.

$ sudo mkdir /media/cdrom/

$ sudo mount /dev/cdrom /media/cdrom/

$ cd /media/cdrom

$ sudo ./VBoxLinuxAdditions.run

Before this step, create a shared folder in your host system. Say for example, if you created a shared folder named “CentosShare” in the host system you will follow the steps given below to access the share from within Centos.

$ mkdir ~/share

$ mount -t vboxs CentosShare ~/share

Apr 15
2015

PHP SYSTEM WARNING: ‘date(): It is not safe to rely on the system’s timezone settings

Last updated: July 14th, 2015

Edit /etc/php.ini and add the timezone setting within the file. For a list of timezone settings, visit http://php.net/manual/en/timezones.php


[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = America/New_York

Apr 14
2015

How to avoid search engines from crawling your website?

Last updated: July 14th, 2015

Your answer is to create a robots.txt file in the root of your web directory and to have the code setting given below in the file.

User-agent: *
Disallow: /

You can read more about Robots exclusion protocol, here

Jun 14
2013

Linux: How the password is stored, salted and hashed securely?

Last updated: June 14th, 2013

In earlier systems, passwords were stored in the file /etc/passwd and they were not encrypted.

After the user is created, an entry gets recorded in /etc/passwd with ‘x’ in the second column instead of the acutal password.

$ useradd timmy

$ cat /etc/passwd
timmy:x:1002:1003::/home/timmy:/bin/sh

For security reasons, passwords are now stored in the file /etc/shadow and they are encrypted. Password was not set initially, when the user was created. This is indicated by !! mark (in RedHat, ! – Debian)

$ cat /etc/shadow

timmy:!!:15870:0:99999:7:::

(more…)

Jan 10
2013

How to remove ^M characters at the end of lines in Vi from files in Linux?

Last updated: February 6th, 2013

Files created in windows when moved to linux will have ^M character at the end of lines when you open the files in Vi editor.

To remove the strange characters open the file in Vi editor and type

:%s/.$// 

(more…)

Dec 06
2012

How to determine the file system type in Linux?

Last updated: February 6th, 2013

Linux supports many file system types like Ext2, Ext3, Ext4, NFS, FAT16, FAT32, NTFS etc. To find out what type of file systems are mounted in your system, issue the command

$ df -T

Output from the command

Filesystem    Type   1K-blocks      Used Available Use% Mounted on
/dev/sda1     ext4    94088076   9090252  80218356  11% /
udev      devtmpfs     1023536         4   1023532   1% /dev
Nov 12
2012

How to install and setup Fail2ban on CentOS?

Last updated: November 12th, 2012

Fail2ban is a software used to ban IP’s which shows strange behavior. It can be configured to reject IP’s for a certain amount of time.

To install Fail2ban we need to download the application from the source. Login as the root user and go to /opt

$ cd /opt

$ wget http://downloads.sourceforge.net/project/fail2ban/fail2ban-stable/fail2ban-0.8.4/fail2ban-0.8.4.tar.bz2?use_mirror=transact

Next unzip the downloaded file

$ tar -xf fail2ban-0.8.4.tar.bz2

$ cd fail2ban-0.8.4
(more…)

Oct 02
2012

How to setup Rails on WAMP server using HTTP Proxy module?

Last updated: October 3rd, 2012

To setup Rails on windows after Ruby and Rails setup,

i) Edit hosts file in windows environment and set the server name in the hosts file to

127.0.0.1 myrails

In this example, i have used “myrails” as the server name for the project.

ii) Edit httpd configuration setting on WAMP to make sure proxy and proxy_http module is turned on (check if it those lines are not commented out)

LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so

(more…)

Oct 01
2012

How to install Ruby, Rails and MySQL on Ubuntu Server?

Last updated: October 1st, 2012

For this tutorial we will be using Ruby 1.9.3 and Rails 3.2.1

First thing update
$ sudo apt-get update

Next, we are going to install git, RVM which is essential for the build

$sudo apt-get install build-essential git-core curl

RVM stands for Ruby Version Manager that is used for installing and managing multiple versions of Ruby at one point of time.
(more…)


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict