Kurinchi Blogger Scribbles …


Posts Tagged ‘LINUX’

Nov 24
2012

How to find the port used by mysql?

Last updated: November 24th, 2012

List the listening ports and check if mysql is listed on it.

$ netstat -tln | grep mysql

If you cannot find the port number for mysql view my.cnf file to see if you can find the port number. If you see a line “skip-networking” try commenting out the line and then restart mysql daemon.

$ vi /etc/my.cnf

[mysqld]
set-variable=local-infile=0
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
skip-networking

[mysql.server]
user=mysql
basedir=/var/lib

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

$ service mysqld restart

Sep 25
2012

How to check Python version number in Linux/Unix environment?

Last updated: September 25th, 2012

To check the Python version number in Linux, simply type


$ python -V

You will get an output

Python 2.4.3
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…)

Mar 18
2010

Linux: Password creation

Last updated: March 18th, 2010

To create a password file and to add users to it, use the command
$ htpasswd -cm /secured/.mypass username1

To add users to the already existing password file, use the command
$ htpasswd -m /secured/.mypass username2

When additional users are added to the password file, ensure that you don’t use the “-c” option.

Read Password protect directories here

Mar 16
2010

Linux: alias, unalias

Last updated: March 17th, 2010

Alias command comes handy when we are in need to make long and frequently used command string short.

To list the current set of aliases simply type
$ alias

To display the set alias for a specified alias name, type
$ alias alias-shortstring
Example:
$ alias ls

To set an alias you use the format
$ alias shortstring = “linux command string”
(more…)

Mar 07
2010

Apache: Where to put site configuration settings?

Last updated: March 17th, 2010

/etc/apache2/conf.d/ and /etc/apache2/sites-enabled are the two locations from where configuration settings are ready by apache

Apache configuration file has two lines (listed below) in /etc/apache2/apache2.conf which does that

# Include generic snippets of statements
Include /etc/apache2/conf.d/

# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/

Mar 05
2010

Ubuntu: Configuring Virtual Hosts to listen on different ports

Last updated: March 17th, 2010

Files to check
- /etc/apache2/ports.conf
- /etc/apache2/apache2.conf

Consider the ServerName to be “myserver”. Check /etc/hosts for an entry

127.0.0.1 localhost
192.168.1.100 myserver.com myserver

(more…)

Dec 27
2009

Linux: Determining IP information for eth0… failed

Last updated: December 27th, 2009

When setting up a workstation to connect to internet, you may come across a message
Determining IP information for eth0… failed

The above error message basically means that eth0 i.e your network interface card is not setup correctly.

Some of the commands that can come handy in troubleshooting where the error lies are listed below

$ dmesg | grep eth0
(displays information about the ethernet controller card, mac address etc.)

$ cat /etc/sysconfig/network(displays the network settings)
NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.122.1

$ cat /etc/sysconfig/network-scripts/ifcfp-eth0

$ ifconfig eth0 down (to down the nic)
$ ifconfig eth0 up (to start the nic)
$ netstat -rn (display kernel routing IP table)
$ cat ifcfg-eth0 (eth0 configuration settings)
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:16:18:33:B3:CF
ONBOOT=yes

$ service network restart (restart the network settings)

$ ping -c4 google.ca(to check if the internet connection works)

$ traceroute google.ca (to check how the IP navigation path is set)

Refer Red Hat linux 5 configure network article for additional info


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict