Kurinchi Blogger Scribbles …


Archive for the ‘LINUX’ Category

Dec 15
2011

How to check if linux server can send out email via command line?

Last updated: December 15th, 2011

Method 1:

$ mail -s “Subject: Test email from linux server” info@test.com

Press the “Return” key

Enter the body part of the email

Press ctrl + D

Enter a CC email if you would like (e.g. info2@test.com)

Press ctrl + D again

Then check the mail box to see if the mail has arrived.

(more…)

Dec 12
2011

Reverse DNS and Junk Email

Last updated: December 16th, 2011

Many email servers depend on Reverse DNS in order to identify if the mail is legit or spam. For the Reverse DNS to work correctly, two points need to be addressed
a) Look for IP address of the mail server should return its name. PTR record should be set for this
b) Reverse look on the name should return back the IP address

For example,

$ dig -x 217.83.122.34

;; ANSWER SECTION:

34.122.83.217.in-addr.arpa. 66372 IN PTR mail.example.com.

$ dig mail.example.com

;; ANSWER SECTION:

mail.example.com. 900 IN A 217.83.122.34

Check the IP address that is getting resolved matches the name that is getting returned back.

Nov 15
2011

Linux: How to upgrade PHP from 5.1 to 5.2 in CentOS5?

Last updated: November 15th, 2011

First Check PHP version that is currently installed

$ php -version

Check Linux Version

$ cat /etc/*-release (or redhat-release)

Create a repo file with the content given below. As you can note, we are looking for package upgrade related to php only.
(more…)

Oct 15
2011

Linux: How to list or allow access to ports ?

Last updated: November 15th, 2011

SELinux is a feature that may be turned on certain servers and it can restrict access to certain ports. In order to gain access and make the ports work, you need to open those ports.

To see if SELinux is set, type

$ sestatus

To list all port, try the semanage command

$ semanage port -l

To check for a specific port that is opened

$ semanage port -l | grep 8085

To allow access to a specific port

$ semanage port -a -t http_port_t -p tcp 8085

Aug 10
2011

MySQL: How to stop, start or restart mysql?

Last updated: August 10th, 2011

In linux, following commands are used to start/stop/restart mysql

$/etc/init.d/mysqld start
$/etc/init.d/mysqld restart
$/etc/init.d/mysqld stop

In windows, mysql runs as a service.
C:> net stop mysql
C:> net start mysql

Jul 20
2011

Linux: Case sensitive MySQL table names

Last updated: August 10th, 2011

When transitioning MySQL database from Windows to Linux, users often encounter issues related to case-sensitiveness. Windows is case-insensitive and Linux is case-sensitive.

In such scenarios when a database call is made after the application migration happens, users often run into errors which can send them in circles between the migration servers.

Solution to this problem is to add a single line of text under my.cnf (MySQL configuration file) under [mysqld] (more…)

Jun 25
2011

Apache: [warn] NameVirtualHost *:80 has no VirtualHosts

Last updated: June 25th, 2011

$ /etc/init.d/apache2 restart

After configuring Apache server settings on the name server, you may encounter a message “[warn] NameVirtualHost 192.168.1.3:80 has no VirtualHosts

The issue may be due to more than one entry of NameVirtualHost lines in the configuration settings. You can find this out by

$ grep NameVirtual * -R
site1:NameVirtualHost *:80
site2:NameVirtualHost *:80

Linux Solution: Remove one of the occurance of the NameVirtualHost and the warning message that you receive will vanish.

Jan 10
2011

Linux: How to display ONLY the directories?

Last updated: January 10th, 2011

To display a list of directories in Linux, issue the command

$ ls -l | egrep ‘^d’

Jun 05
2010

Beginner: Why there are many Linux Distributions?

Last updated: July 31st, 2010

There are different variants of Linux in the market like RedHat, Debian, CentOS, Ubuntu, Mandrake, Suse and a Linux beginner often ponder why they call Linux distributions by various names. The kernel or the heart of all the distributions is Linux and in bringing it to different market usage different community or vendors have adopted the kernel to serve that purpose.
(more…)


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict